diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-21 16:43:17 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-21 16:43:17 +0000 |
commit | fdeabf71601e4ec9ff797e0283d06f9b5b9d8aa5 (patch) | |
tree | 51cfb1a7b05b0641fc7c3bb755210f6cd053c395 /src/libstore/derivations.hh | |
parent | 02928f76fdf8ab991da404d4216e97d54af19976 (diff) | |
parent | 984e521392b3f41f7cdab203e5c00f3e00e27a28 (diff) |
Merge remote-tracking branch 'upstream/master' into multi-output-hashDerivationModulo
Diffstat (limited to 'src/libstore/derivations.hh')
-rw-r--r-- | src/libstore/derivations.hh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh index 97271ac09..9b749598f 100644 --- a/src/libstore/derivations.hh +++ b/src/libstore/derivations.hh @@ -13,11 +13,17 @@ namespace nix { /* Abstract syntax of derivations. */ +/// Pair of a hash, and how the file system was ingested +struct DerivationOutputHash { + FileIngestionMethod method; + Hash hash; + std::string printMethodAlgo() const; +}; + struct DerivationOutput { StorePath path; - std::string hashAlgo; /* hash used for expected hash computation */ - std::string hash; /* expected hash, may be null */ + std::optional<DerivationOutputHash> hash; /* hash used for expected hash computation */ void parseHashInfo(FileIngestionMethod & recursive, Hash & hash) const; }; @@ -82,9 +88,13 @@ Derivation readDerivation(const Store & store, const Path & drvPath); // FIXME: remove bool isDerivation(const string & fileName); +// known CA drv's output hashes, current just for fixed-output derivations +// whose output hashes are always known since they are fixed up-front. +typedef std::map<std::string, Hash> CaOutputHashes; + typedef std::variant< Hash, // regular DRV normalized hash - std::map<std::string, Hash> // known CA drv's output hashes + CaOutputHashes > DrvHashModulo; /* Returns hashes with the details of fixed-output subderivations |