mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Fix fatal "broken pipe" error when $NIX_BUILD_HOOK is missing
This commit is contained in:
parent
ffcf9d24a6
commit
2f992692e2
1 changed files with 38 additions and 26 deletions
|
@ -1580,6 +1580,8 @@ HookReply DerivationGoal::tryBuildHook()
|
|||
if (!worker.hook)
|
||||
worker.hook = std::make_unique<HookInstance>();
|
||||
|
||||
try {
|
||||
|
||||
/* Tell the hook about system features (beyond the system type)
|
||||
required from the build machine. (The hook could parse the
|
||||
drv file itself, but this is easier.) */
|
||||
|
@ -1611,6 +1613,16 @@ HookReply DerivationGoal::tryBuildHook()
|
|||
else if (reply != "accept")
|
||||
throw Error(format("bad hook reply ‘%1%’") % reply);
|
||||
|
||||
} catch (SysError & e) {
|
||||
if (e.errNo == EPIPE) {
|
||||
printError("build hook died unexpectedly: %s",
|
||||
chomp(drainFD(worker.hook->fromHook.readSide.get())));
|
||||
worker.hook = 0;
|
||||
return rpDecline;
|
||||
} else
|
||||
throw;
|
||||
}
|
||||
|
||||
printMsg(lvlTalkative, format("using hook to build path(s) %1%") % showPaths(missingPaths));
|
||||
|
||||
hook = std::move(worker.hook);
|
||||
|
|
Loading…
Reference in a new issue