aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-27 17:56:36 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-27 17:56:36 +0000
commit951415b5685fe52d31770eadabd66d95ea75cfae (patch)
treeedaa3519b3f21f5bb4436e498d6c1a0a1ab3f69b /src
parente32a9e124bfdaea1475a3884510ed524976b504f (diff)
Require `ca-derivations` everywhere we create a CA derivation
"create" as in read one in from a serialized form, or build one from scratch in memory.
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/primops.cc4
-rw-r--r--src/libstore/derivations.cc12
2 files changed, 10 insertions, 6 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index bc528140b..784c12b16 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -640,8 +640,10 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
if (i->value->type == tNull) continue;
}
- if (i->name == state.sContentAddressed)
+ if (i->name == state.sContentAddressed) {
+ settings.requireExperimentalFeature("ca-derivations");
contentAddressed = state.forceBool(*i->value, pos);
+ }
/* The `args' attribute is special: it supplies the
command-line arguments to the builder. */
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index c88bb3c6d..6a12e8734 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -163,12 +163,13 @@ static DerivationOutput parseDerivationOutput(const Store & store, std::istrings
},
}
}
- : DerivationOutput {
- .output = DerivationOutputFloating {
+ : (settings.requireExperimentalFeature("ca-derivations"),
+ DerivationOutput {
+ .output = DerivationOutputFloating {
.method = std::move(method),
.hashType = std::move(hashType),
},
- };
+ });
} else
return DerivationOutput {
.output = DerivationOutputInputAddressed {
@@ -559,12 +560,13 @@ static DerivationOutput readDerivationOutput(Source & in, const Store & store)
},
}
}
- : DerivationOutput {
+ : (settings.requireExperimentalFeature("ca-derivations"),
+ DerivationOutput {
.output = DerivationOutputFloating {
.method = std::move(method),
.hashType = std::move(hashType),
},
- };
+ });
} else
return DerivationOutput {
.output = DerivationOutputInputAddressed {