From da136a6f422dce5221c92597263ac58e5be7bba8 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Sat, 24 May 2025 19:19:08 -0700 Subject: [PATCH] cc-wrapper: ensure that $PATH is exported After #400734 we modify gcc's $PATH in add-flags.sh which means that we now need to export it if it was not set originally, otherwise gcc's environment will not include the modification. --- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 2 +- pkgs/build-support/cc-wrapper/gnat-wrapper.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index a6120931381e..eb5b99643dba 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -249,7 +249,7 @@ if (( "${NIX_DEBUG:-0}" >= 1 )); then printf " %q\n" ${extraAfter+"${extraAfter[@]}"} >&2 fi -PATH="$path_backup" +export PATH="$path_backup" # Old bash workaround, see above. if (( "${NIX_CC_USE_RESPONSE_FILE:-@use_response_file_by_default@}" >= 1 )); then diff --git a/pkgs/build-support/cc-wrapper/gnat-wrapper.sh b/pkgs/build-support/cc-wrapper/gnat-wrapper.sh index e75eb3eb1ebf..64add8055479 100644 --- a/pkgs/build-support/cc-wrapper/gnat-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/gnat-wrapper.sh @@ -174,7 +174,7 @@ if (( "${NIX_DEBUG:-0}" >= 1 )); then printf " %q\n" ${extraAfter+"${extraAfter[@]}"} >&2 fi -PATH="$path_backup" +export PATH="$path_backup" # Old bash workaround, see above. exec @prog@ \ ${extraBefore+"${extraBefore[@]}"} \