stdenv.mkDerivation: warn on nested lists

This commit is contained in:
Eman Resu
2026-05-16 21:55:21 -04:00
parent a507f08ca6
commit 04078604e8
2 changed files with 9 additions and 1 deletions

View File

@@ -410,6 +410,8 @@ gnuradioMinimal.override {
- `fetchFromSavannah` is now deprecated and is expected to be fully removed in a future release. From now on, use `fetchgit` or a Savannah releases mirror when applicable.
- Using nested lists in build/runtime inputs in `mkDerivation` is now deprecated.
### Additions and Improvements {#sec-nixpkgs-release-26.05-lib-additions-improvements}
- The builder `php.buildComposerProject2` for PHP applications has been improved for better reliability and stability.

View File

@@ -52,6 +52,7 @@ let
unique
unsafeDiscardStringContext
unsafeGetAttrPos
warn
warnIf
zipAttrsWith
;
@@ -482,7 +483,12 @@ let
if isSingularDependency dep then
index + 1
else if isList dep then
seq (checkDependencyList' ([ index ] ++ positions) name dep) (index + 1)
warn
''
Dependency of package '${attrs.name or attrs.pname}' uses a nested list in attribute '${name}'.
This is deprecated as of Nixpkgs release 26.05, and support will
be removed in a future nixpkgs release.''
(seq (checkDependencyList' ([ index ] ++ positions) name dep) (index + 1))
else
throw "Dependency is not of a valid type: ${
concatMapStrings (ix: "element ${toString ix} of ") ([ index ] ++ positions)