summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2021-06-04 01:13:14 -0700
committerGitHub <noreply@github.com>2021-06-04 10:13:14 +0200
commitd8fc38a467126454bb1c2c9e6e341667a9173963 (patch)
tree4519e4ee1640fa06f5b786ec382570fe433b6649 /lib
parentc4c14e0c695fda2f62823cd18888c78dc829fdbd (diff)
downloadspack-d8fc38a467126454bb1c2c9e6e341667a9173963.tar.gz
spack-d8fc38a467126454bb1c2c9e6e341667a9173963.tar.bz2
spack-d8fc38a467126454bb1c2c9e6e341667a9173963.tar.xz
spack-d8fc38a467126454bb1c2c9e6e341667a9173963.zip
bugfix: modules relative to view use top-level view root, not implementation root (#24124)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/modules/common.py2
-rw-r--r--lib/spack/spack/test/cmd/env.py4
-rw-r--r--lib/spack/spack/test/modules/lmod.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/modules/common.py b/lib/spack/spack/modules/common.py
index 1e5f261578..ffd170226d 100644
--- a/lib/spack/spack/modules/common.py
+++ b/lib/spack/spack/modules/common.py
@@ -698,7 +698,7 @@ class BaseContext(tengine.Context):
use_view = ev.default_view_name
env = ev.get_env({}, 'post_env_write_hook', required=True)
- view = env.views[use_view].view()
+ view = env.views[use_view]
spec.prefix = view.get_projection_for_spec(spec)
diff --git a/lib/spack/spack/test/cmd/env.py b/lib/spack/spack/test/cmd/env.py
index 002bd14c0f..5aa30a9455 100644
--- a/lib/spack/spack/test/cmd/env.py
+++ b/lib/spack/spack/test/cmd/env.py
@@ -2504,7 +2504,7 @@ spack:
install()
spec = e.specs_by_hash[e.concretized_order[0]]
- view_prefix = e.default_view.view().get_projection_for_spec(spec)
+ view_prefix = e.default_view.get_projection_for_spec(spec)
modules_glob = '%s/modules/**/*' % e.path
modules = glob.glob(modules_glob)
assert len(modules) == 1
@@ -2539,7 +2539,7 @@ spack:
install()
spec = e.specs_by_hash[e.concretized_order[0]]
- view_prefix = e.default_view.view().get_projection_for_spec(spec)
+ view_prefix = e.default_view.get_projection_for_spec(spec)
modules_glob = '%s/modules/**/*' % e.path
modules = glob.glob(modules_glob)
assert len(modules) == 1
diff --git a/lib/spack/spack/test/modules/lmod.py b/lib/spack/spack/test/modules/lmod.py
index 097aaf526f..049bddcd9a 100644
--- a/lib/spack/spack/test/modules/lmod.py
+++ b/lib/spack/spack/test/modules/lmod.py
@@ -346,7 +346,7 @@ class TestLmod(object):
spec = spack.spec.Spec('cmake').concretized()
content = modulefile_content('cmake')
- expected = e.default_view.view().get_projection_for_spec(spec)
+ expected = e.default_view.get_projection_for_spec(spec)
# Rather than parse all lines, ensure all prefixes in the content
# point to the right one
assert any(expected in line for line in content)