aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2024-08-07 10:38:39 +0000
committerGerrit Code Review <gerrit@localhost>2024-08-07 10:38:39 +0000
commit27a63db710f1b923fcc74873d70c7e0bfc4ea092 (patch)
tree73b79f063bcb4902b7a0608570400c863f62e52d /src/libexpr
parent780998f4ea203444e5b07c4523449a8e4f19ecdd (diff)
parent7fc481396c69e0687e655fbf77397535960c831c (diff)
Merge "fix: warn and document when advanced attributes will have no impact due to __structuredAttrs" into main
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc6
-rw-r--r--src/libexpr/eval.hh5
-rw-r--r--src/libexpr/primops.cc14
3 files changed, 24 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index a925ce2d8..120130eb3 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -249,6 +249,12 @@ EvalState::EvalState(
, sRight(symbols.create("right"))
, sWrong(symbols.create("wrong"))
, sStructuredAttrs(symbols.create("__structuredAttrs"))
+ , sAllowedReferences(symbols.create("allowedReferences"))
+ , sAllowedRequisites(symbols.create("allowedRequisites"))
+ , sDisallowedReferences(symbols.create("disallowedReferences"))
+ , sDisallowedRequisites(symbols.create("disallowedRequisites"))
+ , sMaxSize(symbols.create("maxSize"))
+ , sMaxClosureSize(symbols.create("maxClosureSize"))
, sBuilder(symbols.create("builder"))
, sArgs(symbols.create("args"))
, sContentAddressed(symbols.create("__contentAddressed"))
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index a264dd348..c1779de15 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -161,7 +161,10 @@ public:
const Symbol sWith, sOutPath, sDrvPath, sType, sMeta, sName, sValue,
sSystem, sOverrides, sOutputs, sOutputName, sIgnoreNulls,
sFile, sLine, sColumn, sFunctor, sToString,
- sRight, sWrong, sStructuredAttrs, sBuilder, sArgs,
+ sRight, sWrong, sStructuredAttrs,
+ sAllowedReferences, sAllowedRequisites, sDisallowedReferences, sDisallowedRequisites,
+ sMaxSize, sMaxClosureSize,
+ sBuilder, sArgs,
sContentAddressed, sImpure,
sOutputHash, sOutputHashAlgo, sOutputHashMode,
sRecurseForDerivations,
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 0951a54de..561492f86 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1213,6 +1213,20 @@ drvName, Bindings * attrs, Value & v)
handleOutputs(ss);
}
+ if (i->name == state.sAllowedReferences)
+ warn("In a derivation named '%s', 'structuredAttrs' disables the effect of the derivation attribute 'allowedReferences'; use 'outputChecks.<output>.allowedReferences' instead", drvName);
+ if (i->name == state.sAllowedRequisites)
+ warn("In a derivation named '%s', 'structuredAttrs' disables the effect of the derivation attribute 'allowedRequisites'; use 'outputChecks.<output>.allowedRequisites' instead", drvName);
+ if (i->name == state.sDisallowedReferences)
+ warn("In a derivation named '%s', 'structuredAttrs' disables the effect of the derivation attribute 'disallowedReferences'; use 'outputChecks.<output>.disallowedReferences' instead", drvName);
+ if (i->name == state.sDisallowedRequisites)
+ warn("In a derivation named '%s', 'structuredAttrs' disables the effect of the derivation attribute 'disallowedRequisites'; use 'outputChecks.<output>.disallowedRequisites' instead", drvName);
+ if (i->name == state.sMaxSize)
+ warn("In a derivation named '%s', 'structuredAttrs' disables the effect of the derivation attribute 'maxSize'; use 'outputChecks.<output>.maxSize' instead", drvName);
+ if (i->name == state.sMaxClosureSize)
+ warn("In a derivation named '%s', 'structuredAttrs' disables the effect of the derivation attribute 'maxClosureSize'; use 'outputChecks.<output>.maxClosureSize' instead", drvName);
+
+
} else {
auto s = state.coerceToString(pos, *i->value, context, context_below, true).toOwned();
drv.env.emplace(key, s);