From 067ddc66b45cd60b8924d9190312b99a29545cdc Mon Sep 17 00:00:00 2001 From: bcumming Date: Tue, 9 Jun 2026 13:06:19 +0200 Subject: [PATCH] Do not rebuild build cache index every time we push * rebuilding the index is expensive: scaling linearly with the number of packages in the build cache * it is not required for concretizer:reuse:false, which is the default mode of operation for stackinator --- stackinator/templates/Makefile | 2 +- stackinator/templates/Makefile.compilers | 2 +- stackinator/templates/Makefile.environments | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stackinator/templates/Makefile b/stackinator/templates/Makefile index 10a0ea58..628ac854 100644 --- a/stackinator/templates/Makefile +++ b/stackinator/templates/Makefile @@ -84,7 +84,7 @@ cache-force: mirror-setup $(warning likely have to start a fresh build (but that's okay, because build caches FTW)) $(warning ================================================================================) $(SANDBOX) $(MAKE) -C generate-config - $(SANDBOX) $(SPACK) --color=never -C $(STORE)/config buildcache create --rebuild-index --only=package alpscache \ + $(SANDBOX) $(SPACK) --color=never -C $(STORE)/config buildcache create --only=package alpscache \ $$($(SANDBOX) $(SPACK_HELPER) -C $(STORE)/config find --format '{name};{/hash};version={version}' \ | grep -v -E '^({% for p in exclude_from_cache %}{{ pipejoiner() }}{{ p }}{% endfor %});'\ | grep -v -E 'version=git\.'\ diff --git a/stackinator/templates/Makefile.compilers b/stackinator/templates/Makefile.compilers index 8418fbf0..ef41d8be 100644 --- a/stackinator/templates/Makefile.compilers +++ b/stackinator/templates/Makefile.compilers @@ -19,7 +19,7 @@ all:{% for compiler in compilers %} {{ compiler }}/generated/build_cache{% endfo {% for compiler, config in compilers.items() %} {{ compiler }}/generated/build_cache: {{ compiler }}/generated/env {% if push_to_cache %} - $(SPACK) -e ./{{ compiler }} buildcache create --rebuild-index --only=package alpscache \ + $(SPACK) -e ./{{ compiler }} buildcache create --only=package alpscache \ $$($(SPACK_HELPER) -e ./{{ compiler }} find --format '{name};{/hash}' \ | grep -v -E '^({% for p in config.exclude_from_cache %}{{ pipejoiner() }}{{ p }}{% endfor %});'\ | cut -d ';' -f2) diff --git a/stackinator/templates/Makefile.environments b/stackinator/templates/Makefile.environments index 5a530232..b7bfa27f 100644 --- a/stackinator/templates/Makefile.environments +++ b/stackinator/templates/Makefile.environments @@ -18,7 +18,7 @@ all:{% for env in environments %} {{ env }}/generated/build_cache{% endfor %} {% for env, config in environments.items() %} {{ env }}/generated/build_cache: {{ env }}/generated/view_config {% if push_to_cache %} - $(SPACK) --color=never -e ./{{ env }} buildcache create --rebuild-index --only=package alpscache \ + $(SPACK) --color=never -e ./{{ env }} buildcache create --only=package alpscache \ $$($(SPACK_HELPER) -e ./{{ env }} find --format '{name};{/hash};version={version}' \ | grep -v -E '^({% for p in config.exclude_from_cache %}{{ pipejoiner() }}{{ p }}{% endfor %});'\ | grep -v -E 'version=git\.'\