-
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
Fix test: hash value depends on endianness and bitness. #10011
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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 the bit about 1.45 or linking to a Rust issue is really all that relevant here, I think the comment can basically say that the hash value here is machine-specific, so this test is limited to run only on machines where the listed value is actually correct. This platform happens to correspond to x86_64 which is used for CI which means we should see failures.
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.
The hash-value is machine-specific because of that issue. I think it's not representative of "the whole picture" to say that this test behaviour is "intended for us as developers of Cargo really and not much else." - the hash is used on end-users' filesystems as part of a file path. This is not machine-dependent e.g. when home directories are mounted via NFS and shared across different machines e.g. in a university network.
It may not be a big deal in this particular case, at the very least it will result in some duplication, but I think it's important to understand what the consequences are in the wider context of general computing environments rather than wave it away as a "developer-only" issue.
Stable hashing is a really nice thing to have for protocols and other situations where you want to interoperate, and it's a shame if the Rust standard library wouldn't support it.
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 comment in
src/cargo/core/compiler/fingerprint.rs
suggests that StableHasher was originally intended to be platform-independent (as would be a reasonable assumption from the naming):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.
Ok well in that case I'll leave this to the tagged reviewer.
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.
@alexcrichton Oh, I did not see that reply when commenting (below). 😦