diff options
author | Greg Becker <becker33@llnl.gov> | 2022-11-11 09:59:23 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-11 10:59:23 -0700 |
commit | 2d2c5916337099431a9efca0c4594fc36fc3a609 (patch) | |
tree | b90aac5a65da315664451b46e9ba5bcc416982a3 /lib | |
parent | d49c992b230f544deeed13fb193d779a53f2f201 (diff) | |
download | spack-2d2c5916337099431a9efca0c4594fc36fc3a609.tar.gz spack-2d2c5916337099431a9efca0c4594fc36fc3a609.tar.bz2 spack-2d2c5916337099431a9efca0c4594fc36fc3a609.tar.xz spack-2d2c5916337099431a9efca0c4594fc36fc3a609.zip |
ensure view projections for extensions always point to extendee (#33848)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/filesystem_view.py | 13 |
1 files 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)) |