[Nix-dev] Bug(?) in derivation/hashing

Domen Kožar domen at dev.si
Fri Aug 26 13:20:06 CEST 2016


Relevant: https://github.com/NixOS/nix/issues/969

On Fri, Aug 26, 2016 at 1:18 PM, Damien Cassou <damien at cassou.me> wrote:

>
>
> On August 26, 2016 12:50:48 PM GMT+02:00, Sergey Mironov <grrwlf at gmail.com>
> wrote:
> > I decided to bump a version. Since there is 20160805 version available,
> >I wanted to 1) replace "20151220" with "20160805", 2) run `nix-env -i
> >urweb` to see a 'Hash mismatch' error, and finaly 3) copy correct hash
> >to she sha256 field.
> >
> >Surprisingly, `nix-env -i urweb` finished without errors. It reported
> >that installation of urweb-20160805 was successful, but in fact it was
> >old urweb-20151220 with new name. (urweb --version showed it clearly).
>
>
> This is not a bug but expected behavior. The sha256 field is used to
> compute the derivation hash. With this hash, Nix checks if there is already
> something in the store. If yes, this is used as the source without
> downloading again.
>
> What I do: when I update a derivation, I update the name and I randomly
> change the sha256. nix-build or nix-env then downloads the new release
> tarball, compares the sha256s, fails, and tells me the actual sha256.
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Success is the ability to go from one failure to another without
> losing enthusiasm." --Winston Churchill
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160826/4fbe94c5/attachment.html>


More information about the nix-dev mailing list