aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/derivations.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-03-01 16:57:36 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-04-07 08:34:58 -0400
commit4e9f32f993aaa9f7995919e480e0e920d946184d (patch)
treed8947a5032185b7e9ecbfb5e2740a784416a7155 /src/libstore/derivations.hh
parentb200784cec056da53378eb043cae4fad188e4e6f (diff)
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.
Diffstat (limited to 'src/libstore/derivations.hh')
-rw-r--r--src/libstore/derivations.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh
index 38727d77a..9e7ceeb5d 100644
--- a/src/libstore/derivations.hh
+++ b/src/libstore/derivations.hh
@@ -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)) { }