From 6c4ce379ca0b43aecdc44e1ffd80058d70ddac93 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Mon, 2 Oct 2023 14:51:48 +0200 Subject: buildcache: ignore errors of newer buildcache version (#40279) Currently buildcaches are forward incompatible in an annoying way: spack errors out when trying to use them. With this change, you just get a warning. --- lib/spack/spack/binary_distribution.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index fc6056e6be..90cd577fe8 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -216,11 +216,11 @@ class BinaryCacheIndex: with self._index_file_cache.read_transaction(cache_key): db._read_from_file(cache_path) except spack_db.InvalidDatabaseVersionError as e: - msg = ( + tty.warn( f"you need a newer Spack version to read the buildcache index for the " f"following mirror: '{mirror_url}'. {e.database_version_message}" ) - raise BuildcacheIndexError(msg) from e + return spec_list = db.query_local(installed=False, in_buildcache=True) -- cgit v1.2.3-60-g2f50