1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-21 01:39:36 +01:00

Merge remote-tracking branch 'me/no-stringly-typed-derivation-output' into validPathInfo-ca-proper-datatype

This commit is contained in:
John Ericson 2020-06-19 15:18:19 +00:00
commit 2f0e395c99
14 changed files with 108 additions and 42 deletions

View file

@ -12,22 +12,12 @@ enum struct FileIngestionMethod : uint8_t {
struct TextHash {
Hash hash;
TextHash(const TextHash &) = default;
TextHash(TextHash &&) = default;
TextHash & operator = (const TextHash &) = default;
};
/// Pair of a hash, and how the file system was ingested
struct FileSystemHash {
struct FixedOutputHash {
FileIngestionMethod method;
Hash hash;
FileSystemHash(FileIngestionMethod method, Hash hash)
: method(std::move(method))
, hash(std::move(hash))
{ }
FileSystemHash(const FileSystemHash &) = default;
FileSystemHash(FileSystemHash &&) = default;
FileSystemHash & operator = (const FileSystemHash &) = default;
std::string printMethodAlgo() const;
};
@ -44,7 +34,7 @@ struct FileSystemHash {
*/
typedef std::variant<
TextHash, // for paths computed by makeTextPath() / addTextToStore
FileSystemHash // for path computed by makeFixedOutputPath
FixedOutputHash // for path computed by makeFixedOutputPath
> ContentAddress;
/* Compute the prefix to the hash algorithm which indicates how the files were