Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo recompiles unchanged re-saved files #8616

Closed
mattrossman opened this issue Aug 13, 2020 · 2 comments
Closed

Cargo recompiles unchanged re-saved files #8616

mattrossman opened this issue Aug 13, 2020 · 2 comments
Labels
C-bug Category: bug

Comments

@mattrossman
Copy link

mattrossman commented Aug 13, 2020

Problem
Re-saving a file but not changing its contents causes cargo to recompile the project.

This doesn't follow what's written in the Rust Programming Language book:

Cargo figured out that the files hadn’t changed, so it just ran the binary. If you had modified your source code, Cargo would have rebuilt the project before running

Steps

  1. Create a new project and build it
cargo new hello
cd hello
cargo build
  1. Open main.rs and re-save it, e.g. with vim src/main.rs and :wq
  2. Run another cargo build

Cargo will show a "Compiling" phase before "Finished" as if the file had changed.

Possible Solution(s)
Not sure what the current implementation is but perhaps it's considering the timestamp at which files were modified?

Notes

Output of cargo version:

cargo 1.45.1 (f242df6ed 2020-07-22)

I am on WSL running Ubuntu 20.04.

@mattrossman mattrossman added the C-bug Category: bug label Aug 13, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Aug 13, 2020

Yes we use mtime the, adding a way to look at contents is tracked in #6529

@ehuss
Copy link
Contributor

ehuss commented Aug 19, 2020

Closing as this is tracked in #6529, and fortunately someone is working on a solution at #8623.

@ehuss ehuss closed this as completed Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants