aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/derivations.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/derivations.hh')
-rw-r--r--src/libstore/derivations.hh18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh
index 2ea4178c0..0bb565e8a 100644
--- a/src/libstore/derivations.hh
+++ b/src/libstore/derivations.hh
@@ -4,6 +4,7 @@
#include "types.hh"
#include "hash.hh"
#include "content-address.hh"
+#include "sync.hh"
#include <map>
#include <variant>
@@ -127,6 +128,13 @@ struct Derivation : BasicDerivation
std::string unparse(const Store & store, bool maskOutputs,
std::map<std::string, StringSet> * actualInputs = nullptr) const;
+ /* Return the underlying basic derivation but with
+
+ 1. input drv outputs moved to input sources.
+
+ 2. placeholders replaced with realized input store paths. */
+ BasicDerivation resolve(Store & store);
+
Derivation() = default;
Derivation(BasicDerivation && bd) : BasicDerivation(std::move(bd)) { }
};
@@ -187,6 +195,16 @@ typedef std::map<StorePath, DrvHashModulo> DrvHashes;
extern DrvHashes drvHashes; // FIXME: global, not thread-safe
+/* Memoisation of `readDerivation(..).resove()`. */
+typedef std::map<
+ StorePath,
+ std::optional<StorePath>
+> DrvPathResolutions;
+
+// FIXME: global, though at least thread-safe.
+// FIXME: arguably overlaps with hashDerivationModulo memo table.
+extern Sync<DrvPathResolutions> drvPathResolutions;
+
bool wantOutput(const string & output, const std::set<string> & wanted);
struct Source;