summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2023-11-22 17:32:13 +0100
committerGitHub <noreply@github.com>2023-11-22 17:32:13 +0100
commit24a38e67824c1c13e4b67cd4f5d7c065551d9aa1 (patch)
tree32cbd2e5bcbefdf1c9d3347f6bd6a1f353dcc851 /lib
parent3cf7f7b8000d788d596865de2c2cb8bc52e651b9 (diff)
downloadspack-24a38e67824c1c13e4b67cd4f5d7c065551d9aa1.tar.gz
spack-24a38e67824c1c13e4b67cd4f5d7c065551d9aa1.tar.bz2
spack-24a38e67824c1c13e4b67cd4f5d7c065551d9aa1.tar.xz
spack-24a38e67824c1c13e4b67cd4f5d7c065551d9aa1.zip
setup_platform_environment before package env mods (#41205)
This roughly restores the order of operation from Spack 0.20, where where `AutotoolsPackage.setup_build_environment` would override the env variable set in `setup_platform_environment` on macOS.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_environment.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 4c4eca6567..36574259d0 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -743,15 +743,16 @@ def setup_package(pkg, dirty, context: Context = Context.BUILD):
set_compiler_environment_variables(pkg, env_mods)
set_wrapper_variables(pkg, env_mods)
- tty.debug("setup_package: grabbing modifications from dependencies")
- env_mods.extend(setup_context.get_env_modifications())
- tty.debug("setup_package: collected all modifications from dependencies")
-
- # architecture specific setup
+ # Platform specific setup goes before package specific setup. This is for setting
+ # defaults like MACOSX_DEPLOYMENT_TARGET on macOS.
platform = spack.platforms.by_name(pkg.spec.architecture.platform)
target = platform.target(pkg.spec.architecture.target)
platform.setup_platform_environment(pkg, env_mods)
+ tty.debug("setup_package: grabbing modifications from dependencies")
+ env_mods.extend(setup_context.get_env_modifications())
+ tty.debug("setup_package: collected all modifications from dependencies")
+
if context == Context.TEST:
env_mods.prepend_path("PATH", ".")
elif context == Context.BUILD and not dirty and not env_mods.is_unset("CPATH"):