8000 Stamp the real version into release binaries by adeelahmad · Pull Request #33 · adeelahmad/gadgetcast · GitHub
[go: up one dir, main page]

Skip to content

Stamp the real version into release binaries - #33

Merged
adeelahmad merged 1 commit into
masterfrom
claude/project-thread-65265y
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
masterfrom
claude/project-thread-65265y

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Before: every release binary reports version 0.1.0 (in the startup log, gadgetcast -version, /api/health and the Studio header "Pi v0.1.0"). A QEMU boot of the published v0.1.1 image logged v0.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 report 0.0.0-dev, not a real-looking version.

Why: release.yml passed -X main.version=…, but no main.version exists; the linker silently ignores unknown -X targets, and the version was a const in internal/server.

How: server.Version is now a var stamped by -X github.com/adeelahmad/gadgetcast/internal/server.Version=${VERSION#v}. cmd/gadgetcast/version_test.go builds 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

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
@adeelahmad
adeelahmad merged commit 7fcb7f7 into master Oct 19, 2026
3 checks passed
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.

2 participants

0