ci: tolerate cache-satisfied specs in the buildcache pushes

- buildcache push expands its selection into the full dependency
  closure, build-time dependencies included; specs that were satisfied
  from the buildcache do not have those installed locally, and the push
  fails with PackageNotInstalledError
- both push sites (the early gcc node push and the env-level push) only
  ever ran in fresh-build scenarios before, so the failure surfaced once
  the cache was warm
- pass --allow-missing to skip what is not installed (a best-effort push
  of everything that is); a freshly built gcc thus still uploads its
  build-time dependencies, which a future gcc rebuild can then pull as
  binaries
This commit is contained in:
Dennis Klein
2026-06-10 16:33:59 +02:00
committed by Dennis Klein
parent b568535910
commit 988ef81922
2 changed files with 8 additions and 2 deletions

View File

@@ -56,8 +56,11 @@ runs:
# Push the gcc node now, BEFORE `spack compiler find` registers it as an
# external -- externals are excluded from `buildcache push`. This is what
# lets CI pull gcc from the cache (~1 min) instead of building it (~1 h).
# --allow-missing: when gcc itself was pulled from the cache, its
# build-time dependencies are not installed locally and would
# otherwise fail the push.
spack mirror set --oci-username ${{ github.actor }} --oci-password-variable GITHUB_TOKEN ghcr-buildcache
spack buildcache push --unsigned ghcr-buildcache /$gcc_hash
spack buildcache push --unsigned --allow-missing ghcr-buildcache /$gcc_hash
fi
spack compiler find "$(spack location -i /$gcc_hash)"
echo "::endgroup::"

View File

@@ -50,7 +50,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
spack -e fairmq mirror set --oci-username ${{ github.actor }} --oci-password-variable GITHUB_TOKEN ghcr-buildcache
spack -e fairmq buildcache push --unsigned ghcr-buildcache
# --allow-missing: build-time dependencies of specs that were
# satisfied from the buildcache are not installed locally and
# would otherwise fail the whole push.
spack -e fairmq buildcache push --unsigned --allow-missing ghcr-buildcache
update-index:
if: github.repository == 'FairRootGroup/FairMQ' && !cancelled()