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'):
|
if url.startswith('file'):
|
||||||
mirror = url.replace('file://', '') + '/build_cache'
|
mirror = url.replace('file://', '') + '/build_cache'
|
||||||
tty.msg("Finding buildcaches in %s" % mirror)
|
tty.msg("Finding buildcaches in %s" % mirror)
|
||||||
files = os.listdir(mirror)
|
if os.path.exists(mirror):
|
||||||
for file in files:
|
files = os.listdir(mirror)
|
||||||
if re.search('spec.yaml', file):
|
for file in files:
|
||||||
link = 'file://' + mirror + '/' + file
|
if re.search('spec.yaml', file):
|
||||||
urls.add(link)
|
link = 'file://' + mirror + '/' + file
|
||||||
|
urls.add(link)
|
||||||
else:
|
else:
|
||||||
tty.msg("Finding buildcaches on %s" % url)
|
tty.msg("Finding buildcaches on %s" % url)
|
||||||
p, links = spider(url + "/build_cache")
|
p, links = spider(url + "/build_cache")
|
||||||
|
@ -75,7 +75,7 @@ def setup_parser(subparser):
|
|||||||
'--dont-restage', action='store_true',
|
'--dont-restage', action='store_true',
|
||||||
help="if a partial install is detected, don't delete prior state")
|
help="if a partial install is detected, don't delete prior state")
|
||||||
subparser.add_argument(
|
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")
|
help="check for pre-built Spack packages in mirrors")
|
||||||
subparser.add_argument(
|
subparser.add_argument(
|
||||||
'--show-log-on-error', action='store_true',
|
'--show-log-on-error', action='store_true',
|
||||||
|
@ -1403,7 +1403,7 @@ def do_install(self,
|
|||||||
|
|
||||||
tty.msg(colorize('@*{Installing} @*g{%s}' % self.name))
|
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):
|
if self.try_install_from_binary_cache(explicit):
|
||||||
tty.msg('Successfully installed %s from binary cache'
|
tty.msg('Successfully installed %s from binary cache'
|
||||||
% self.name)
|
% self.name)
|
||||||
|
@ -198,6 +198,9 @@ def test_buildcache(mock_archive, tmpdir):
|
|||||||
shutil.rmtree(mirror_path)
|
shutil.rmtree(mirror_path)
|
||||||
stage.destroy()
|
stage.destroy()
|
||||||
|
|
||||||
|
# Remove cached binary specs since we deleted the mirror
|
||||||
|
bindist._cached_specs = None
|
||||||
|
|
||||||
|
|
||||||
def test_relocate_text(tmpdir):
|
def test_relocate_text(tmpdir):
|
||||||
with tmpdir.as_cwd():
|
with tmpdir.as_cwd():
|
||||||
|
Loading…
Reference in New Issue
Block a user