summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2020-07-09 13:08:51 -0500
committerPeter Scheibel <scheibel1@llnl.gov>2020-07-10 13:05:49 -0700
commitafbb4a5cbade91d0b80e39ecbd98051bb8fd7628 (patch)
tree1e326f60da80f0c4ecd02c59fac49b2288d40d10
parente2bec75057000887f5af7f66761527d86b7562f6 (diff)
downloadspack-afbb4a5cbade91d0b80e39ecbd98051bb8fd7628.tar.gz
spack-afbb4a5cbade91d0b80e39ecbd98051bb8fd7628.tar.bz2
spack-afbb4a5cbade91d0b80e39ecbd98051bb8fd7628.tar.xz
spack-afbb4a5cbade91d0b80e39ecbd98051bb8fd7628.zip
installation: skip repository metadata for externals (#16954)
When Spack installs a package, it stores repository package.py files for it and all of its dependencies - any package with a Spack metadata directory in its installation prefix. It turns out this was too broad: this ends up including external packages installed by Spack (e.g. installed by another Spack instance). Currently Spack doesn't store the namespace properly for such packages, so even though the package file could be fetched from the external, Spack is unable to locate it. This commit avoids the issue by skipping any attempt to locate and copy from the package repository of externals, regardless of whether they have a Spack repo directory.
-rw-r--r--lib/spack/spack/installer.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/spack/spack/installer.py b/lib/spack/spack/installer.py
index a2b0220a8b..978296e051 100644
--- a/lib/spack/spack/installer.py
+++ b/lib/spack/spack/installer.py
@@ -405,9 +405,14 @@ def dump_packages(spec, path):
source = spack.store.layout.build_packages_path(node)
source_repo_root = os.path.join(source, node.namespace)
- # There's no provenance installed for the source package. Skip it.
- # User can always get something current from the builtin repo.
- if not os.path.isdir(source_repo_root):
+ # If there's no provenance installed for the package, skip it.
+ # If it's external, skip it because it either:
+ # 1) it wasn't built with Spack, so it has no Spack metadata
+ # 2) it was built by another Spack instance, and we do not
+ # (currently) use Spack metadata to associate repos with externals
+ # built by other Spack instances.
+ # Spack can always get something current from the builtin repo.
+ if node.external or not os.path.isdir(source_repo_root):
continue
# Create a source repo and get the pkg directory out of it.