ci: the jac-kit action checks its download against a manifest sealed into the kit, and fetches again on a miss - #8942
Conversation
…into the kit, and fetches again on a miss Main's CI run for 8081ec8 lost test-jac-pack-smoke and three test-scale lanes to a jac binary with no payload trailer. The kit was whole (the same artifact ran in every other lane, and build-kit had smoked it), but actions/download-artifact@v4 took 70s where the other jobs took 7s, never printed its download-completed lines, and still exited 0: a stalled blob stream, a jac binary cut short of its trailer, and a step that reported success. build-kit and build-kit-macos now seal a manifest into the kit (zig-out/kit.sha256, with kit.sha256.sha256 vouching for the manifest itself, so a manifest cut short by the same truncation cannot pass). The jac-kit action checks its download against it strictly, and on a miss fetches the artifact once more and checks again. manifest.sh carries both sides and falls back from sha256sum to shasum -a 256 for the macOS lane.
|
Attempt 1 lost only test-runtime, to |
christianwilkins
left a comment
There was a problem hiding this comment.
Reviewed head 3989a6d30d1de42a67547e4208666c554cd94d0e.
No blocking finding in the complete patch. Both kit producers include the manifest and its digest, and the consumer retries once before a mandatory second check. I also read Jason's note about the first-attempt runtime failure and checked the current results rather than treating that attempt as the final CI state.
Validation: eight local manifest cases behaved as expected (intact kit, whitespace in filenames, truncated binary, missing file, truncated manifest, missing manifest/digest, malformed line with a valid manifest digest, and restored-download success; the intact and whitespace checks share one case). Cross-checking a sha256sum manifest with shasum, and the reverse, passed; shasum also rejected a corrupted payload. bash -n passed. Current-head CI is green (25 successful checks, 3 skipped); GitHub reports no conflicts. No source changes made during review.
Approved and ready to merge. No further author action identified on this head.
What failed on main
The CI run for 8081ec8 (run 33816389635) failed in test-jac-pack-smoke and test-scale (microservices, data, server). All four died in the jac-kit action's warm-up step with:
The kit itself was whole: the same artifact (ID 9917157116) ran in every other lane of that run, and build-kit had already smoked the binary with its 110 MiB payload. In the four failing jobs
actions/download-artifact@v4took about 70s instead of about 7s, never printed its "SHA256 digest of downloaded artifact" / "Artifact download completed successfully" lines, and still ended with outcome=success. The blob stream stalled mid-extraction, the step exited 0, and the jobs ran a jac binary cut short of its payload trailer.(The Release run that failed at the same commit was a re-dispatch of an already-tagged v0.37.3 and passed on the next dispatch; nothing to fix there.)
The fix
zig-out/kit.sha256hashes every kit file, andzig-out/kit.sha256.sha256hashes the manifest, so a manifest cut short by the same truncation cannot vouch for the files after it.download-artifact, strictly (a short, missing, or malformed line fails). On a miss it warns, fetches the artifact once more, and checks again, so a stalled download costs a retry instead of the job..github/actions/jac-kit/manifest.shholds both sides (write/check). It usessha256sumwhere present andshasum -a 256otherwise, so the macOS lane's kit gets the same treatment.Verified