-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Improve CI caching by skipping mtime checks for paths in $CARGO_HOME #11613
Improve CI caching by skipping mtime checks for paths in $CARGO_HOME #11613
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @epage (or someone else) soon. Please see the contribution instructions for more information. |
53e1129
to
111a4a6
Compare
[COMPILING] mylib-sys [..] | ||
[RUNNING] `rustc --crate-name build_script_build [..] | ||
[RUNNING] `[..]build-script-build[..]` | ||
[RUNNING] `rustc --crate-name mylib_sys [..] | ||
[CHECKING] foo [..] | ||
[RUNNING] `rustc --crate-name foo [..] | ||
[FINISHED] [..]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the test looks good but one way to test the test is if you have one commit with the test showing the old behavior and then the commit with the fix also updates the test.
Not required but something you can do to be extra sure and communicate that to reviewers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the feedback on the comment, this looks good!
111a4a6
to
9e01c8b
Compare
@bors r+ |
☀️ Test successful - checks-actions |
11 commits in 985d561f0bb9b76ec043a2b12511790ec7a2b954..3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c 2023-01-20 14:39:28 +0000 to 2023-01-24 15:48:15 +0000 - Add a note about verifying your email address on crates.io (rust-lang/cargo#11620) - Improve CI caching by skipping mtime checks for paths in $CARGO_HOME (rust-lang/cargo#11613) - test: Update for clap 4.1.3 (rust-lang/cargo#11619) - Fix unused attribute on Windows. (rust-lang/cargo#11614) - [Doc]: Added links to the `Target` section of the glossary for occurences of `target triple` (rust-lang/cargo#11603) - feat: stabilize auto fix note (rust-lang/cargo#11558) - Clarify the difference between CARGO_CRATE_NAME and CARGO_PKG_NAME (rust-lang/cargo#11576) - Temporarily pin libgit2-sys. (rust-lang/cargo#11609) - Disable network SSH tests on windows. (rust-lang/cargo#11610) - fix(toml): Add `default-features` to `TomlWorkspaceDependency` (rust-lang/cargo#11409) - doc(contrib): remove rls in release process (rust-lang/cargo#11601)
Update cargo 11 commits in 985d561f0bb9b76ec043a2b12511790ec7a2b954..3c5af6bed9a1a243a693e8e22ee2486bd5b82a6c 2023-01-20 14:39:28 +0000 to 2023-01-24 15:48:15 +0000 - Add a note about verifying your email address on crates.io (rust-lang/cargo#11620) - Improve CI caching by skipping mtime checks for paths in $CARGO_HOME (rust-lang/cargo#11613) - test: Update for clap 4.1.3 (rust-lang/cargo#11619) - Fix unused attribute on Windows. (rust-lang/cargo#11614) - [Doc]: Added links to the `Target` section of the glossary for occurences of `target triple` (rust-lang/cargo#11603) - feat: stabilize auto fix note (rust-lang/cargo#11558) - Clarify the difference between CARGO_CRATE_NAME and CARGO_PKG_NAME (rust-lang/cargo#11576) - Temporarily pin libgit2-sys. (rust-lang/cargo#11609) - Disable network SSH tests on windows. (rust-lang/cargo#11610) - fix(toml): Add `default-features` to `TomlWorkspaceDependency` (rust-lang/cargo#11409) - doc(contrib): remove rls in release process (rust-lang/cargo#11601) r? `@ghost`
Perhaps an unintended effect of this change is that $CARGO_HOME/bin is also ignored, and that can be pretty surprising. See aya-rs/aya#668 for the nasty workaround that was required. |
Yep. The proposed fix is here #12090 (comment). Just no one yet picked it up. |
Looks like #12369 is working on this. |
Skip mtime checks for paths pointing into
$CARGO_HOME
to avoid rebuilds when only caching $CARGO_HOME/registry/{index, cache} and $CARGO_HOME/git/db and some of the dependencies havererun-if-changed=directory
in theirbuild.rs
I considered skipping mtime checking only on
$CARGO_HOME/registry/src
but it looks like other functionality (like downloading a newer version of dependency) is unaffected by this and this way we also cover the same issue with git based dependencies (except the part wherecargo
is forced to re-fetch submodules if$CARGO_HOME/git/checkouts
is missing) and it is more in line with the discussion in #9455Fix #11083
Credit @weihanglo for the test (I did add a case of checking that dependency update still triggers a rebuild but they are the original author of the rest of the test)