aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-07-25 18:05:42 +0200
committereldritch horrors <pennae@lix.systems>2024-07-30 15:37:27 +0000
commitd9af753a7f5f6c7e52582b596b78c9b870572cb6 (patch)
tree2c315de707150996bf72049be7fe7a3262a9f248 /src
parent6c0dcd12208cf46fcfb5e0037fafa8833ec62326 (diff)
libstore: always wake up goals on EOF
all goals do this. it makes no sense to not notify a goal of EOF conditions because this is the universal signal for "child done" Change-Id: Ic3980de312547e616739c57c6248a8e81308b5ee
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build/derivation-goal.cc1
-rw-r--r--src/libstore/build/drv-output-substitution-goal.cc5
-rw-r--r--src/libstore/build/drv-output-substitution-goal.hh1
-rw-r--r--src/libstore/build/goal.hh1
-rw-r--r--src/libstore/build/substitution-goal.cc6
-rw-r--r--src/libstore/build/substitution-goal.hh1
-rw-r--r--src/libstore/build/worker.cc1
7 files changed, 1 insertions, 15 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index 8899cebfb..c0ca18310 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -1363,7 +1363,6 @@ void DerivationGoal::handleChildOutput(int fd, std::string_view data)
void DerivationGoal::handleEOF(int fd)
{
if (!currentLogLine.empty()) flushLine();
- worker.wakeUp(shared_from_this());
}
diff --git a/src/libstore/build/drv-output-substitution-goal.cc b/src/libstore/build/drv-output-substitution-goal.cc
index 69598472c..5e83d769c 100644
--- a/src/libstore/build/drv-output-substitution-goal.cc
+++ b/src/libstore/build/drv-output-substitution-goal.cc
@@ -162,10 +162,5 @@ void DrvOutputSubstitutionGoal::work()
(this->*state)();
}
-void DrvOutputSubstitutionGoal::handleEOF(int fd)
-{
- worker.wakeUp(shared_from_this());
-}
-
}
diff --git a/src/libstore/build/drv-output-substitution-goal.hh b/src/libstore/build/drv-output-substitution-goal.hh
index 47b9ecc49..598b119dc 100644
--- a/src/libstore/build/drv-output-substitution-goal.hh
+++ b/src/libstore/build/drv-output-substitution-goal.hh
@@ -72,7 +72,6 @@ public:
std::string key() override;
void work() override;
- void handleEOF(int fd) override;
JobCategory jobCategory() const override {
return JobCategory::Substitution;
diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh
index d105c53cd..94346531e 100644
--- a/src/libstore/build/goal.hh
+++ b/src/libstore/build/goal.hh
@@ -145,7 +145,6 @@ public:
virtual void handleEOF(int fd)
{
- abort();
}
void trace(std::string_view s);
diff --git a/src/libstore/build/substitution-goal.cc b/src/libstore/build/substitution-goal.cc
index df88a5629..027a7e161 100644
--- a/src/libstore/build/substitution-goal.cc
+++ b/src/libstore/build/substitution-goal.cc
@@ -294,12 +294,6 @@ void PathSubstitutionGoal::handleChildOutput(int fd, std::string_view data)
}
-void PathSubstitutionGoal::handleEOF(int fd)
-{
- worker.wakeUp(shared_from_this());
-}
-
-
void PathSubstitutionGoal::cleanup()
{
try {
diff --git a/src/libstore/build/substitution-goal.hh b/src/libstore/build/substitution-goal.hh
index 52780a967..d85b3beb3 100644
--- a/src/libstore/build/substitution-goal.hh
+++ b/src/libstore/build/substitution-goal.hh
@@ -110,7 +110,6 @@ public:
* Callback used by the worker to write to the log.
*/
void handleChildOutput(int fd, std::string_view data) override;
- void handleEOF(int fd) override;
/* Called by destructor, can't be overridden */
void cleanup() override final;
diff --git a/src/libstore/build/worker.cc b/src/libstore/build/worker.cc
index 25b20511b..5b2e36acb 100644
--- a/src/libstore/build/worker.cc
+++ b/src/libstore/build/worker.cc
@@ -459,6 +459,7 @@ void Worker::waitForInput()
if (rd == 0 || (rd == -1 && errno == EIO)) {
debug("%1%: got EOF", goal->getName());
goal->handleEOF(k);
+ wakeUp(goal);
j->fds.erase(k);
} else if (rd == -1) {
if (errno != EINTR)