Skip to content

release: check that each NIF loads, and publish the sources of the tag - #101

Merged
rubas-agent[bot] merged 4 commits into
mainfrom
release-pipeline
Nov 12, 2026
Merged

rubas-agent[bot] merged 4 commits into
mainfrom
release-pipeline

Conversation

@rubas-agent

@rubas-agent rubas-agent Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Before

The Publish to Hex job publishes the tree of the checksum merge, and stops when lib/, native/, or mix.exs differ from the tag:

      - name: Compare the package sources with the tag
        run: git diff --exit-code --stat "$TAG" HEAD -- lib native mix.exs

The bundle check of the release build runs ldd for missing libraries, and on macOS it checks the install names, but neither checks the symbols. The checksum task reads the version from the metadata of the last compile, in ~/.cache/rustler_precompiled/metadata, which every checkout shares.

Problem

Any merge to lib/, native/, or mix.exs between the version bump and the checksum PR stops the publish job, and the version can then never publish. A change to another packaged file, such as README.md, ships unnoticed. A NIF with an undefined symbol gets a tag, a GitHub release, and a Hex version: the aarch64 NIF of whisper_ct2 0.7.1 does exactly that today (rubas/whisper_ct2#99).

After

Before After
Package sources tree of the checksum merge, stops on a change after the tag tag vX.Y.Z and the checksum file of the merge
NIF with an undefined symbol released build fails, no tag
Checksum merge while another run waits a newer push cancels its run, no publish runs in turn
Checksum refresh metadata of any checkout task checksum:download compiles first, with the metadata in _build

The same change for the other repos: rubas/cloaked_req#92, rubas/kagi_ex#54, rubas/whisper_cpp#90, rubas/whisper_ct2#100.

Details

The publish job came with #98. It now checks out the tag and takes only the checksum file from the merge, as whisper_ct2 does, so the source comparison goes. A change after the tag ships with the next version. The bundle check runs ldd -r on Linux and nm -m -u on macOS. Both bind every symbol, as the BEAM's RTLD_NOW load does, and the check allows only enif_*, which the BEAM defines.

The concurrency group now has queue: max. With the default single slot, a newer push cancels the pending run, and only the run of the checksum merge publishes.

A publish job that fails through a bug in the job itself cannot re-run with the fixed workflow file, because only a change of the checksum file starts it. We add no dispatch input for that: a cause in the tag needs a new version anyway, a bug in the job is covered by a patch release or an owner's mix hex.publish of the tag, and the case has not happened.

Checks: zizmor pedantic is clean. A harness ran the new check on the released 0.7.0 NIFs, on the release runners with the codec libraries: all three pass, and a test NIF that misses MKL_Free_Buffers fails on each runner (https://github.com/rubas/whisper_cpp/actions/runs/43276300228). The publish steps ran on epyc against v0.7.0: the tree differs from the tag only in the checksum file, and the checksum file equals SHA256SUMS. The load step fails there, because epyc lacks libvpx.so.9, which shows that it stops the job.

The bundle check binds every symbol of the NIF and fails on one that no library defines. The publish job checks out the tag and takes the checksum file of the merge, so a change after the tag no longer stops the release.
mix rustler_precompiled.download reads the version from the metadata of the last compile, in a user cache that every checkout shares.
With one pending slot, a newer push cancels the pending run of the checksum merge, and only that run publishes.
rustler_precompiled writes the metadata before the source build, so a compile in another checkout could change it while the build runs.
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