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

inconsistent SRI hash requirements? #11996

Closed
2 tasks done
vcunat opened this issue Dec 1, 2024 · 3 comments · Fixed by #12013
Closed
2 tasks done

inconsistent SRI hash requirements? #11996

vcunat opened this issue Dec 1, 2024 · 3 comments · Fixed by #12013
Assignees
Labels

Comments

@vcunat
Copy link
Member

vcunat commented Dec 1, 2024

Describe the bug

In SRI hashes, sometimes the final = is required and sometimes it is not.

Our nixpkgs have many cases where it's omitted, e.g.

pkgs/by-name/au/autorandr/package.nix:    hash = "sha256-8FMfy3GCN4z/TnfefU2DbKqV3W35I29/SuGGqeOrjNg";

because nix doesn't protest when building these.

But some commands do require it, e.g.

$ nix --extra-experimental-features nix-command \
  hash convert --from sri sha256-8FMfy3GCN4z/TnfefU2DbKqV3W35I29/SuGGqeOrjNg
error: input hash 'sha256-8FMfy3GCN4z/TnfefU2DbKqV3W35I29/SuGGqeOrjNg' does not have the expected format '--from sri'

Expected behavior

Right now we can't use the command (easily) to process nixpkgs, etc. So probably allow missing = in the command.


Add 👍 to issues you find important.

@vcunat vcunat added the bug label Dec 1, 2024
@vcunat
Copy link
Member Author

vcunat commented Dec 1, 2024

As a workaround, one can use e.g. nix-hash, though that produces an incorrect warning :-(

@roberth roberth added this to Nix team Dec 2, 2024
@github-project-automation github-project-automation bot moved this to To triage in Nix team Dec 2, 2024
@vcunat vcunat mentioned this issue Dec 4, 2024
13 tasks
@vcunat
Copy link
Member Author

vcunat commented Dec 4, 2024

Oh, dropping --from sri is a workaround that works. Really confusing to me that it makes a difference, as it obviously can't match any other format but SRI.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-12-04-nix-team-meeting-minutes-200/57005/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants