diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 687ad7e47f..dce57f751a 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1007,6 +1007,10 @@ void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter & fromPipe.create(); errorPipe.create(); + /* Hack: prevent substituters that write too much to stderr from + deadlocking our read() from stdout. */ + fcntl(errorPipe.writeSide, F_SETFL, O_NONBLOCK); + setSubstituterEnv(); run.pid = maybeVfork();