diff options
author | Greg Becker <becker33@llnl.gov> | 2019-10-22 23:27:40 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2019-10-22 23:27:40 -0700 |
commit | 95a48b27ec09b691d4107d48854126c045b03188 (patch) | |
tree | ba3285c667730336403f45a441b393758b9bf923 /var | |
parent | b14f18acda23c3299bea060b4d3424b8c72052a3 (diff) | |
download | spack-95a48b27ec09b691d4107d48854126c045b03188.tar.gz spack-95a48b27ec09b691d4107d48854126c045b03188.tar.bz2 spack-95a48b27ec09b691d4107d48854126c045b03188.tar.xz spack-95a48b27ec09b691d4107d48854126c045b03188.zip |
env activation: use package defined env setup methods (#13249)
This PR ensures that environment activation sets all environment variables set by the equivalent `module load` operations, except that the spec prefixes are "rebased" to the view associated with the environment.
Currently, Spack blindly adds paths relative to the environment view root to the user environment on activation. Issue #12731 points out ways in which this behavior is insufficient.
This PR changes that behavior to use the `setup_run_environment` logic for each package to augment the prefix inspections (as in Spack's modulefile generation logic) to ensure that all necessary variables are set to make use of the packages in the environment.
See #12731 for details on the previous problems in behavior.
This PR also updates the `ViewDescriptor` object in `spack.environment` to have a `__contains__` method. This allows for checks like `if spec in self.default_view`. The `__contains__` operator for `ViewDescriptor` objects checks whether the spec satisfies the filters of the View descriptor, not whether the spec is already linked into the underlying `FilesystemView` object.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/cmake-client/package.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/var/spack/repos/builtin.mock/packages/cmake-client/package.py b/var/spack/repos/builtin.mock/packages/cmake-client/package.py index e5cadb5d61..40e1c9f9ed 100644 --- a/var/spack/repos/builtin.mock/packages/cmake-client/package.py +++ b/var/spack/repos/builtin.mock/packages/cmake-client/package.py @@ -43,7 +43,7 @@ class CmakeClient(CMakePackage): def do_not_execute(self): self.did_something = True - def setup_environment(self, spack_env, run_env): + def setup_build_environment(self, spack_env): spack_cc # Ensure spack module-scope variable is avaiabl check(from_cmake == "from_cmake", "setup_environment couldn't read global set by cmake.") @@ -52,7 +52,7 @@ class CmakeClient(CMakePackage): "link arg on dependency spec not readable from " "setup_environment.") - def setup_dependent_environment(self, spack_env, run_env, dspec): + def setup_dependent_build_environment(self, spack_env, dspec): spack_cc # Ensure spack module-scope variable is avaiable check(from_cmake == "from_cmake", "setup_dependent_environment couldn't read global set by cmake.") |