deprecated-features/rec-set-dynamic-attrs: Downgrade to warning for now

Looks like too much stuff is breaking on this, so let's make it only a
warning for now to ease transition

Change-Id: I52d50ceb1fe1fbe9f4e28d0aabf3537f7e4d52d1
This commit is contained in:
piegames
2026-02-11 12:24:35 +01:00
parent ae4a000576
commit ef2fd27467
7 changed files with 29 additions and 10 deletions
+1 -1
View File
@@ -234,7 +234,7 @@ inline void State::recSetMergeFound(const AttrPath & attrPath, const PosIdx pos)
// Added 2025-11-24
inline void State::recSetDynamicAttrFound(const PosIdx pos)
{
throw ParseError({
logWarning({
.msg = HintFmt(
"dynamic attributes are not allowed within recursive attrsets, because they would be "
"evaluated separately from the other recursive attributes. Use %s to disable this "
@@ -4,8 +4,8 @@ internalName: RecSetDynamicAttrs
timeline:
- date: 2026-01-30
release: 2.95.0
cls: [4652]
message: Introduced as a parser error.
cls: [4652, 5067]
message: Introduced as a parser warning.
---
Dynamic attrs (attrs with interpolation in the key) are deprecated in `rec` attrsets.
This is because the recursive dynamics fundamentally do not work with dynamic attributes,
@@ -1,6 +0,0 @@
error: dynamic attributes are not allowed within recursive attrsets, because they would be evaluated separately from the other recursive attributes. Use --extra-deprecated-features rec-set-dynamic-attrs to disable this error.
at /pwd/in.nix:4:5:
3| foo = yep;
4| ${foo} = "awa";
| ^
5| }
@@ -0,0 +1,6 @@
warning: dynamic attributes are not allowed within recursive attrsets, because they would be evaluated separately from the other recursive attributes. Use --extra-deprecated-features rec-set-dynamic-attrs to disable this error.
at /pwd/in.nix:4:5:
3| foo = yep;
4| ${foo} = "awa";
| ^
5| }
@@ -0,0 +1,18 @@
_type: ExprSet
attrs:
foo:
_type: ExprVar
value: yep
yep:
_type: ExprLiteral
value: bar
valueType: String
dynamicAttrs:
- name:
_type: ExprVar
value: foo
value:
_type: ExprLiteral
value: awa
valueType: String
recursive: true
@@ -1,5 +1,6 @@
[[test]]
runner = "parse-fail"
name = "parse-okay-warn"
runner = "parse-okay"
matrix = true
[[test]]