From 711ad527769f97d57777e580c7b84950c7ee55be Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Tue, 14 Oct 2025 15:31:15 +0200 Subject: [PATCH] libstore: move logSize into each log handler there's no need for this to be an instance variable of the goals. Change-Id: Iaa315e8b5d8649d8eb3c3fedc387c0f0c48945fc --- lix/libstore/build/derivation-goal.cc | 5 ++--- lix/libstore/build/derivation-goal.hh | 5 ----- lix/libstore/build/local-derivation-goal.cc | 1 + 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lix/libstore/build/derivation-goal.cc b/lix/libstore/build/derivation-goal.cc index 856ad16d5..773abe2fd 100644 --- a/lix/libstore/build/derivation-goal.cc +++ b/lix/libstore/build/derivation-goal.cc @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -1150,8 +1151,6 @@ kj::Promise> DerivationGoal::registerOutputs() Path DerivationGoal::openLogFile() { - logSize = 0; - if (!settings.keepLog) return ""; auto baseName = std::string(baseNameOf(worker.store.printStorePath(drvPath))); @@ -1181,7 +1180,6 @@ Path DerivationGoal::openLogFile() return logFileName; } - void DerivationGoal::closeLogFile() { auto logSink2 = std::dynamic_pointer_cast(logSink); @@ -1205,6 +1203,7 @@ kj::Promise>> DerivationGoal::handleRawCh try { assert(hook); + uint64_t logSize = 0; std::string currentHookLine; AsyncFdIoStream in(AsyncFdIoStream::shared_fd{}, hook->fromHook.get()); diff --git a/lix/libstore/build/derivation-goal.hh b/lix/libstore/build/derivation-goal.hh index af885a1f7..c4ef8bcc4 100644 --- a/lix/libstore/build/derivation-goal.hh +++ b/lix/libstore/build/derivation-goal.hh @@ -191,11 +191,6 @@ struct DerivationGoal : public Goal AutoCloseFD fdLogFile; std::shared_ptr logFileSink, logSink; - /** - * Number of bytes received from the builder's stdout/stderr. - */ - unsigned long logSize; - /** * The most recent log lines. */ diff --git a/lix/libstore/build/local-derivation-goal.cc b/lix/libstore/build/local-derivation-goal.cc index e446c58d9..9087c5d45 100644 --- a/lix/libstore/build/local-derivation-goal.cc +++ b/lix/libstore/build/local-derivation-goal.cc @@ -2699,6 +2699,7 @@ try { AsyncFdIoStream in(AsyncFdIoStream::shared_fd{}, builderOutPTY.get()); LogLineSplitter splitter; + uint64_t logSize = 0; auto flushLine = [&](const std::string & line) { if (const auto state =