-
Notifications
You must be signed in to change notification settings - Fork 46
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
Strange behavior in CI and in interaction with cargo build #149
Comments
@TimJentzsch cargo-udeps has to pass special flags to some of the crates in the build graph. Thus, it purposefully makes cache behaviour different from Have you tried using a separate cache for |
@est31 Thanks for the quick reply! Which special flags do you set for the compilation process? Maybe they can be set for the install as well (if that's indeed the cause of the problem) to prevent the recompile. |
I don't really know what's going on here. It might factor in the age of the |
I tried to set |
It seems to download stuff from scratch in the rerun. That means the cache isn't working at all? |
Banging my head against this too. Caching I've tried testing on locally intermixing Is there something else which might be causing it to rebuild some packages? |
I think I may have made a breakthrough on this, seems it thinks that the build is out of date because when
|
Ok confirmed, seems the toolchain is using file Seems like fundamental toolchain issue, which rust-lang/cargo#6529 might address. |
Workaround in our flow was to add this to a step which uses the date of the nightly we're using as the date for all the files, ensuring they are in past.
You could get the date from
|
@stevenh wow that's a pretty cool trick! It's a workaround, yes, but very useful. |
I'm currently trying to reduce CI times and
cargo udeps
is now the slowest job by a factor of five.This is mainly caused by the job recompiling all dependencies on every run.
For the other cargo commands (e.g.
cargo build
), this can be avoided by caching (part of) the~/.cargo
and thetarget
folder.However, this approach doesn't appear to be working for
cargo udeps
.Strangely enough, if you put two
cargo udeps
steps after one another, the second one does not recompile -- so it seems to depend on something outside of~/.cargo
andtarget
.While trying to debug this issue, I also found that the compilation part of
cargo udeps
seems to be incompatible withcargo build
:When you run them after one another, they each do a full recompile.
Looking into this in more detail, we can use an env variable to get more information on why
cargo build
recompiles:This gives very strange messages such as:
You can see an example here.
I'd like to be able to cache the progress of
cargo udeps
somehow, i.e. know which files it needs access to in order to not recompile all the dependencies.This would significantly decrease the CI times.
I'm also curious about what is causing the incompatibility with
cargo build
, as cargo seems to be used directly in the code:cargo-udeps/src/lib.rs
Line 319 in 90c31b5
This doesn't need to be fixed though, as I won't do
cargo build
beforecargo udeps
in the CI workflow.Any help would be much appreciated! I hit a dead-end on my own research here.
The text was updated successfully, but these errors were encountered: