From bb8b4f9979e87ae3fb63a3adcb768eda09e5b059 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Fri, 11 Nov 2022 08:15:10 -0800 Subject: ensure view projections for extensions always point to extendee --- lib/spack/spack/filesystem_view.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/filesystem_view.py b/lib/spack/spack/filesystem_view.py index f8cc382ef7..553d0b4108 100644 --- a/lib/spack/spack/filesystem_view.py +++ b/lib/spack/spack/filesystem_view.py @@ -493,9 +493,14 @@ class YamlFilesystemView(FilesystemView): 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): @@ -743,6 +748,10 @@ class SimpleFilesystemView(FilesystemView): 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)) -- cgit v1.2.3-70-g09d2