substituteAll: deprecate

This commit is contained in:
Wolfgang Walther 2025-04-01 22:11:42 +02:00
parent 3bfa33ed99
commit fe7dba6858
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1
2 changed files with 23 additions and 18 deletions

View file

@ -112,6 +112,8 @@
- All support for 32bit Darwin systems has been dropped.
- `substituteAll` has been deprecated in favor of `replaceVars` and will be removed in the next release.
- Default ICU version updated from 74 to 76
- Apache Kafka was updated to `>= 4.0.0`. Please note that this is the first release which operates

View file

@ -6,21 +6,24 @@ let
isInvalidArgName = x: builtins.match "^[a-z][a-zA-Z0-9_]*$" x == null;
invalidArgs = builtins.filter isInvalidArgName (builtins.attrNames args);
in
if invalidArgs == [ ] then
stdenvNoCC.mkDerivation (
{
name = if args ? name then args.name else baseNameOf (toString args.src);
builder = ./substitute-all.sh;
inherit (args) src;
preferLocalBuild = true;
allowSubstitutes = false;
}
// args
)
else
throw ''
Argument names for `pkgs.substituteAll` must:
- start with a lower case ASCII letter
- only contain ASCII letters, digits and underscores
Found invalid argument names: ${lib.concatStringsSep ", " invalidArgs}.
''
# TODO(@wolfgangwalther): Remove substituteAll, the nix function, after 25.05 branch-off.
lib.warn "substituteAll is deprecated and will be removed in 25.11. Use replaceVars instead." (
if invalidArgs == [ ] then
stdenvNoCC.mkDerivation (
{
name = if args ? name then args.name else baseNameOf (toString args.src);
builder = ./substitute-all.sh;
inherit (args) src;
preferLocalBuild = true;
allowSubstitutes = false;
}
// args
)
else
throw ''
Argument names for `pkgs.substituteAll` must:
- start with a lower case ASCII letter
- only contain ASCII letters, digits and underscores
Found invalid argument names: ${lib.concatStringsSep ", " invalidArgs}.
''
)