From 343aca3a2794922915903491a0be6f01c9dc6ced Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 21 Oct 2024 18:17:58 +0200 Subject: libstore: clear derivation build activities when done without this derivations do not show as completely processed in the internal-json logs (or the newer multiline output). the former also breaks external tools like nix-output-monitor which, like multiline output, grow vertically until at least some goals are finally freed Change-Id: I55758daf526ba29ae15fb82e0d88da8afb45bf5c --- src/libstore/build/derivation-goal.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index 96140e10b..5de159b2d 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -127,7 +127,11 @@ Goal::WorkResult DerivationGoal::timedOut(Error && ex) kj::Promise> DerivationGoal::workImpl() noexcept { - return useDerivation ? getDerivation() : haveDerivation(); + return (useDerivation ? getDerivation() : haveDerivation()).attach(kj::defer([this] { + act.reset(); + actLock.reset(); + builderActivities.clear(); + })); } bool DerivationGoal::addWantedOutputs(const OutputsSpec & outputs) -- cgit v1.2.3