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

Renaming the project root dir invalidates compilation cache #37647

Closed
alubbe opened this issue Nov 8, 2016 · 2 comments
Closed

Renaming the project root dir invalidates compilation cache #37647

alubbe opened this issue Nov 8, 2016 · 2 comments

Comments

@alubbe
Copy link

alubbe commented Nov 8, 2016

I was surprised to learn that renaming the project root dir invalidates the compilation cache. This is something that happens during every CI and deployment run, making it run quite a bit slower when none of the rust code was actually changed. Is this intentional / is there a way to keep the cache fresh when renaming the directory?

The behaviour can be reproduced as follows (stable 1.12.1):

/$ cargo new rrrrrr
     Created library `rrrrrr` project
/$ cd rrrrrr/
/rrrrrr$ cargo build
   Compiling rrrrrr v0.1.0 (file:///rrrrrr)                            <-- Code gets compiled
    Finished debug [unoptimized + debuginfo] target(s) in 0.11 secs 
/rrrrrr$ cargo build
    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs     <-- Code does not re-compile
/rrrrrr$ cargo build
    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs     <-- Code does not re-compile
/rrrrrr$ cd ..
/$ mv rrrrrr/ rrrrrr2/
/$ cd rrrrrr2/
/rrrrrr2$ cargo build
   Compiling rrrrrr v0.1.0 (file:///rrrrrr2)                           <-- Code re-compiles
    Finished debug [unoptimized + debuginfo] target(s) in 0.11 secs
@nagisa
Copy link
Member

nagisa commented Nov 8, 2016

The issue should be filled against cargo.

@alubbe
Copy link
Author

alubbe commented Nov 8, 2016

Right you are - closing in favour of rust-lang/cargo#3273

@alubbe alubbe closed this as completed Nov 8, 2016
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

2 participants