bugfix: modules relative to view use top-level view root, not implementation root (#24124)
This commit is contained in:
parent
c4c14e0c69
commit
d8fc38a467
@ -698,7 +698,7 @@ def environment_modifications(self):
|
||||
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)
|
||||
|
||||
|
@ -2504,7 +2504,7 @@ def test_modules_relative_to_views(tmpdir, install_mockery, mock_fetch):
|
||||
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 @@ def test_multiple_modules_post_env_hook(tmpdir, install_mockery, mock_fetch):
|
||||
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
|
||||
|
@ -346,7 +346,7 @@ def test_modules_relative_to_view(
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user