From ebf6790c393f4e89eede6d8049c95dc738734bea Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 15 Aug 2024 23:37:46 +0000 Subject: [PATCH 1/2] stdenv: concatTo: fall back to old behaviour for "*Array" variables Fixes e.g. the `sudo` build failure --- pkgs/stdenv/generic/setup.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index ea61ec7509ce6..ef645e4e513ea 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -400,8 +400,15 @@ concatTo() { -a*) targetref+=( "${nameref[@]}" ) ;; *) - # shellcheck disable=SC2206 - targetref+=( ${nameref-} ) ;; + if [[ "$name" = *"Array" ]]; then + nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future" + # Reproduces https://github.com/NixOS/nixpkgs/pull/318614/files#diff-7c7ca80928136cfc73a02d5b28350bd900e331d6d304857053ffc9f7beaad576L359 + targetref+=( ${nameref+"${nameref[@]}"} ) + else + # shellcheck disable=SC2206 + targetref+=( ${nameref-} ) + fi + ;; esac fi done From f974fa11e7e55f7e419492d472e1522d25ebdaf7 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 15 Aug 2024 23:38:27 +0000 Subject: [PATCH 2/2] sudo: amend the concatTo warning (configureFlagsArray) --- pkgs/tools/security/sudo/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/security/sudo/default.nix b/pkgs/tools/security/sudo/default.nix index c5dcc5f864a04..885fcc51aa48e 100644 --- a/pkgs/tools/security/sudo/default.nix +++ b/pkgs/tools/security/sudo/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation (finalAttrs: { # e.g. links to man pages, value constraints etc. version = "1.9.15p5"; + __structuredAttrs = true; + src = fetchurl { url = "https://www.sudo.ws/dist/sudo-${finalAttrs.version}.tar.gz"; hash = "sha256-VY0QuaGZH7O5+n+nsH7EQFt677WzywsIcdvIHjqI5Vg=";