-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
prefetch-npm-deps: fix reproducibility #214454
prefetch-npm-deps: fix reproducibility #214454
Conversation
v1 lockfiles can contain multiple references to the same version of a package, and these references can contain different `integrity` values, such as one having SHA-1 and SHA-512, while another just has SHA-512. Given that HashMap iteration order isn't defined, this causes reproducibility issues, as a different integrity value could be chosen each time. Thanks to @lilyinstarlight for discovering this issue originally, as well as the idea for the sorting-based implementation.
f042929
to
c7db220
Compare
c7db220
to
ac35d7e
Compare
By the way, I've now confirmed all 46 npm FODs in nixpkgs still reproduce to the same hash after this change (and now some like FODs checked, by attr (required some local changes not in nixpkgs to get all of them exposed via attrs):
|
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.
LGTM
This is not in 23.05 atm right? |
This was merged before the 23.05 branch-off, so it definitely is in 23.05. Are you having an issue still? Feel free to open a new issue on nixpkgs if you are and ping me on it |
Description of changes
v1 lockfiles can contain multiple references to the same version of a
package, and these references can contain different
integrity
values,such as one having SHA-1 and SHA-512, while another just has SHA-512.
Given that HashMap iteration order isn't defined, this causes
reproducibility issues, as a different integrity value could be chosen
each time.
Thanks to @lilyinstarlight for discovering this issue originally, as well
as the idea for the sorting-based implementation.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes