Repository navigation
thirdparty: fix the tccbin preservation test for the macOS arm64 patch step - #32021
Conversation
…h step vlang#31146 made the macOS arm64 recipe apply patches/tccmacho-page-count-filesize.diff to the TinyCC checkout. The preservation test's fixture V root had no such file and its fake TinyCC has no tccmacho.c, so the recipe exited 2 and the test failed on Linux, which fails the linux-amd64 job of update_tccbin.yml before its build. - give the fake TinyCC a tracked tccmacho.c and each fixture V root a stand-in patch that edits it - have the fake make record tccmacho.c at the build call and publish it on install, and check in the deferred and legacy loops that only the macOS arm64 recipe builds it patched - add a macOS arm64 case where the patch does not apply: it must fail with the recipe's diagnostic and leave no stage behind - check that the real patch parses and targets exactly tccmacho.c, running git apply outside any work tree so the working directory and TMPDIR do not matter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
medvednikov
left a comment
There was a problem hiding this comment.
Reviewed commit 9c78e20cb14afc5b689af5e347766c0cdf13ac45, ignoring CI as requested.
No blocking findings; this looks OK to merge.
The fixture patch matches the fake TinyCC source, and recording tccmacho.c at the build call (then publishing that snapshot during install) correctly checks what the build saw. Both deferred and legacy paths assert the expected patch state, while the other recipes must remain unpatched. The new invalid-patch case checks the diagnostic and cleanup of both the final stage and private sibling directories.
Validation: Bash syntax checks passed for the test and all five recipes. Focused local checks passed for the real patch's --numstat parse, build-time snapshots and both positive/negative patch-state assertions, and the actual macOS arm64 deferred patch-failure path (including cleanup, candidate preservation, and fixture-patch restoration). I could not run the full preservation matrix because rsync is not installed in this environment.
One non-blocking wording nit: the PR description says the real patch must report exactly tccmacho.c, but the awk guard at line 59 only requires that file to be among the reported targets. The current patch has the intended sole target; either softening that description or rejecting additional targets would make the claim precise.
Summary
tccbin_workflow_preservation_test.shhas failed on Linux since #31146, and with it thelinux-amd64 job of
update_tccbin.yml(step "Test tccbin workflow preservation", exit 2), asin the 2026-11-05 re-run of run 41268892804.
#31146 made the macOS arm64 recipe apply
patches/tccmacho-page-count-filesize.diffto the TinyCC checkout. The test runs every recipeagainst a fixture V root and a fake TinyCC repo. The fixture had no patch file and the fake
TinyCC has no
tccmacho.c, sogit applyfailed and the recipe exited 2. Recipes and theworkflow are unchanged; this only fixes the test.
tccmacho.c, and each fixture V root gets a stand-in patch atthe path the recipe reads, editing that file.
makerecordstccmacho.cat the build call and publishes it on install. Thedeferred and legacy loops check that the macOS arm64 output was built patched and every other
recipe's unpatched. A patch applied too late, undone, skipped or only applied in one mode now
fails.
tccmacho page_count patch failed to applyand leave no stage or private sibling behind.git apply --numstatmust parse it and report exactlytccmacho.c. It runs outside any work tree, sinceinside one
git applydrops paths outside the current directory.Not in this PR
managed tccbin bundles require TCCBIN_DEFER_COMMIT=1. That is the separate deferred-buildwork.
macos-arm64 CI applied it at
85ba3ae8without problems.Test plan
preservation contract: PASSafter. Also passes when run from
thirdparty/build_scripts/and withTMPDIRinside a gitrepo.
git apply,--checkonly,applying after install, applying only in deferred mode,
git reset --hardorgit checkout -- .after applying,--exclude=tccmacho.c, ignoring the apply failure,changing the diagnostic, and another recipe touching
tccmacho.c.file, at
src/tccmacho.cor attccmacho.c.orig./vreview, plus four adversarial rounds. Rounds 1 to 3 confirmed 9 low-severity test gaps,all fixed here, and the last round found nothing.
update_tccbin.yml, not in PR checks.Known limits: the test can't run on macOS (GNU
stat -c, as before). With one fake TinyCCcommit, applying the patch before a plain
git checkoutcan't be detected. A patch failure inlegacy mode has no case of its own (same recipe lines as deferred mode).
🤖 Generated with Claude Code