Skip to content
Snippets Groups Projects
Unverified Commit 587c650b authored by Peter Josef Scheibel's avatar Peter Josef Scheibel Committed by Todd Gamblin
Browse files

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.
parent d7142862
No related branches found
No related tags found
No related merge requests found
......@@ -492,6 +492,16 @@ def cache_local(self):
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment