aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-07-12 23:33:43 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-07-13 07:56:33 -0400
commitcaabc4f64889d5a4c47d6102b3aa1d3c80bbc107 (patch)
tree6859d20eec12b628ca77c07dee7e41e2e6a91f00 /src/libexpr/primops.cc
parentcafb5e8a1751b2c951347d5d9188b2e0bee357be (diff)
Feature gate `DownstreamPlaceholder::unknownCaOutput`
This is a part of CA derivations that we forgot to put behind the experimental feature. This was caught by @fricklerhandwerk in https://github.com/NixOS/nix/pull/8369#discussion_r1258133719
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 8a61e57cc..5dab06f26 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -83,22 +83,21 @@ StringMap EvalState::realiseContext(const NixStringContext & context)
for (auto & d : drvs) buildReqs.emplace_back(DerivedPath { d });
store->buildPaths(buildReqs);
- /* Get all the output paths corresponding to the placeholders we had */
for (auto & drv : drvs) {
auto outputs = resolveDerivedPath(*store, drv);
for (auto & [outputName, outputPath] : outputs) {
- res.insert_or_assign(
- DownstreamPlaceholder::unknownCaOutput(drv.drvPath, outputName).render(),
- store->printStorePath(outputPath)
- );
- }
- }
-
- /* Add the output of this derivations to the allowed
- paths. */
- if (allowedPaths) {
- for (auto & [_placeholder, outputPath] : res) {
- allowPath(store->toRealPath(outputPath));
+ /* Add the output of this derivations to the allowed
+ paths. */
+ if (allowedPaths) {
+ allowPath(outputPath);
+ }
+ /* Get all the output paths corresponding to the placeholders we had */
+ if (experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) {
+ res.insert_or_assign(
+ DownstreamPlaceholder::unknownCaOutput(drv.drvPath, outputName).render(),
+ store->printStorePath(outputPath)
+ );
+ }
}
}