aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build/drv-output-substitution-goal.hh
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2021-10-28 16:43:54 +0200
committerregnat <rg@regnat.ovh>2021-11-03 06:51:34 +0100
commitf4c869977c391b31eb4f20486f7da03b026e2401 (patch)
treeaaec046aca318930075a7fe6ad266a6935bd252d /src/libstore/build/drv-output-substitution-goal.hh
parentfbc70034b3f5bd82d0cfe24a9a82a6d00237b46e (diff)
Make the DrvOutputSubstitutionGoal more async
Diffstat (limited to 'src/libstore/build/drv-output-substitution-goal.hh')
-rw-r--r--src/libstore/build/drv-output-substitution-goal.hh12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libstore/build/drv-output-substitution-goal.hh b/src/libstore/build/drv-output-substitution-goal.hh
index 1b11a298e..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 {
@@ -25,6 +27,13 @@ private:
/* 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;
};
}