From adc91ed9e2cf5be2bbc4164175256b66676adae8 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sat, 3 Oct 2026 16:04:43 +0200 Subject: [PATCH] fix(packaging): keep the per-commit version out of every module's cache key flatpak-builder printed "Building module llvm" on every CI run instead of "Cache hit". The build environment, CRAFTER_BUILD_VERSION included, sat in the manifest's top-level build options, and those are part of every module's cache key; the version changes with each commit, so no module ever hit. Runs still took twelve minutes rather than eighty only because ccache made the LLVM rebuild cheap. The variables only matter to crafter-build's own module, so they move there, and CI rewrites the version on that module. LLVM, the WASI sysroot and wasmtime are now keyed on nothing that changes between commits. Co-Authored-By: Claude Fable 5.1 --- .forgejo/workflows/ci.yaml | 2 +- .../flatpak/net.catcrafts.CrafterBuild.yaml | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml index daaafd6..0c5d79a 100644 --- a/.forgejo/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -99,7 +99,7 @@ jobs: VERSION: ${{ steps.meta.outputs.version }} run: | set -eu - yq '."build-options".env.CRAFTER_BUILD_VERSION = strenv(VERSION)' "$MANIFEST" > "$CI_MANIFEST" + yq '(.modules[] | select(.name == "crafter-build") | ."build-options".env.CRAFTER_BUILD_VERSION) = strenv(VERSION)' "$MANIFEST" > "$CI_MANIFEST" grep -n 'CRAFTER_BUILD_VERSION' "$CI_MANIFEST" flatpak-builder --force-clean --ccache --disable-rofiles-fuse \ --state-dir=/root/.cache/flatpak-builder \ diff --git a/packaging/flatpak/net.catcrafts.CrafterBuild.yaml b/packaging/flatpak/net.catcrafts.CrafterBuild.yaml index a8b769a..9eeb64f 100644 --- a/packaging/flatpak/net.catcrafts.CrafterBuild.yaml +++ b/packaging/flatpak/net.catcrafts.CrafterBuild.yaml @@ -28,15 +28,6 @@ finish-args: # gdb and friends from the Sdk - --allow=devel - --env=PATH=/app/bin:/usr/bin -build-options: - env: - CRAFTER_BUILD_LLVM_DIR: /app - # The shipped binary runs on any x86_64 from the last decade; user - # projects still build with -march=native by default. - CRAFTER_BUILD_MARCH: x86-64-v2 - CRAFTER_BUILD_MTUNE: generic - # CI replaces this with the tag; a local build is a development build. - CRAFTER_BUILD_VERSION: 0.0.0-dev cleanup: - /share/man - /share/doc @@ -188,6 +179,18 @@ modules: # (sibling repos tracking their default branch, see AGENTS.md). build-args: - --share=network + # On this module, not at the top of the manifest: top-level build + # options are part of every module's cache key, and the version changes + # with every commit, which made flatpak-builder rebuild LLVM each run. + env: + CRAFTER_BUILD_LLVM_DIR: /app + # The shipped binary runs on any x86_64 from the last decade; user + # projects still build with -march=native by default. + CRAFTER_BUILD_MARCH: x86-64-v2 + CRAFTER_BUILD_MTUNE: generic + # CI replaces this with the version; a local build is a development + # build. + CRAFTER_BUILD_VERSION: 0.0.0-dev build-commands: # Bootstrap by hand, then let the result build itself: only the # self-hosted binary has asset support and ThinLTO.