Skip to content

Commit

Permalink
ensure view projections for extensions always point to extendee
Browse files Browse the repository at this point in the history
  • Loading branch information
becker33 authored and tgamblin committed Nov 11, 2022
1 parent fc7a16e commit bb8b4f9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/spack/spack/filesystem_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,14 @@ def get_projection_for_spec(self, spec):
Relies on the ordering of projections to avoid ambiguity.
"""
spec = spack.spec.Spec(spec)
proj = spack.projections.get_projection(self.projections, spec)
locator_spec = spec

if spec.package.extendee_spec:
locator_spec = spec.package.extendee_spec

proj = spack.projections.get_projection(self.projections, locator_spec)
if proj:
return os.path.join(self._root, spec.format(proj))
return os.path.join(self._root, locator_spec.format(proj))
return self._root

def get_all_specs(self):
Expand Down Expand Up @@ -743,6 +748,10 @@ def get_projection_for_spec(self, spec):
Relies on the ordering of projections to avoid ambiguity.
"""
spec = spack.spec.Spec(spec)

if spec.package.extendee_spec:
spec = spec.package.extendee_spec

proj = spack.projections.get_projection(self.projections, spec)
if proj:
return os.path.join(self._root, spec.format(proj))
Expand Down

0 comments on commit bb8b4f9

Please sign in to comment.