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> |
||
|---|---|---|
| .. | ||
| settings | ||
| specs | ||
| steering | ||