When spack install checks for buildcaches only add urls for current arch. (#14467)
This commit is contained in:
		| @@ -663,7 +663,7 @@ def extract_tarball(spec, filename, allow_root=False, unsigned=False, | |||||||
| _cached_specs = None | _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 |     Get spec.yaml's for build caches available on mirror | ||||||
|     """ |     """ | ||||||
| @@ -690,6 +690,9 @@ def get_specs(force=False): | |||||||
|                 for file in files: |                 for file in files: | ||||||
|                     if re.search('spec.yaml', file): |                     if re.search('spec.yaml', file): | ||||||
|                         link = url_util.join(fetch_url_build_cache, file) |                         link = url_util.join(fetch_url_build_cache, file) | ||||||
|  |                         if use_arch and re.search(spack.architecture(), file): | ||||||
|  |                             urls.add(link) | ||||||
|  |                         else: | ||||||
|                             urls.add(link) |                             urls.add(link) | ||||||
|         else: |         else: | ||||||
|             tty.msg("Finding buildcaches at %s" % |             tty.msg("Finding buildcaches at %s" % | ||||||
| @@ -698,6 +701,9 @@ def get_specs(force=False): | |||||||
|                 url_util.join(fetch_url_build_cache, 'index.html')) |                 url_util.join(fetch_url_build_cache, 'index.html')) | ||||||
|             for link in links: |             for link in links: | ||||||
|                 if re.search("spec.yaml", link): |                 if re.search("spec.yaml", link): | ||||||
|  |                     if use_arch and re.search(spack.architecture(), link): | ||||||
|  |                         urls.add(link) | ||||||
|  |                     else: | ||||||
|                         urls.add(link) |                         urls.add(link) | ||||||
| 
 | 
 | ||||||
|     _cached_specs = [] |     _cached_specs = [] | ||||||
|   | |||||||
| @@ -1507,7 +1507,7 @@ def _update_explicit_entry_in_db(self, rec, explicit): | |||||||
| 
 | 
 | ||||||
|     def try_install_from_binary_cache(self, explicit): |     def try_install_from_binary_cache(self, explicit): | ||||||
|         tty.msg('Searching for binary cache of %s' % self.name) |         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 = spack.spec.Spec.from_dict(self.spec.to_dict()) | ||||||
|         binary_spec._mark_concrete() |         binary_spec._mark_concrete() | ||||||
|         if binary_spec not in specs: |         if binary_spec not in specs: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Patrick Gartung
					Patrick Gartung