From c43673f63be18f0a5bac55265bc6e5f9186923a8 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 0924dcad05f..bf10f010eb5 100644 --- a/lib/spack/spack/repo.py +++ b/lib/spack/spack/repo.py @@ -600,7 +600,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)