Repository navigation
Stamp the real version into release binaries - #33
Merged
Merged
Conversation
release.yml passed -X main.version, a symbol that does not exist, so the linker ignored it and every release reported the hardcoded 0.1.0 (found by QEMU-booting the v0.1.1 image: it logged v0.1.0). server.Version is now a var stamped by release.yml; unstamped builds say 0.0.0-dev. A test builds the binary with the release's -X flag and checks -version. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K4B4YKMC6fT9oWCCwWgt9S
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.
Before: every release binary reports version 0.1.0 (in the startup log,
gadgetcast -version,/api/healthand the Studio header "Pi v0.1.0"). A QEMU boot of the published v0.1.1 image loggedv0.1.0 listening on https://:443, and its binary is byte-identical to the v0.1.1 release asset.After: release binaries report their tag (v0.1.2 →
0.1.2). Builds without a stamp report0.0.0-dev, not a real-looking version.Why:
release.ymlpassed-X main.version=…, but nomain.versionexists; the linker silently ignores unknown-Xtargets, and the version was a const ininternal/server.How:
server.Versionis now avarstamped by-X github.com/adeelahmad/gadgetcast/internal/server.Version=${VERSION#v}.cmd/gadgetcast/version_test.gobuilds the binary with that same flag and checks-version(failed with "0.1.0" before the fix). The install/update path is unaffected: it tracks versions in its own VERSION file.Generated by Claude Code