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
Allow empty hashes #3544
Allow empty hashes #3544
Conversation
This allows hash="" so that it can be used for debugging purposes. For instance, this gives you an error message like: warning: found empty hash, assuming you wanted 'sha256:0000000000000000000000000000000000000000000000000000' hash mismatch in fixed-output derivation '/nix/store/jx3gikmipizpk181cgfa1l4wwcamy6p0-nixpkgs': wanted: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= got: sha256-Wm7FDDnzNteClYOn+LRCtPNcK9wjEtpj+k9IIfygD7o=
@matthewbauer I think the only argument against this is that 0 may be a valid hash (I don't think it's likely, but still). That being said, I think this is already an improvement and my suggestion is about a case that practically should not happen. (Unless the hash on an empty string is 0). |
I think we have to be very careful about this not having unintended side effects. It seems safer to handle this at a higher level than in the |
An example of "higher level" would be |
Right - a more explicit |
Will close this PR for the reason mentioned above. |
follow up of NixOS#3544 This allows hash="" so that it can be used for debugging purposes. For instance, this gives you an error message like: warning: found empty hash, assuming you wanted 'sha256:0000000000000000000000000000000000000000000000000000' hash mismatch in fixed-output derivation '/nix/store/asx6qw1r1xk6iak6y6jph4n58h4hdmbm-nix': wanted: sha256:0000000000000000000000000000000000000000000000000000 got: sha256:0fpfhipl9v1mfzw2ffmxiyyzqwlkvww22bh9wcy4qrfslb4jm429
updated with changes here: please take a look when you get a chance to. |
This allows hash="" so that it can be used for debugging purposes. For
instance, this gives you an error message like:
warning: found empty hash, assuming you wanted 'sha256:0000000000000000000000000000000000000000000000000000'
hash mismatch in fixed-output derivation '/nix/store/jx3gikmipizpk181cgfa1l4wwcamy6p0-nixpkgs':
wanted: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
got: sha256-Wm7FDDnzNteClYOn+LRCtPNcK9wjEtpj+k9IIfygD7o=