You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the CI, you can see that despite the cache is loaded (it's partial match since I changed package.metadata.docs.rs), cargo still re-compiles the everything:
Of which I can be sure that compiler_builtins is definitely used within std, cc might be used in build.rs of the std-related crates and I cannot found where allocator-api2 is compiled.
I also noticed that it compiles crates from $HOME/.rustup/toolchains:
since we install nightly using rustup in each run, the timestamp is newer than the cache, so that's also part of the reasons why it gets invalidated.
To fix this, rust-cache might have to:
cache cc, compiler_builtins
probably set the creation timestamp of the entire target to latest (after it recovers $CARGO_HOME)
This would also help in other scenario where target actually contains latest cache however due to timestamp is rebuilt.
The text was updated successfully, but these errors were encountered:
This is an interesting problem. Since we use the output of cargo metadata, it only knows about dependencies of the workspace, and does not consider std and any of its dependencies. Not to mention the timestamp issues you alluded to.
I would say this would be fairly complex to solve.
This is an interesting problem. Since we use the output of cargo metadata, it only knows about dependencies of the workspace, and does not consider std and any of its dependencies.
I guess maybe we can hardcode them?
Not to mention the timestamp issues you alluded to.
I think this can be solved by setting the creation time of target to the restore time, after $CARGO_HOME is restored.
I would say this would be fairly complex to solve.
Yeah, though I do think I should at least open an issue here to see if there's anyway we could improve this. build-std is still on nightly, so we could also request upstream to change the way it is implemented.
In the CI, you can see that despite the cache is loaded (it's partial match since I changed
package.metadata.docs.rs
),cargo
still re-compiles the everything:I noticed that
cargo
downloads a few crates that is used by std:Of which I can be sure that
compiler_builtins
is definitely used within std,cc
might be used inbuild.rs
of the std-related crates and I cannot found whereallocator-api2
is compiled.I also noticed that it compiles crates from
$HOME/.rustup/toolchains
:since we install
nightly
usingrustup
in each run, the timestamp is newer than the cache, so that's also part of the reasons why it gets invalidated.To fix this,
rust-cache
might have to:cc
,compiler_builtins
target
to latest (after it recovers$CARGO_HOME
)This would also help in other scenario where
target
actually contains latest cache however due to timestamp is rebuilt.The text was updated successfully, but these errors were encountered: