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

Removing a source file does not trigger a rebuild #1090

Closed
carllerche opened this issue Dec 25, 2014 · 4 comments
Closed

Removing a source file does not trigger a rebuild #1090

carllerche opened this issue Dec 25, 2014 · 4 comments

Comments

@carllerche
Copy link
Member

I accidentally RMed a source file. This did not trigger a rebuild, so the tests ran fine. I ended up pushing to Git broken code :(

Anyway, removing source file should trigger a rebuild.

@shepmaster
Copy link
Member

It's worth noting that many systems (that I'm aware of: Make, Rake, CMake) don't handle this case transparently. I first became aware of the problem because CMake suggests you add the names of all your source files to the CMakeLists.txt file, instead of using a glob.

@alexcrichton
Copy link
Member

Can you provide an example of what went wrong? A simple reproduction does not reproduce this error.

$ cargo build             
$ rm src/diff.rs        
$ cargo build          
   Compiling git2 v0.1.3 (file:///home/alex/code/git2-rs)
/home/alex/code/git2-rs/src/lib.rs:287:5: 287:9 error: file not found for module `diff`
/home/alex/code/git2-rs/src/lib.rs:287 mod diff;
                                           ^~~~
/home/alex/code/git2-rs/src/lib.rs:287:5: 287:9 help: name the file either diff.rs or diff/mod.rs inside the directory /home/alex/code/git2-rs/src
/home/alex/code/git2-rs/src/lib.rs:287 mod diff;
                                           ^~~~
Could not compile `git2`.

To learn more, run the command again with --verbose.

@carllerche
Copy link
Member Author

I can't seem to repro anymore either. It must have been a more complicated set of steps to cause the problem. Once I noticed the file was missing, I went back and ran cargo test, tests passed, I rm -rf target then ran cargo test again and it failed. But yeah, I can't repro in the simple case :( I wonder if it has to do with having multiple platforms (using vagrant) using the same target directory... unsure.

@alexcrichton
Copy link
Member

There was a bug like this awhile ago I fixed recently, but without a reproduction I'm gonna close this for now. Feel free to reopen though if it's rediscovered!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants