From d6cb54da4ba9c37041d3d8af78e244abed746d38 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 9 Jan 2025 17:00:27 +0100 Subject: [PATCH] Write repo caches in specfile specific files In this way we'll never encounter weird errors, when bumping the specfile version. There are other unrelated issues with repo caches, but those can be resolved separately. --- lib/spack/spack/repo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/repo.py b/lib/spack/spack/repo.py index e4a945f0bfe..11419c2e4e6 100644 --- a/lib/spack/spack/repo.py +++ b/lib/spack/spack/repo.py @@ -599,7 +599,9 @@ def _build_index(self, name: str, indexer: Indexer): """Determine which packages need an update, and update indexes.""" # Filename of the provider index cache (we assume they're all json) - cache_filename = f"{name}/{self.namespace}-index.json" + cache_filename = ( + f"{name}/{self.namespace}-specfile_v{spack.spec.SPECFILE_FORMAT_VERSION}-index.json" + ) # Compute which packages needs to be updated in the cache index_mtime = self.cache.mtime(cache_filename)