One build path: extract the cross-compile into a shared action - #8
Merged
Conversation
CI ran scripts/cli_build.sh -- one host binary, no version stamped in. release.yml cross-compiled six targets inline with its own loop. Only the CI path ran on a pull request, so a break in any of the other five -- a build tag, a platform-specific import, a syscall that does not exist on windows -- surfaced first at release time, on the one build nobody is watching. Both now call .github/actions/build. A pull request builds exactly what a release builds; the only difference is the version stamped in, and that one of them goes on to publish. Build runs before Test in release.yml too, matching CI and every other workflow in the organisation. scripts/cli_build.sh stays. It is the fast host build for the person at the terminal, and it is no longer what CI checks. Verified locally: all six targets compile and archive, the extracted Linux binary reports `gdam 1.2.3` when built with that version, and windows/arm64 -- a target CI never checked -- cross-compiles clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The first run of this action failed with "built binary does not report 'dev'", and the check was wrong rather than the binary. main.go falls back to the module version in its build info when nothing was stamped -- the `version == "dev"` branch at main.go:37 -- so in a git checkout the toolchain's VCS pseudo-version is what comes out. A pull request legitimately reports `gdam v0.0.8-0.20260802025843-da3ac2fda354`, never the literal "dev". A requested version is still asserted exactly, because that is what a release depends on. The default path asserts the shape instead: the binary named itself and reported something. This is the same mistake the ormos build action already documents, and carrying that comment across is the point of writing it down. Verified locally on both paths: VERSION=1.2.3 reports `gdam 1.2.3`, and VERSION=dev reports the pseudo-version and passes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Closes the gap left open in the CI standardization PR, which fixed the test duplication and noted this one.
The problem
scripts/cli_build.sh— one host binary, no version stamped in.Only the CI path ran on a pull request. So a break in any of the other five — a build tag, a platform-specific import, a syscall that doesn't exist on windows — surfaced first at release time, on the one build nobody is watching.
The fix
Both call
.github/actions/build. A pull request builds exactly what a release builds; the only difference is the version stamped in, and that one goes on to publish.Buildalso runs beforeTestinrelease.ymlnow, matching CI and every other workflow in the org.scripts/cli_build.shstays — it's the fast host build for the person at the terminal, and it's no longer what CI checks.Verified locally
linux/darwin/windows × amd64/arm64)Linux_x86_64binary reportsgdam 1.2.3when built with that versionwindows/arm64cross-compiles clean — a target CI has never checked until nowFollow-up to the Phase 5 standardization.