summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Josef Scheibel <scheibel1@llnl.gov>2019-11-26 19:50:06 -0800
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2019-12-13 08:38:50 +0100
commit8199f22e7c31c6f9e2c70ac7e45a6d98414a5310 (patch)
tree8d24e76c702587892354c9124e948b76dc9f6c73
parentb62ba7609d524d3bd7d03dd29ba4841c22ccd43d (diff)
downloadspack-8199f22e7c31c6f9e2c70ac7e45a6d98414a5310.tar.gz
spack-8199f22e7c31c6f9e2c70ac7e45a6d98414a5310.tar.bz2
spack-8199f22e7c31c6f9e2c70ac7e45a6d98414a5310.tar.xz
spack-8199f22e7c31c6f9e2c70ac7e45a6d98414a5310.zip
Mirrors: skip attempts to fetch BundlePackages
BundlePackages use a noop fetch strategy. The mirror logic was assuming that the fetcher had a resource to cach after performing a fetch. This adds a special check to skip caching if the stage is associated with a BundleFetchStrategy. Note that this should allow caching resources associated with BundlePackages.
-rw-r--r--lib/spack/spack/stage.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py
index dd381fd402..7f49305231 100644
--- a/lib/spack/spack/stage.py
+++ b/lib/spack/spack/stage.py
@@ -494,6 +494,16 @@ class Stage(object):
def cache_mirror(self, stats):
"""Perform a fetch if the resource is not already cached"""
+ if isinstance(self.default_fetcher, fs.BundleFetchStrategy):
+ # BundleFetchStrategy has no source to fetch. The associated
+ # fetcher does nothing but the associated stage may still exist.
+ # There is currently no method available on the fetcher to
+ # distinguish this ('cachable' refers to whether the fetcher
+ # refers to a resource with a fixed ID, which is not the same
+ # concept as whether there is anything to fetch at all) so we
+ # must examine the type of the fetcher.
+ return
+
dst_root = spack.caches.mirror_cache.root
absolute_storage_path = os.path.join(
dst_root, self.mirror_paths.storage_path)