Detect stale native binaries before release - #162
Draft
ruccho wants to merge 2 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The unienc native plugins are built by manually dispatching the Build unienc workflow (
build-unienc.yml), which commits the resulting binaries back to the branch. When the Rust source changes, this rebuild is easy to forget, and stale binaries can then ship in a release.This PR adds a CI guard that detects a forgotten rebuild on the version-bump PR — the step every release goes through — so the mismatch surfaces before a tag is created (tag creation itself can't be blocked, but the version-bump PR can).
How it works
A source fingerprint is derived purely from git object hashes (no build required — fast, deterministic, machine-independent):
unienc-tree— tree hash ofInstantReplay.Externals/unienc, which transitively covers the Rust source,Cargo.lock, and the submodule pointers (gitlink entries)build-workflow— blob hash ofbuild-unienc.yml(catches build-flag/recipe changes)localize-script— blob hash of the Apple staticlib post-processing scriptThe fingerprint changes if and only if the native binaries would need rebuilding.
build-unienc.ymlnow writes the fingerprint of the built source into a committed marker (Packages/jp.co.cyberagent.instant-replay/UniEnc/.source-fingerprint) in the same commit as the binaries, keeping the two in sync.check-native-binaries.ymlruns on PRs that touchpackage.json(i.e. the version-bump PR), recomputes the fingerprint from the current source, and fails if it no longer matches the committed marker — pointing the author to re-run Build unienc.