aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/drv-output-substitution-goal.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-11-16 12:54:20 +0100
committerGitHub <noreply@github.com>2021-11-16 12:54:20 +0100
commit6463eaca14ea813f39a3b3e4c5a15fa32fc30232 (patch)
treeeda8501ca6ca1adffb702a78ca265339490665c0 /src/libstore/build/drv-output-substitution-goal.hh
parent6d0aa8d17544e391872eed76f4c627e4c1f9c05b (diff)
parentf4c869977c391b31eb4f20486f7da03b026e2401 (diff)
Merge pull request #5472 from NixOS/async-realisation-substitution
async realisation substitution
Diffstat (limited to 'src/libstore/build/drv-output-substitution-goal.hh')
-rw-r--r--src/libstore/build/drv-output-substitution-goal.hh14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libstore/build/drv-output-substitution-goal.hh b/src/libstore/build/drv-output-substitution-goal.hh
index 63ab53d89..67ae2624a 100644
--- a/src/libstore/build/drv-output-substitution-goal.hh
+++ b/src/libstore/build/drv-output-substitution-goal.hh
@@ -3,6 +3,8 @@
#include "store-api.hh"
#include "goal.hh"
#include "realisation.hh"
+#include <thread>
+#include <future>
namespace nix {
@@ -20,11 +22,18 @@ private:
// The realisation corresponding to the given output id.
// Will be filled once we can get it.
- std::optional<Realisation> outputInfo;
+ std::shared_ptr<const Realisation> outputInfo;
/* The remaining substituters. */
std::list<ref<Store>> subs;
+ /* The current substituter. */
+ std::shared_ptr<Store> sub;
+
+ Pipe outPipe;
+ std::thread thr;
+ std::promise<std::shared_ptr<const Realisation>> promise;
+
/* Whether a substituter failed. */
bool substituterFailed = false;
@@ -36,6 +45,7 @@ public:
void init();
void tryNext();
+ void realisationFetched();
void outPathValid();
void finished();
@@ -44,7 +54,7 @@ public:
string key() override;
void work() override;
-
+ void handleEOF(int fd) override;
};
}