aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/derivation-goal.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-04-05 23:02:11 +0200
committereldritch horrors <pennae@lix.systems>2024-07-06 12:36:36 +0200
commit4162a66cee97ec16c88d991ef9a6d9baa3740053 (patch)
tree41bcdefb5d85c9c26be3563a3880bc850f41bec3 /src/libstore/build/derivation-goal.cc
parentb6a08a2fed8a48d3759ea67e958c9f9ec5f44d94 (diff)
libutil: return sources from runProgram2
this much more closely mimics what is actually happening: we're reading data from somewhere else, actively, rather than passively waiting. with the data flow matching the underlying system interactions better we can remove a few sinkToSource calls that merely exists to undo the mismatch caused by not treating subprocess output as a data source to begin with Change-Id: If4abfc2f8398fb5e88c9b91a8bdefd5504bb2d11
Diffstat (limited to 'src/libstore/build/derivation-goal.cc')
-rw-r--r--src/libstore/build/derivation-goal.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index a59984688..7c18f8b60 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -923,12 +923,16 @@ void runPostBuildHook(
};
LogSink sink(act);
- runProgram2({
+ auto proc = runProgram2({
.program = settings.postBuildHook,
.environment = hookEnvironment,
- .standardOut = &sink,
+ .captureStdout = true,
.mergeStderrToStdout = true,
- }).wait();
+ });
+ Finally const _wait([&] { proc.wait(); });
+
+ // FIXME just process the data, without a wrapper sink class
+ proc.stdout()->drainInto(sink);
}
void DerivationGoal::buildDone()