-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Include source file hash in crate_hash. #94301
Conversation
This comment has been minimized.
This comment has been minimized.
35ee2f9
to
90a7024
Compare
This comment has been minimized.
This comment has been minimized.
90a7024
to
ef7950b
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit ef7950b22e1b204644453ecf3cafb0cc021785b2 with merge 04ddb49743e80584583be1b304307deff2cfba38... |
I wonder if there is some risk here of missing something that can cause HIR to differ. Hard to check, would probably have to hack up incremental to store both hashes and assert that if the hash from this PR is unchanged, the older HIR-based hash is also unchanged (but that doesn't protect from anything weirder, and it's not like |
☀️ Try build successful - checks-actions |
Queued 04ddb49743e80584583be1b304307deff2cfba38 with parent 532d3cd, future comparison URL. |
Finished benchmarking commit (04ddb49743e80584583be1b304307deff2cfba38): comparison url. Summary: This benchmark run shows 4 relevant improvements 🎉 to instruction counts.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
Something like environment variables, for example? Also proc macros can produce random data out of thin air, I guess. |
29e5dcc
to
ef7950b
Compare
29e5dcc
to
0ab9685
Compare
@@ -1140,20 +1147,6 @@ pub(super) fn crate_hash(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Svh { | |||
Svh::new(crate_hash.to_smaller_hash()) | |||
} | |||
|
|||
fn upstream_crates(tcx: TyCtxt<'_>) -> Vec<(StableCrateId, Svh)> { |
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.
Is there any particular reason for inlining this method? I don't have a strong preference about where this code should be, but it's currently adding unrelated changes to the diff.
☔ The latest upstream changes (presumably #94333) made this pull request unmergeable. Please resolve the merge conflicts. |
The current crate hash contains the hash of HIR nodes.
However, HIR does not necessarily contain all the information which transits in the query system (for instance stored in ResolverOutputs).
To avoid issues, this PR switches to using the hash of the source files instead.
r? @Aaron1011