Deprecate old YAML format for buildcaches (#33707)
This commit is contained in:
parent
b6da8635ec
commit
a4f3fe2ac7
@ -950,13 +950,13 @@ def generate_package_index(cache_prefix):
|
|||||||
.json) under cache_prefix.
|
.json) under cache_prefix.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
file_list = (
|
file_list = [
|
||||||
entry
|
entry
|
||||||
for entry in web_util.list_url(cache_prefix)
|
for entry in web_util.list_url(cache_prefix)
|
||||||
if entry.endswith(".yaml")
|
if entry.endswith(".yaml")
|
||||||
or entry.endswith("spec.json")
|
or entry.endswith("spec.json")
|
||||||
or entry.endswith("spec.json.sig")
|
or entry.endswith("spec.json.sig")
|
||||||
)
|
]
|
||||||
except KeyError as inst:
|
except KeyError as inst:
|
||||||
msg = "No packages at {0}: {1}".format(cache_prefix, inst)
|
msg = "No packages at {0}: {1}".format(cache_prefix, inst)
|
||||||
tty.warn(msg)
|
tty.warn(msg)
|
||||||
@ -969,6 +969,14 @@ def generate_package_index(cache_prefix):
|
|||||||
tty.warn(msg)
|
tty.warn(msg)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if any(x.endswith(".yaml") for x in file_list):
|
||||||
|
msg = (
|
||||||
|
"The mirror in '{}' contains specs in the deprecated YAML format.\n\n\tSupport for "
|
||||||
|
"this format will be removed in v0.20, please regenerate the build cache with a "
|
||||||
|
"recent Spack\n"
|
||||||
|
).format(cache_prefix)
|
||||||
|
warnings.warn(msg)
|
||||||
|
|
||||||
tty.debug("Retrieving spec descriptor files from {0} to build index".format(cache_prefix))
|
tty.debug("Retrieving spec descriptor files from {0} to build index".format(cache_prefix))
|
||||||
|
|
||||||
tmpdir = tempfile.mkdtemp()
|
tmpdir = tempfile.mkdtemp()
|
||||||
@ -1436,6 +1444,13 @@ def download_tarball(spec, unsigned=False, mirrors_for_spec=None):
|
|||||||
# the remaining mirrors, looking for one we can use.
|
# the remaining mirrors, looking for one we can use.
|
||||||
tarball_stage = try_fetch(spackfile_url)
|
tarball_stage = try_fetch(spackfile_url)
|
||||||
if tarball_stage:
|
if tarball_stage:
|
||||||
|
if ext == "yaml":
|
||||||
|
msg = (
|
||||||
|
"Reading {} from mirror.\n\n\tThe YAML format for buildcaches is "
|
||||||
|
"deprecated and will be removed in v0.20\n"
|
||||||
|
).format(spackfile_url)
|
||||||
|
warnings.warn(msg)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"tarball_stage": tarball_stage,
|
"tarball_stage": tarball_stage,
|
||||||
"specfile_stage": local_specfile_stage,
|
"specfile_stage": local_specfile_stage,
|
||||||
|
Loading…
Reference in New Issue
Block a user