aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/substitution-goal.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/build/substitution-goal.hh')
-rw-r--r--src/libstore/build/substitution-goal.hh34
1 files changed, 7 insertions, 27 deletions
diff --git a/src/libstore/build/substitution-goal.hh b/src/libstore/build/substitution-goal.hh
index 3c97b19fd..18b4262a4 100644
--- a/src/libstore/build/substitution-goal.hh
+++ b/src/libstore/build/substitution-goal.hh
@@ -46,7 +46,7 @@ struct PathSubstitutionGoal : public Goal
/**
* Pipe for the substituter's standard output.
*/
- Pipe outPipe;
+ kj::Own<kj::CrossThreadPromiseFulfiller<void>> outPipe;
/**
* The substituter thread.
@@ -67,15 +67,12 @@ struct PathSubstitutionGoal : public Goal
NotifyingCounter<uint64_t>::Bump maintainExpectedSubstitutions,
maintainRunningSubstitutions, maintainExpectedNar, maintainExpectedDownload;
- typedef kj::Promise<Result<WorkResult>> (PathSubstitutionGoal::*GoalState)(bool inBuildSlot) noexcept;
- GoalState state;
-
/**
* Content address for recomputing store path
*/
std::optional<ContentAddress> ca;
- Finished done(
+ WorkResult done(
ExitCode result,
BuildResult::Status status,
std::optional<std::string> errorMsg = {});
@@ -90,32 +87,15 @@ public:
);
~PathSubstitutionGoal();
- Finished timedOut(Error && ex) override { abort(); };
-
- /**
- * We prepend "a$" to the key name to ensure substitution goals
- * happen before derivation goals.
- */
- std::string key() override
- {
- return "a$" + std::string(storePath.name()) + "$" + worker.store.printStorePath(storePath);
- }
-
- kj::Promise<Result<WorkResult>> work(bool inBuildSlot) noexcept override;
+ kj::Promise<Result<WorkResult>> workImpl() noexcept override;
/**
* The states.
*/
- kj::Promise<Result<WorkResult>> init(bool inBuildSlot) noexcept;
- kj::Promise<Result<WorkResult>> tryNext(bool inBuildSlot) noexcept;
- kj::Promise<Result<WorkResult>> referencesValid(bool inBuildSlot) noexcept;
- kj::Promise<Result<WorkResult>> tryToRun(bool inBuildSlot) noexcept;
- kj::Promise<Result<WorkResult>> finished(bool inBuildSlot) noexcept;
-
- /**
- * Callback used by the worker to write to the log.
- */
- WorkResult handleChildOutput(int fd, std::string_view data) override;
+ kj::Promise<Result<WorkResult>> tryNext() noexcept;
+ kj::Promise<Result<WorkResult>> referencesValid() noexcept;
+ kj::Promise<Result<WorkResult>> tryToRun() noexcept;
+ kj::Promise<Result<WorkResult>> finished() noexcept;
/* Called by destructor, can't be overridden */
void cleanup() override final;