On 09/24/2014 09:58 PM, Bjørn Forsman wrote:
On 22 September 2014 17:16, Shea Levy <[email protected]> wrote:
I suppose a flag that says to rebuild if the output is valid but doesn't
have the right deriver could be what you want? But for now the best answer
seems to be "change the hash when it needs to change"

I don't know what "deriver" is.

Deriver is the derivation that built a path (i.e. the build recipe).
If you built a path yourself, you can get it by
nix-store -q --deriver /nix/store/path

Even though it's a bit hackish, using

stdenv.mkDerivation rec {
   extraHash = builtins.hashString "sha256" (buildCommand);
   name = "foo-${extraHash}-0.0";

works just like I want it to.

I think I understand what you want: the output should not change except on updating the package itself, but one can only find out the hash by performing the build. On update you want to do that.

I personally force such rebuilds by changing the first few sha256 characters to zeros. The extraHash way and Shea's suggestion are other fine ways. For this use case, I find no clear winner, and I don't think we can do significantly better.


Vladimir


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to