Skip to content

Conversation

smheidrich
Copy link
Contributor

What does this PR try to resolve?

If CARGO_LOG=cargo::core::compiler::fingerprint=info is set, cargo will print log messages that are useful for finding out why something is being recompiled. E.g. if the modification time (mtime) of a source file is newer than the cached build result, it will print something like:

stale: changed "/host//home/runner/.cargo/registry/src/github.com-1285ae84e5963aae/proc-macro2-1.0.47/build.rs"
          (vs) "/host/home/runner/target/release/build/proc-macro2-45f04ea9067a46ed/output"
               FileTime { seconds: 1666559031, nanos: 16426033 } != FileTime { seconds: 1666559080, nanos: 324117075 }

However, the != in the log message is misleading, as equality is not the criterion that's actually used to determine when to rebuild.

This PR fixes that by changing != to <, corresponding to the actual criterion.

How should we test and review this PR?

Look at the criterion I linked and trace stale_mtime in the log message back to path_mtime in said criterion to see why it has to be <.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2022
@ehuss
Copy link
Contributor

ehuss commented Oct 25, 2022

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Oct 25, 2022

📌 Commit f3fd53d has been approved by ehuss

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 25, 2022
@bors
Copy link
Contributor

bors commented Oct 25, 2022

⌛ Testing commit f3fd53d with merge 8adf1df...

@bors
Copy link
Contributor

bors commented Oct 25, 2022

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 8adf1df to master...

@bors bors merged commit 8adf1df into rust-lang:master Oct 25, 2022
compiler-errors pushed a commit to compiler-errors/rust that referenced this pull request Oct 26, 2022
5 commits in 071eeaf210708219a5a1b2c4728ca2f97df7f2ae..9210810d1fd7b51ae0439a0a363cc50e36963455
2022-10-22 01:17:55 +0000 to 2022-10-25 22:31:50 +0000

- Fix 410 gone response handling (rust-lang/cargo#11286)
- Fix inequality in "stale mtime" log messages (rust-lang/cargo#11281)
- doc(cargo-tree): mention it considering feature unification (rust-lang/cargo#11282)
- Improve the error message if `publish` is `false` or empty list (rust-lang/cargo#11280)
- Add test for deleted index entry (rust-lang/cargo#11278)
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Oct 26, 2022
Update cargo

5 commits in 071eeaf210708219a5a1b2c4728ca2f97df7f2ae..9210810d1fd7b51ae0439a0a363cc50e36963455 2022-10-22 01:17:55 +0000 to 2022-10-25 22:31:50 +0000

- Fix 410 gone response handling (rust-lang/cargo#11286)
- Fix inequality in "stale mtime" log messages (rust-lang/cargo#11281)
- doc(cargo-tree): mention it considering feature unification (rust-lang/cargo#11282)
- Improve the error message if `publish` is `false` or empty list (rust-lang/cargo#11280)
- Add test for deleted index entry (rust-lang/cargo#11278)
JohnTitor pushed a commit to JohnTitor/rust that referenced this pull request Oct 26, 2022
Update cargo

5 commits in 071eeaf210708219a5a1b2c4728ca2f97df7f2ae..9210810d1fd7b51ae0439a0a363cc50e36963455 2022-10-22 01:17:55 +0000 to 2022-10-25 22:31:50 +0000

- Fix 410 gone response handling (rust-lang/cargo#11286)
- Fix inequality in "stale mtime" log messages (rust-lang/cargo#11281)
- doc(cargo-tree): mention it considering feature unification (rust-lang/cargo#11282)
- Improve the error message if `publish` is `false` or empty list (rust-lang/cargo#11280)
- Add test for deleted index entry (rust-lang/cargo#11278)
@ehuss ehuss added this to the 1.66.0 milestone Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants