bugfix: modules relative to view use top-level view root, not implementation root (#24124)

This commit is contained in:
Greg Becker 2021-06-04 01:13:14 -07:00 committed by GitHub
parent c4c14e0c69
commit d8fc38a467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)