diff options
author | Patrick Gartung <gartung@fnal.gov> | 2020-01-25 21:15:12 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-25 21:15:12 -0600 |
commit | d2098d337a6cdf9cd58c6c30b4800cbb1682335f (patch) | |
tree | a7a9a214c55e116cf60984f6b18eedceab3faea8 /lib | |
parent | a26e5caa572a2c1cb39225bc52f20dc49589fb02 (diff) | |
download | spack-d2098d337a6cdf9cd58c6c30b4800cbb1682335f.tar.gz spack-d2098d337a6cdf9cd58c6c30b4800cbb1682335f.tar.bz2 spack-d2098d337a6cdf9cd58c6c30b4800cbb1682335f.tar.xz spack-d2098d337a6cdf9cd58c6c30b4800cbb1682335f.zip |
When spack install checks for buildcaches only add urls for current arch. (#14467)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/binary_distribution.py | 12 | ||||
-rw-r--r-- | lib/spack/spack/package.py | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index acfe6f2cea..55feacc7c4 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -663,7 +663,7 @@ def extract_tarball(spec, filename, allow_root=False, unsigned=False, _cached_specs = None -def get_specs(force=False): +def get_specs(force=False, use_arch=False): """ Get spec.yaml's for build caches available on mirror """ @@ -690,7 +690,10 @@ def get_specs(force=False): for file in files: if re.search('spec.yaml', file): link = url_util.join(fetch_url_build_cache, file) - urls.add(link) + if use_arch and re.search(spack.architecture(), file): + urls.add(link) + else: + urls.add(link) else: tty.msg("Finding buildcaches at %s" % url_util.format(fetch_url_build_cache)) @@ -698,7 +701,10 @@ def get_specs(force=False): url_util.join(fetch_url_build_cache, 'index.html')) for link in links: if re.search("spec.yaml", link): - urls.add(link) + if use_arch and re.search(spack.architecture(), link): + urls.add(link) + else: + urls.add(link) _cached_specs = [] for link in urls: diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index ba3cf2961b..cc13017f4c 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -1507,7 +1507,7 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)): def try_install_from_binary_cache(self, explicit): tty.msg('Searching for binary cache of %s' % self.name) - specs = binary_distribution.get_specs() + specs = binary_distribution.get_specs(use_arch=True) binary_spec = spack.spec.Spec.from_dict(self.spec.to_dict()) binary_spec._mark_concrete() if binary_spec not in specs: |