From 0a666d5335277764c8290726edbc2f7b3e8b78e6 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 23 May 2025 08:53:46 +0200 Subject: [PATCH] substituteAll{,Files}: drop --- .../substitute-files/substitute-all-files.nix | 33 ------------------- .../substitute/substitute-all.nix | 29 ---------------- pkgs/top-level/aliases.nix | 2 ++ pkgs/top-level/all-packages.nix | 4 --- 4 files changed, 2 insertions(+), 66 deletions(-) delete mode 100644 pkgs/build-support/substitute-files/substitute-all-files.nix delete mode 100644 pkgs/build-support/substitute/substitute-all.nix diff --git a/pkgs/build-support/substitute-files/substitute-all-files.nix b/pkgs/build-support/substitute-files/substitute-all-files.nix deleted file mode 100644 index b8d1ae8a6834..000000000000 --- a/pkgs/build-support/substitute-files/substitute-all-files.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ lib, stdenv }: - -args: - -# TODO(@wolfgangwalther): Remove substituteAllFiles after 25.05 branch-off. -lib.warn - "substituteAllFiles is deprecated and will be removed in 25.11. Use replaceVars for each file instead." - ( - stdenv.mkDerivation ( - { - name = if args ? name then args.name else baseNameOf (toString args.src); - builder = builtins.toFile "builder.sh" '' - set -o pipefail - - eval "$preInstall" - - args= - - pushd "$src" - echo -ne "${lib.concatStringsSep "\\0" args.files}" | xargs -0 -n1 -I {} -- find {} -type f -print0 | while read -d "" line; do - mkdir -p "$out/$(dirname "$line")" - substituteAll "$line" "$out/$line" - done - popd - - eval "$postInstall" - ''; - preferLocalBuild = true; - allowSubstitutes = false; - } - // args - ) - ) diff --git a/pkgs/build-support/substitute/substitute-all.nix b/pkgs/build-support/substitute/substitute-all.nix deleted file mode 100644 index 1135c822e22d..000000000000 --- a/pkgs/build-support/substitute/substitute-all.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ lib, stdenvNoCC }: -# see the substituteAll in the nixpkgs documentation for usage and constraints -args: -let - # keep this in sync with substituteAll - isInvalidArgName = x: builtins.match "^[a-z][a-zA-Z0-9_]*$" x == null; - invalidArgs = builtins.filter isInvalidArgName (builtins.attrNames args); -in -# 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}. - '' -) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 6282093db163..a76f9754aade 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1806,6 +1806,8 @@ mapAliases { strawberry-qt5 = throw "strawberry-qt5 has been replaced by strawberry-qt6"; # Added 2024-11-22 strelka = throw "strelka depends on Python 2.6+, and does not support Python 3."; # Added 2025-03-17 subberthehut = throw "'subberthehut' has been removed as it was unmaintained upstream"; # Added 2025-05-17 + substituteAll = throw "`substituteAll` has been removed. Use `replaceVars` instead."; # Added 2025-05-23 + substituteAllFiles = throw "`substituteAllFiles` has been removed. Use `replaceVars` for each file instead."; # Added 2025-05-23 suidChroot = throw "'suidChroot' has been dropped as it was unmaintained, failed to build and had questionable security considerations"; # Added 2025-05-17 suitesparse_4_2 = throw "'suitesparse_4_2' has been removed as it was unmaintained upstream"; # Added 2025-05-17 suitesparse_4_4 = throw "'suitesparse_4_4' has been removed as it was unmaintained upstream"; # Added 2025-05-17 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d8ed42c1930a..fbc4fe32435a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -843,10 +843,6 @@ with pkgs; substitute = callPackage ../build-support/substitute/substitute.nix { }; - substituteAll = callPackage ../build-support/substitute/substitute-all.nix { }; - - substituteAllFiles = callPackage ../build-support/substitute-files/substitute-all-files.nix { }; - replaceDependencies = callPackage ../build-support/replace-dependencies.nix { }; replaceDependency =