From fe8fcfd271242db08cdf28b44ff18b73162afb42 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Tue, 7 Apr 2026 23:51:46 +0200 Subject: [PATCH] tcl.tclRequiresCheckHook: make compatible with structuredAttrs With __structuredAttrs enabled, arguments to mkDerivation are not exported as environment variables inside the bash builder by default, so in this case tclRequiresCheck doesn't exist when the tcl oneliner tries to read it. tclRequiresCheck is also an array in this case. So, expand the array and set the environment variable explicitly for the tcl call only. --- pkgs/development/interpreters/tcl/tcl-requires-check-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/tcl/tcl-requires-check-hook.sh b/pkgs/development/interpreters/tcl/tcl-requires-check-hook.sh index 0027a0c4b386..9cf55c1f72c2 100644 --- a/pkgs/development/interpreters/tcl/tcl-requires-check-hook.sh +++ b/pkgs/development/interpreters/tcl/tcl-requires-check-hook.sh @@ -5,9 +5,9 @@ tclRequiresCheckPhase () { echo "Executing tclRequiresCheckPhase" if [ -n "$tclRequiresCheck" ]; then - echo "Check whether the following packages can be required: $tclRequiresCheck" + echo "Check whether the following packages can be required: ${tclRequiresCheck[*]}" export TCLLIBPATH="$out/lib $TCLLIBPATH" # Redundant if tcl-package-hook is also used - tclsh <<<'exit [catch {foreach req $env(tclRequiresCheck) {package require $req}}]' + tclRequiresCheck="${tclRequiresCheck[@]}" tclsh <<<'exit [catch {foreach req $env(tclRequiresCheck) {package require $req}}]' fi }