diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-02-02 17:24:10 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-02-02 17:24:10 +0000 |
commit | b682fae9d93037af65282e02b88a9ce34129026e (patch) | |
tree | 2e349a7480d315561bf40864e405b51f9c3ee16d /scripts/build-remote.pl.in | |
parent | 6f8c96d12399b747b5f41b5211a635d2801247c8 (diff) |
* Build hooks: use nix-store --import. This prevents a redundant
scan for runtime dependencies (i.e. the local machine shouldn't do a
scan that the remote machine has already done). Also pipe directly
into `nix-store --import': don't use a temporary file.
Diffstat (limited to 'scripts/build-remote.pl.in')
-rwxr-xr-x | scripts/build-remote.pl.in | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/scripts/build-remote.pl.in b/scripts/build-remote.pl.in index 53cf53644..e821b4071 100755 --- a/scripts/build-remote.pl.in +++ b/scripts/build-remote.pl.in @@ -192,7 +192,7 @@ my $buildFlags = "--max-silent-time $maxSilentTime"; # connection dies. Without it, the remote process might continue to # run indefinitely (that is, until it next tries to write to # stdout/stderr). -if (system("ssh -tt $sshOpts $hostName 'nix-store -rvvK $buildFlags $drvPath'") != 0) { +if (system("ssh -tt $sshOpts $hostName 'nix-store --realise -K $buildFlags $drvPath > /dev/null'") != 0) { # If we couldn't run ssh or there was an ssh problem (indicated by # exit code 255), then we return exit code 1; otherwise we assume # that the builder failed, which we indicated to Nix using exit @@ -209,17 +209,6 @@ foreach my $output (split '\n', $outputs) { my $maybeSignRemote = ""; $maybeSignRemote = "--sign" if $UID != 0; - system("ssh $sshOpts $hostName 'nix-store --export $maybeSignRemote $output' > dump") == 0 + system("ssh $sshOpts $hostName 'nix-store --export $maybeSignRemote $output' | @bindir@/nix-store --import > /dev/null") == 0 or die "cannot copy $output from $hostName: $?"; - - # This doesn't work yet, since the caller has a lock on the output - # path. We should move towards lock-free invocation of build - # hooks and substitutes. - #system("nix-store --import < dump") == 0 - # or die "cannot import $output: $?"; - - # Hack: skip the first 8 bytes (the nix-store --export next - # archive marker). The archive follows. - system("(dd bs=1 count=8 of=/dev/null && cat) < dump | nix-store --restore $output") == 0 - or die "cannot restore $output: $?"; } |