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

[flake] Option to print hash mismatches in base32 instead of base64 #3786

Closed
Mic92 opened this issue Jul 6, 2020 · 6 comments
Closed

[flake] Option to print hash mismatches in base32 instead of base64 #3786

Mic92 opened this issue Jul 6, 2020 · 6 comments

Comments

@Mic92
Copy link
Member

Mic92 commented Jul 6, 2020

Is your feature request related to a problem? Please describe.

Right now when a checksum fails the error message in nixFlakes looks like this:

  wanted: sha256-wJist+imXXDjN3NzZUE/utN+D4ThhhcUxvE6WRfCL4M=
  got:    sha256-ThQ9LgYvuWhxNmtO1Z461TE9j/pwOlhsBvPR+GjFUNU=

Describe the solution you'd like

However we cannot use base64 in nixpkgs yet. Therefor it would be good to have an option to use base64 or base32 hashes instead.

Describe alternatives you've considered

There is nix to-base32 for conversion however this is time consuming. People also might accidentally make pull requests using the new hash format also we cannot support this yet.

@Mic92 Mic92 changed the title [flake] Option to print hash mismatches in different formats [flake] Option to print hash mismatches in base32 instead of base64 Jul 6, 2020
@Mic92
Copy link
Member Author

Mic92 commented Jul 6, 2020

This is where the hash mismatch message is computed: https://github.com/NixOS/nix/blob/flakes/src/libstore/build.cc#L3749

@samueldr
Copy link
Member

samueldr commented Jul 6, 2020

I have it on good authority that is fine to use SRI hashes on master.

The only issue at hand is backports to 20.03 I guess.

@jtojnar
Copy link
Member

jtojnar commented Jul 7, 2020

I thought this was a duplicate of another issue but apparenly it was PR: #3433

@bhipple
Copy link
Contributor

bhipple commented Jul 7, 2020

I'd prefer if we close this and start migrating to base64 naturally. As mentioned these are fine on master now, and they have the advantage of being shorter and also are a standard encoding that exists in the wider world outside the nix ecosystem.

@cole-h
Copy link
Member

cole-h commented Jul 7, 2020

One "downside" that @infinisil brought up on IRC is that certain characters are delimiters for double-clicking, making copying correct hashes slightly more cumbersome. I would still consider this feature at least somewhat desirable ("nice to have"), but not because we don't support base64 hashes in Nixpkgs.

@Mic92
Copy link
Member Author

Mic92 commented Jul 7, 2020

Ok. I was not aware that we can already depend on it.

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

No branches or pull requests

5 participants