mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
* nix-build: if nix-instantiate or nix-store fails due to a signal
(e.g. out of memory or a segfault), print an error message. Otherwise the user doesn't see anything.
This commit is contained in:
parent
c6cb792d48
commit
f24cf5d303
1 changed files with 8 additions and 2 deletions
|
@ -142,7 +142,10 @@ foreach my $expr (@exprs) {
|
||||||
# !!! would prefer the perl 5.8.0 pipe open feature here.
|
# !!! would prefer the perl 5.8.0 pipe open feature here.
|
||||||
my $pid = open(DRVPATHS, "-|") || exec "$binDir/nix-instantiate", "--add-root", $drvLink, "--indirect", @instArgs, $expr;
|
my $pid = open(DRVPATHS, "-|") || exec "$binDir/nix-instantiate", "--add-root", $drvLink, "--indirect", @instArgs, $expr;
|
||||||
while (<DRVPATHS>) {chomp; push @drvPaths, $_;}
|
while (<DRVPATHS>) {chomp; push @drvPaths, $_;}
|
||||||
close DRVPATHS or exit 1;
|
if (!close DRVPATHS) {
|
||||||
|
die "nix-instantiate killed by signal " . ($? & 127) . "\n" if ($? & 127);
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
foreach my $drvPath (@drvPaths) {
|
foreach my $drvPath (@drvPaths) {
|
||||||
my $target = readlink $drvPath or die "cannot read symlink `$drvPath'";
|
my $target = readlink $drvPath or die "cannot read symlink `$drvPath'";
|
||||||
|
@ -154,7 +157,10 @@ foreach my $expr (@exprs) {
|
||||||
$pid = open(OUTPATHS, "-|") || exec "$binDir/nix-store", "--add-root", $outLink, "--indirect", "-rv",
|
$pid = open(OUTPATHS, "-|") || exec "$binDir/nix-store", "--add-root", $outLink, "--indirect", "-rv",
|
||||||
@buildArgs, @drvPaths;
|
@buildArgs, @drvPaths;
|
||||||
while (<OUTPATHS>) {chomp; push @outPaths, $_;}
|
while (<OUTPATHS>) {chomp; push @outPaths, $_;}
|
||||||
close OUTPATHS or exit 1;
|
if (!close OUTPATHS) {
|
||||||
|
die "nix-store killed by signal " . ($? & 127) . "\n" if ($? & 127);
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
next if $dryRun;
|
next if $dryRun;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue