From e513cd2bebe6c4ed012bd4d2e92650c67f0df4bf Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Tue, 13 Aug 2024 03:26:18 +0200 Subject: [PATCH] libstore: run childStarted as late as possible otherwise we *technically* give away the output fds before we've read them. Change-Id: I6ad0d6a1bb553ecfcdd7708f50d34142a425374d --- src/libstore/build/local-derivation-goal.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index afb9524ef..25b520c05 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -726,7 +726,6 @@ void LocalDerivationGoal::startBuilder() /* parent */ pid.setSeparatePG(true); - worker.childStarted(shared_from_this(), {builderOutPTY.get()}, true); /* Check if setting up the build environment failed. */ std::vector msgs; @@ -753,6 +752,8 @@ void LocalDerivationGoal::startBuilder() debug("sandbox setup: " + msg); msgs.push_back(std::move(msg)); } + + worker.childStarted(shared_from_this(), {builderOutPTY.get()}, true); }