Skip to content

Commit 0ce3d9c

Browse files
committed
fix(ci): the registry cache must not carry the resolved index
`actions/cache` held all of `~/.mcpp/registry`, and that includes `data/xim-pkgindex` and `data/mcpplibs` — the RESOLVED indices, the descriptors mcpp actually reads. The key's `restore-keys` prefix ends at MCPP_VERSION, so a run restored whatever index the previous run left behind, regardless of what had landed upstream in between. THIS ALREADY COST A DAY Two successive fixes to `xim:wix` (openxlings/xim-pkgindex#808, then #809) were each merged, each re-run here, and each appeared to change nothing. Both were read as "the fix does not work" and the second one was written on that false premise. Neither had ever been loaded. The tell was in the logs the whole time: `7zip`, which #809 declares as a dependency, appeared ZERO times in a run that was supposedly testing #809. A fix that is not in the log is not being tested. What eventually refreshed the index was moving MCPP_VERSION for unrelated reasons — a coincidence of cache-key composition, not a mechanism anyone chose. Until then the rule was, in effect: **a change to a xim package cannot be verified from this repo's CI.** EXCLUDE, DO NOT KEY ON IT Adding the index revision to the key would evict everything on every upstream commit. Measured on a developer machine: the two index trees are ~8 MB, `data/xpkgs` is ~28 GB. Re-fetching 8 MB per job is the cheap half and it is the half that has to be current; rebuilding 28 GB because a descriptor changed in another repository is the expensive half and it does not. So the payloads and toolchains stay cached and the indices stop being.
1 parent 18dfa0b commit 0ce3d9c

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

‎.github/workflows/validate.yml‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,32 @@ jobs:
972972
with:
973973
# Holds toolchains AND the built compat packages (data/xpkgs), so a
974974
# repeat `mcpp test` rebuilds little.
975-
path: ~/.mcpp/registry
975+
#
976+
# THE INDEX TREES ARE EXCLUDED, and that exclusion is the whole point
977+
# of this entry's shape. `data/xim-pkgindex` and `data/mcpplibs` are
978+
# the RESOLVED indices -- the descriptors mcpp reads. Caching them
979+
# under a key whose `restore-keys` prefix ends at MCPP_VERSION means
980+
# a run restores whatever index the last run happened to leave, no
981+
# matter what landed upstream since.
982+
#
983+
# That is not hypothetical. Two successive fixes to `xim:wix`
984+
# (openxlings/xim-pkgindex#808, then #809) were each merged, each
985+
# re-run here, and each appeared to change nothing -- because neither
986+
# was ever loaded. The tell was that `7zip`, which #809 declares,
987+
# appeared ZERO times in a log that was supposedly testing #809. The
988+
# only thing that ever refreshed the index was moving MCPP_VERSION,
989+
# which is a coincidence of cache-key composition rather than a
990+
# mechanism anyone chose.
991+
#
992+
# Excluding rather than keying on the index revision is deliberate.
993+
# Keying would evict everything on every upstream commit; measured on
994+
# a developer machine, the index trees are ~8 MB against ~28 GB of
995+
# `data/xpkgs`. Re-fetching 8 MB per job is the cheap half, and it is
996+
# the half that has to be current.
997+
path: |
998+
~/.mcpp/registry
999+
!~/.mcpp/registry/data/xim-pkgindex
1000+
!~/.mcpp/registry/data/mcpplibs
9761001
key: ${{ env.REGISTRY_CACHE_KEY }}
9771002
restore-keys: |
9781003
mcpp-registry-${{ runner.os }}-${{ matrix.toolchain }}-${{ env.MCPP_VERSION }}-

0 commit comments

Comments
 (0)