diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2021-06-25 15:51:02 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2021-06-25 15:51:02 -0500 |
commit | c3a929349f6c1968285ffff735933772be2f77cb (patch) | |
tree | 0bfcfa57bf200461821a4239fe316a00f377a792 /src/libstore/build/drv-output-substitution-goal.hh | |
parent | d5fd0f4745d834f7ac7049a0eb7e212ce9c7ef47 (diff) | |
parent | bf68c693dc5157c2be1f3a9f407dd1ce3761df78 (diff) |
Merge remote-tracking branch 'origin/master' into cross-jobs
Diffstat (limited to 'src/libstore/build/drv-output-substitution-goal.hh')
-rw-r--r-- | src/libstore/build/drv-output-substitution-goal.hh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/libstore/build/drv-output-substitution-goal.hh b/src/libstore/build/drv-output-substitution-goal.hh new file mode 100644 index 000000000..63ab53d89 --- /dev/null +++ b/src/libstore/build/drv-output-substitution-goal.hh @@ -0,0 +1,50 @@ +#pragma once + +#include "store-api.hh" +#include "goal.hh" +#include "realisation.hh" + +namespace nix { + +class Worker; + +// Substitution of a derivation output. +// This is done in three steps: +// 1. Fetch the output info from a substituter +// 2. Substitute the corresponding output path +// 3. Register the output info +class DrvOutputSubstitutionGoal : public Goal { +private: + // The drv output we're trying to substitue + DrvOutput id; + + // The realisation corresponding to the given output id. + // Will be filled once we can get it. + std::optional<Realisation> outputInfo; + + /* The remaining substituters. */ + std::list<ref<Store>> subs; + + /* Whether a substituter failed. */ + bool substituterFailed = false; + +public: + DrvOutputSubstitutionGoal(const DrvOutput& id, Worker & worker, RepairFlag repair = NoRepair, std::optional<ContentAddress> ca = std::nullopt); + + typedef void (DrvOutputSubstitutionGoal::*GoalState)(); + GoalState state; + + void init(); + void tryNext(); + void outPathValid(); + void finished(); + + void timedOut(Error && ex) override { abort(); }; + + string key() override; + + void work() override; + +}; + +} |