buildcache: update spack install
to use build cache by default (#9772)
This commit is contained in:
parent
423d3e75ab
commit
988d37757f
@ -538,11 +538,12 @@ def get_specs(force=False):
|
||||
if url.startswith('file'):
|
||||
mirror = url.replace('file://', '') + '/build_cache'
|
||||
tty.msg("Finding buildcaches in %s" % mirror)
|
||||
files = os.listdir(mirror)
|
||||
for file in files:
|
||||
if re.search('spec.yaml', file):
|
||||
link = 'file://' + mirror + '/' + file
|
||||
urls.add(link)
|
||||
if os.path.exists(mirror):
|
||||
files = os.listdir(mirror)
|
||||
for file in files:
|
||||
if re.search('spec.yaml', file):
|
||||
link = 'file://' + mirror + '/' + file
|
||||
urls.add(link)
|
||||
else:
|
||||
tty.msg("Finding buildcaches on %s" % url)
|
||||
p, links = spider(url + "/build_cache")
|
||||
|
@ -75,7 +75,7 @@ def setup_parser(subparser):
|
||||
'--dont-restage', action='store_true',
|
||||
help="if a partial install is detected, don't delete prior state")
|
||||
subparser.add_argument(
|
||||
'--use-cache', action='store_true', dest='use_cache',
|
||||
'--no-cache', action='store_false', dest='use_cache',
|
||||
help="check for pre-built Spack packages in mirrors")
|
||||
subparser.add_argument(
|
||||
'--show-log-on-error', action='store_true',
|
||||
|
@ -1403,7 +1403,7 @@ def do_install(self,
|
||||
|
||||
tty.msg(colorize('@*{Installing} @*g{%s}' % self.name))
|
||||
|
||||
if kwargs.get('use_cache', False):
|
||||
if kwargs.get('use_cache', True):
|
||||
if self.try_install_from_binary_cache(explicit):
|
||||
tty.msg('Successfully installed %s from binary cache'
|
||||
% self.name)
|
||||
|
@ -198,6 +198,9 @@ def test_buildcache(mock_archive, tmpdir):
|
||||
shutil.rmtree(mirror_path)
|
||||
stage.destroy()
|
||||
|
||||
# Remove cached binary specs since we deleted the mirror
|
||||
bindist._cached_specs = None
|
||||
|
||||
|
||||
def test_relocate_text(tmpdir):
|
||||
with tmpdir.as_cwd():
|
||||
|
Loading…
Reference in New Issue
Block a user