Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Include (potentially remapped) working dir in crate hash #87990
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 (potentially remapped) working dir in crate hash #87990
Changes from all commits
a895069
179fd38
fd15c18
1ac7881
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This will result in a different hash for
/wd/foo.rs
vs/baz/foo.rs
with/baz
remapped to/wd
despite the filename after any remapping being equal.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 don't think so - this field is initialized using the remapped working directory.
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.
RealFileName
is an enum defined aswhile the
Hash
implementation only looks at the remapped path, theHashStable
implementation is derived and looks at which enum variant it is and in case of a remapped path also at the local path before remapping. The dep tracking hash is calculated usingHashStable
and notHash
, so this will depend if the path is remapped or not and more importantly the local path before remapping, which is even worse that I thought as it breaks reproducible builds.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.
That's incorrect - I'm using
impl_dep_tracking_hash_via_hash
forRealFileName
: https://github.com/Aaron1011/rust/blob/47daf829b1a0d2d499745a34cf4b1969929e5f7f/compiler/rustc_session/src/config.rs#L2513It looks like the
HashStable
implementations forFileName
andRealFileName
are unused, and can be removed. HavingHash,
HashStable,and
DepTrackingHash` all implemented for a single type is pretty confusing - I wonder if there's any kind of compile-time check we can do to prevent that.