From 782f29bc4b15829adeab2a0432ab2e50a1f1da32 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 28 Mar 2017 08:43:43 -0700 Subject: 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. --- lib/spack/spack/spec.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3-70-g09d2