1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 21:51:50 +02:00

Liberate checkDerivationOutputs from LocalStore

Make it instead a method on `Derivation` that can work with any store.
We will need this for a CLI command to create a derivation.
This commit is contained in:
John Ericson 2023-03-01 16:57:36 -05:00
parent b200784cec
commit 4e9f32f993
4 changed files with 70 additions and 61 deletions

View file

@ -333,6 +333,14 @@ struct Derivation : BasicDerivation
Store & store,
const std::map<std::pair<StorePath, std::string>, StorePath> & inputDrvOutputs) const;
/* Check that the derivation is valid and does not present any
illegal states.
This is mainly a matter of checking the outputs, where our C++
representation supports all sorts of combinations we do not yet
allow. */
void checkInvariants(Store & store, const StorePath & drvPath) const;
Derivation() = default;
Derivation(const BasicDerivation & bd) : BasicDerivation(bd) { }
Derivation(BasicDerivation && bd) : BasicDerivation(std::move(bd)) { }