Skip to content

Detect stale native binaries before release - #162

Draft
ruccho wants to merge 2 commits into
mainfrom
feature/unienc_rebuild_check
Draft

Detect stale native binaries before release#162
ruccho wants to merge 2 commits into
mainfrom
feature/unienc_rebuild_check

Conversation

@ruccho

@ruccho ruccho commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

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 of InstantReplay.Externals/unienc, which transitively covers the Rust source, Cargo.lock, and the submodule pointers (gitlink entries)
  • build-workflow — blob hash of build-unienc.yml (catches build-flag/recipe changes)
  • localize-script — blob hash of the Apple staticlib post-processing script

The fingerprint changes if and only if the native binaries would need rebuilding.

  • build-unienc.yml now 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.yml runs on PRs that touch package.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant