summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2022-11-04 20:06:42 +0100
committerGitHub <noreply@github.com>2022-11-04 12:06:42 -0700
commita4f3fe2ac7997b25ed6358b5fffee728603cd2d5 (patch)
tree72375293e621ba96b8107a6d5bc9ba22dd11c57d /lib
parentb6da8635ec50b1cc7a88b99689920918ca5c4b90 (diff)
downloadspack-a4f3fe2ac7997b25ed6358b5fffee728603cd2d5.tar.gz
spack-a4f3fe2ac7997b25ed6358b5fffee728603cd2d5.tar.bz2
spack-a4f3fe2ac7997b25ed6358b5fffee728603cd2d5.tar.xz
spack-a4f3fe2ac7997b25ed6358b5fffee728603cd2d5.zip
Deprecate old YAML format for buildcaches (#33707)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/binary_distribution.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py
index 3de0bcf9db..5ea7138a16 100644
--- a/lib/spack/spack/binary_distribution.py
+++ b/lib/spack/spack/binary_distribution.py
@@ -950,13 +950,13 @@ def generate_package_index(cache_prefix):
.json) under cache_prefix.
"""
try:
- file_list = (
+ file_list = [
entry
for entry in web_util.list_url(cache_prefix)
if entry.endswith(".yaml")
or entry.endswith("spec.json")
or entry.endswith("spec.json.sig")
- )
+ ]
except KeyError as inst:
msg = "No packages at {0}: {1}".format(cache_prefix, inst)
tty.warn(msg)
@@ -969,6 +969,14 @@ def generate_package_index(cache_prefix):
tty.warn(msg)
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))
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.
tarball_stage = try_fetch(spackfile_url)
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 {
"tarball_stage": tarball_stage,
"specfile_stage": local_specfile_stage,