diff options
author | Harmen Stoppels <me@harmenstoppels.nl> | 2023-11-04 21:42:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-04 20:42:47 +0000 |
commit | 6593d22c4e399547ac3de0b2738628ccd15c8c64 (patch) | |
tree | 14b42bf7a9012ace6a715e17e32be4d46d0feee3 /lib | |
parent | f51dad976e0108192904174dd656be6cadca8572 (diff) | |
download | spack-6593d22c4e399547ac3de0b2738628ccd15c8c64.tar.gz spack-6593d22c4e399547ac3de0b2738628ccd15c8c64.tar.bz2 spack-6593d22c4e399547ac3de0b2738628ccd15c8c64.tar.xz spack-6593d22c4e399547ac3de0b2738628ccd15c8c64.zip |
spack.modules.commmon: pass spec to SetupContext (#40886)
Currently module globals aren't set before running
`setup_[dependent_]run_environment` to compute environment modifications
for module files. This commit fixes that.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/modules/common.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/spack/spack/modules/common.py b/lib/spack/spack/modules/common.py index 98dcdb4fb1..49040e5ba3 100644 --- a/lib/spack/spack/modules/common.py +++ b/lib/spack/spack/modules/common.py @@ -731,7 +731,9 @@ class BaseContext(tengine.Context): # for that to work, globals have to be set on the package modules, and the # whole chain of setup_dependent_package has to be followed from leaf to spec. # So: just run it here, but don't collect env mods. - spack.build_environment.SetupContext(context=Context.RUN).set_all_package_py_globals() + spack.build_environment.SetupContext( + spec, context=Context.RUN + ).set_all_package_py_globals() # Then run setup_dependent_run_environment before setup_run_environment. for dep in spec.dependencies(deptype=("link", "run")): |