diff --git a/scripts/nix-push.in b/scripts/nix-push.in index 800424c896..85b74b84cc 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; diff --git a/src/libexpr/Makefile.am b/src/libexpr/Makefile.am index 5571179f8f..dbc93abd5e 100644 --- a/src/libexpr/Makefile.am +++ b/src/libexpr/Makefile.am @@ -15,7 +15,7 @@ AM_CFLAGS = \ # Parser generation. -parser.o: parser-tab.h lexer-tab.h +parser.cc: parser-tab.h lexer-tab.h parser-tab.c parser-tab.h: parser.y $(bison) -v -o parser-tab.c parser.y -d