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

libstore: improve hash mismatch error messages #2574

Merged
merged 1 commit into from Dec 12, 2018

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Dec 12, 2018

Use the same output ordering and format everywhere.

This is such a common issue that we trade the single-line error message for
more readability.

Old message:

fixed-output derivation produced path '/nix/store/d4nw9x2sy9q3r32f3g5l5h1k833c01vq-example.com' with sha256 hash '08y4734bm2zahw75b16bcmcg587vvyvh0n11gwiyir70divwp1rm' instead of the expected hash '1xzwnipjd54wl8g93vpw6hxnpmdabq0wqywriiwmh7x8k0lvpq5m'

New message:

hash mismatch in fixed-output derivation '/nix/store/d4nw9x2sy9q3r32f3g5l5h1k833c01vq-example.com':
  wanted: sha256:1xzwnipjd54wl8g93vpw6hxnpmdabq0wqywriiwmh7x8k0lvpq5m
  got:    sha256:08y4734bm2zahw75b16bcmcg587vvyvh0n11gwiyir70divwp1rm

Use the same output ordering and format everywhere.

This is such a common issue that we trade the single-line error message for
more readability.

Old message:
```
fixed-output derivation produced path '/nix/store/d4nw9x2sy9q3r32f3g5l5h1k833c01vq-example.com' with sha256 hash '08y4734bm2zahw75b16bcmcg587vvyvh0n11gwiyir70divwp1rm' instead of the expected hash '1xzwnipjd54wl8g93vpw6hxnpmdabq0wqywriiwmh7x8k0lvpq5m'
```

New message:
```
hash mismatch in fixed-output derivation '/nix/store/d4nw9x2sy9q3r32f3g5l5h1k833c01vq-example.com':
  wanted: sha256:1xzwnipjd54wl8g93vpw6hxnpmdabq0wqywriiwmh7x8k0lvpq5m
  got:    sha256:08y4734bm2zahw75b16bcmcg587vvyvh0n11gwiyir70divwp1rm

```
@zimbatm
Copy link
Member Author

zimbatm commented Dec 12, 2018

/cc @edolstra

@edolstra edolstra merged commit 800cd55 into NixOS:master Dec 12, 2018
@grahamc
Copy link
Member

grahamc commented Dec 12, 2018

Really Nice!

@zimbatm zimbatm deleted the multi-line-expected-sha256 branch December 12, 2018 23:21
@LnL7
Copy link
Member

LnL7 commented Dec 14, 2018

This is great! But don't we also need to change some stuff in the nixpkgs fixed output builders to make this happen consistently everywhere?

@AmineChikhaoui
Copy link
Member

btw some tests are failing after this merge https://hydra.nixos.org/build/85858916

@AmineChikhaoui
Copy link
Member

Ah wait no, it's due to 6024dc1

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

Successfully merging this pull request may close these issues.

None yet

10 participants