Skip to content
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

Use cargoHash in buildRustPackage crates with SRI hashes #108121

Closed
wants to merge 1 commit into from

Conversation

danieldk
Copy link
Contributor

@danieldk danieldk commented Jan 1, 2021

Motivation for this change

We now have cargoHash (as a replacement for cargoSha256) for SRI
hashes. So, use it in derivations that use a SRI hash for vendored
Cargo dependencies.

This change does not update rust-analyzer. It also requires changing
the update script, which relies on nix-prefetch, which returns non-SRI
hashes (didn't have time to look deeper). (@oxalica)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@SuperSandro2000
Copy link
Member

Did you forgot to commit something?

@danieldk
Copy link
Contributor Author

danieldk commented Jan 2, 2021

Did you forgot to commit something?

I don't think so? Like the description says, this commit changes derivations that use cargoSha256 with an SRI hash to use cargoHash. See #103118. This should have no side effects (rebuilds).

@SuperSandro2000
Copy link
Member

@danieldk please fix the merge conflict.

@danieldk
Copy link
Contributor Author

@SuperSandro2000 rebased

@@ -18,7 +18,7 @@ let
# 3) run the ./result script that is output by that (it updates ./grammars)
version = "0.17.3";
sha256 = "sha256-uQs80r9cPX8Q46irJYv2FfvuppwonSS5HVClFujaP+U=";
cargoSha256 = "sha256-fonlxLNh9KyEwCj7G5vxa7cM/DlcHNFbQpp0SwVQ3j4=";
cargoHash = "sha256-fonlxLNh9KyEwCj7G5vxa7cM/DlcHNFbQpp0SwVQ3j4=";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need a change in line 65, too.

@danieldk danieldk closed this Mar 24, 2021
@danieldk danieldk deleted the sri-to-cargo-hash branch March 24, 2021 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants