diff options
author | regnat <rg@regnat.ovh> | 2021-10-27 11:36:51 +0200 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2021-11-03 06:51:34 +0100 |
commit | 96670ed2163d3d1a296c9b053833362ec8c06985 (patch) | |
tree | 80aec4b3e054710b2ec97b8517543207e8b8e502 /src/libstore/build | |
parent | 5b2aa61f1b8fe253c963874ccb4700f6ff99526e (diff) |
Expose an async interface for `queryRealisation`
Doesn’t change much so far because everything is still using it
synchronously, but should allow the binary cache to fetch stuff in
parallel
Diffstat (limited to 'src/libstore/build')
-rw-r--r-- | src/libstore/build/drv-output-substitution-goal.hh | 2 | ||||
-rw-r--r-- | src/libstore/build/local-derivation-goal.cc | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/libstore/build/drv-output-substitution-goal.hh b/src/libstore/build/drv-output-substitution-goal.hh index 63ab53d89..1b11a298e 100644 --- a/src/libstore/build/drv-output-substitution-goal.hh +++ b/src/libstore/build/drv-output-substitution-goal.hh @@ -20,7 +20,7 @@ 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; diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index 2182f0bb4..b076bf998 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -1224,13 +1224,14 @@ struct RestrictedStore : public virtual RestrictedStoreConfig, public virtual Lo // corresponds to an allowed derivation { throw Error("registerDrvOutput"); } - std::optional<const Realisation> queryRealisation(const DrvOutput & id) override + void queryRealisationUncached(const DrvOutput & id, + Callback<std::shared_ptr<const Realisation>> callback) noexcept override // XXX: This should probably be allowed if the realisation corresponds to // an allowed derivation { if (!goal.isAllowed(id)) - throw InvalidPath("cannot query an unknown output id '%s' in recursive Nix", id.to_string()); - return next->queryRealisation(id); + callback(nullptr); + next->queryRealisation(id, std::move(callback)); } void buildPaths(const std::vector<DerivedPath> & paths, BuildMode buildMode, std::shared_ptr<Store> evalStore) override |