From 221c79013f105612222cd7df3415bf63abcc7412 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 29 Oct 2005 18:17:45 +0000 Subject: * Turn off build hooks in nix-push because of an impurity (NIX-21). --- scripts/nix-push.in | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'scripts/nix-push.in') diff --git a/scripts/nix-push.in b/scripts/nix-push.in index 800424c89608..85b74b84cc95 100644 --- a/scripts/nix-push.in +++ b/scripts/nix-push.in @@ -86,6 +86,12 @@ foreach my $storePath (@storePaths) { die unless ($storePath =~ /\/[0-9a-z]{32}.*$/); # Construct a Nix expression that creates a Nix archive. + # !!! the string reference to `$storePath' is impure! We could + # also pass it as a normal input, but that would cause it to be + # copied, and its name would be expanded (e.g., + # /nix/store/HASH1-HASH2-symname). nix-instantiate should be + # smart enough to add store paths as direct references of the Nix + # expression. my $nixexpr = "((import $dataDir/nix/corepkgs/nar/nar.nix) " . "{path = \"$storePath\"; system = \"@system@\"; hashAlgo = \"$hashAlgo\";}) "; @@ -122,7 +128,11 @@ while (scalar @tmp > 0) { my @tmp2 = @tmp[0..$n - 1]; @tmp = @tmp[$n..scalar @tmp - 1]; - my $pid = open(READ, "$binDir/nix-store --realise @tmp2|") + # Note: we disable build hooks because of the impure path + # reference (see above). Even if that is fixed, using a hook + # probably wouldn't make that much sense; pumping lots of data + # around just to compress them won't gain that much. + my $pid = open(READ, "NIX_BUILD_HOOK= $binDir/nix-store --realise @tmp2|") or die "cannot run nix-store"; while () { chomp; -- cgit 1.4.1