From 0478949c72310b9749d5b959adad8bdf5c2c0841 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 1 Sep 2024 01:37:10 +0200 Subject: libstore: turn builder output processing into event loop this removes the rather janky did-you-mean-async poll loop we had so far. sadly kj does not play well with pty file descriptors, so we do have to add our own async input stream that does not eat pty EIO and turns it into an exception. that's still a *lot* better than the old code, and using a real even loop makes everything else easier later. Change-Id: Idd7e0428c59758602cc530bcad224cd2fed4c15e --- src/libstore/build/goal.hh | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/libstore/build/goal.hh') diff --git a/src/libstore/build/goal.hh b/src/libstore/build/goal.hh index 189505308..3f6e8396e 100644 --- a/src/libstore/build/goal.hh +++ b/src/libstore/build/goal.hh @@ -114,6 +114,8 @@ struct Goal public: + struct Finished; + struct [[nodiscard]] StillAlive {}; struct [[nodiscard]] WaitForSlot {}; struct [[nodiscard]] WaitForAWhile {}; @@ -122,7 +124,7 @@ public: Goals goals; }; struct [[nodiscard]] WaitForWorld { - std::set fds; + kj::Promise> promise; bool inBuildSlot; }; struct [[nodiscard]] Finished { @@ -167,20 +169,6 @@ public: virtual void waiteeDone(GoalPtr waitee) { } - virtual WorkResult handleChildOutput(int fd, std::string_view data) - { - abort(); - } - - virtual void handleEOF(int fd) - { - } - - virtual bool respectsTimeouts() - { - return false; - } - void trace(std::string_view s); std::string getName() const @@ -188,13 +176,6 @@ public: return name; } - /** - * Callback in case of a timeout. It should wake up its waiters, - * get rid of any running child processes that are being monitored - * by the worker (important!), etc. - */ - virtual Finished timedOut(Error && ex) = 0; - virtual std::string key() = 0; virtual void cleanup() { } -- cgit v1.2.3