myxce/.kiro/specs/build-time-versioning
Rongsong Shen 18ae0cc394
feat(build-time-versioning): go_build injects commit/build-time via ldflags
Reads XCE_GIT_COMMIT/XCE_BUILD_TIME from the environment (empty-safe via
[ -z ... ], not just unset-safe -- a classic ${VAR:-default} gotcha
avoided), falls back to "unknown", and appends
-ldflags "-X main.GitCommit=... -X main.BuildTime=..." to the go build
invocation alongside the existing -gcflags.

Confirmed via live testing: -X on a main package var that doesn't exist
yet is silently ignored by the Go linker (not a build error), so this
task has no real ordering dependency on tasks 4.4/4.5 (which add the
consuming vars to apiserver/xcecli).

Task 4.1/13 of build-time-versioning.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-20 12:02:10 +00:00
..
design.md feat(build-time-versioning): nix packages compute build time at build phase 2026-08-20 09:32:34 +00:00
requirements.md docs(build-time-versioning): add spec (requirements, design, research) 2026-08-20 08:29:57 +00:00
research.md feat(build-time-versioning): nix packages compute build time at build phase 2026-08-20 09:32:34 +00:00
spec.json docs(build-time-versioning): add spec (requirements, design, research) 2026-08-20 08:29:57 +00:00
tasks.md feat(build-time-versioning): go_build injects commit/build-time via ldflags 2026-08-20 12:02:10 +00:00