summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2023-04-17 15:03:37 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2023-05-15 09:15:49 -0700
commit0458de18def570e8eb28625a474336edcd039e4e (patch)
treee26972bf8a88e839b79c98f7b82befadd8061fac /lib
parentf94ac8c77033088feece2fa085e44a4fef54e18a (diff)
downloadspack-0458de18def570e8eb28625a474336edcd039e4e.tar.gz
spack-0458de18def570e8eb28625a474336edcd039e4e.tar.bz2
spack-0458de18def570e8eb28625a474336edcd039e4e.tar.xz
spack-0458de18def570e8eb28625a474336edcd039e4e.zip
bugfix: don't look up patches from packages for concrete specs
The concretizer can fail with `reuse:true` if a buildcache or installation contains a package with a dependency that has been renamed or deleted in the main repo (e.g., `netcdf` was refactored to `netcdf-c`, `netcdf-fortran`, etc., but there are still binary packages with dependencies called `netcdf`). We should still be able to install things for which we are missing `package.py` files. `Spec.inject_patches_variant()` was failing this requirement by attempting to look up the package class for concrete specs. This isn't needed -- we can skip it. - [x] swap two conditions in `Spec.inject_patches_variant()`
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/spec.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 7d3014a71d..522485f57e 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -2789,11 +2789,11 @@ class Spec(object):
# Also record all patches required on dependencies by
# depends_on(..., patch=...)
for dspec in root.traverse_edges(deptype=all, cover="edges", root=False):
- pkg_deps = dspec.parent.package_class.dependencies
- if dspec.spec.name not in pkg_deps:
+ if dspec.spec.concrete:
continue
- if dspec.spec.concrete:
+ pkg_deps = dspec.parent.package_class.dependencies
+ if dspec.spec.name not in pkg_deps:
continue
patches = []