diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2017-03-28 08:43:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-28 08:43:43 -0700 |
commit | 782f29bc4b15829adeab2a0432ab2e50a1f1da32 (patch) | |
tree | 697e2498f077b0cb2c8b48ad05e50b195ca77952 /lib | |
parent | e549daa8ce1d928032411817bfbafa527d9396c1 (diff) | |
download | spack-782f29bc4b15829adeab2a0432ab2e50a1f1da32.tar.gz spack-782f29bc4b15829adeab2a0432ab2e50a1f1da32.tar.bz2 spack-782f29bc4b15829adeab2a0432ab2e50a1f1da32.tar.xz spack-782f29bc4b15829adeab2a0432ab2e50a1f1da32.zip |
Fix bug in `spack find` for installations with unknown namespaces. (#3573)
- Spack find would fail with "unknown namespace" for some queries when a
package from an unknown namespace was installed.
- Solve by being conservative: assume unknown packages are NOT providers
of virtual dependencies.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/spec.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 9fc2c99e4a..08b92cf705 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -2166,7 +2166,13 @@ class Spec(object): # A concrete provider can satisfy a virtual dependency. if not self.virtual and other.virtual: - pkg = spack.repo.get(self.fullname) + try: + pkg = spack.repo.get(self.fullname) + except spack.repository.PackageLoadError: + # If we can't get package info on this spec, don't treat + # it as a provider of this vdep. + return False + if pkg.provides(other.name): for provided, when_specs in pkg.provided.items(): if any(self.satisfies(when_spec, deps=False, strict=strict) |