myxce/.kiro/specs/build-time-versioning
Rongsong Shen 48a86cdab6
feat(build-time-versioning): version macro/helper functions with unknown fallback
Adds xce_version_field()/xce_compose_version() (utils.h/utils.c) to
compose a version string carrying commit id + build time, rendering
"unknown" for either field when its underlying meson-supplied define is
empty -- ready for controller/scheduler/worker to consume.

MK_VERSION/STR (the pre-existing, compile-time-only macro pair) can't
express this empty-to-"unknown" substitution at the preprocessor level,
so this is a runtime mechanism instead. Round 1 review REJECTED an
earlier version of this task for silently orphaning MK_VERSION/STR
(the task explicitly asked to "extend" them) and for leaving an
undocumented architectural trap: argp_program_version is a file-scope
const char* initialized at compile time, which cannot call a runtime
function -- consuming code must instead compute into a static buffer
inside main() and assign the pointer before argp_parse() runs. Round 2
adds an explicit SUPERSEDED doc comment on MK_VERSION/STR plus NOTE FOR
CALLERS guidance covering both points, and was APPROVED.

Also expands task 3.2's boundary to include controller/testsuite/test.c
(a third MK_VERSION/STR call site discovered during review) so no
caller of the superseded macro survives implementation.

5 new unit tests in test_utils.c (RED->GREEN, TDD).

Task 3.1/13 of build-time-versioning.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-20 10:16:17 +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): version macro/helper functions with unknown fallback 2026-08-20 10:16:17 +00:00