-
-
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
treewide: remove all cargoSha256 usage #323983
Conversation
Logically speaking it should not cause such rebuilds (or actually it will)? |
Yeah, I am not sure if it's worth the rebuilding effort. Improvements like this can come atomically, like when updating that specific package. |
Ah, I see. The hash here will not only be consumed by buildRustPackage, it also exists as an environment variable.
In theory we should deprecate it and avoid further usages altogether. We have already done that for golang's vendorHash (vendorSha256). |
I don't know about this. It feels like it's better to do a treewide into staging and let hydra take the hit once, rather than keep spending review time on it for random PRs. It will probably also make a higher percentage of new PRs use |
Once we have all treewide changes done, we can let it throw a warning, and let |
ea1c933
to
bde993f
Compare
bde993f
to
c23dfb1
Compare
03b9e02
to
7cf5762
Compare
Most of the time it won't make a difference because something else in staging will have caused the rust toolchain to rebuild from source anyway. |
Oh the conflict is in staging, not master |
5522af8
to
2e3cd81
Compare
This is done with the following bash script: ``` #!/usr/bin/env bash process_line() { local filename=${1%:} if [[ $4 =~ \"(.*)\"\; ]]; then local sha256="${BASH_REMATCH[1]}" fi [[ -z $sha256 ]] && return 0 local hash=$(nix hash to-sri --type sha256 $sha256) echo "Processing: $filename" echo " $sha256 => $hash" sed -i "s|cargoSha256 = \"$sha256\"|cargoHash = \"$hash\"|" $filename } # split output by line grep -r 'cargoSha256 = ' . | while IFS= read -r line; do # split them further by space read -r -a parts <<< "$line" process_line "${parts[@]}" done ```
2e3cd81
to
f6ee8a0
Compare
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, passes my eyeball test
This is a mismatch after merging both of: - NixOS#323983 - NixOS#322749
Missed |
Description of changes
First treewide (easy)
Treewide command:
Second treewide
Treewide bash script (which was executed in
pkgs
):There are some exceptions, basically using a wrapped builder, or writing in
let
. I've manually fixed them. Would be better to check again.buildRustPackage changes
I'm not really sure about this part.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.