feat(dirty-content-fingerprint): controller/scheduler show fingerprint in --version
controller/main.c and scheduler/src/main.c now compose argp_program_version via a genuinely separate buffer/call to xce_compose_version_ex() (reading STR(VERSION_DIRTY_FINGERPRINT), matching the existing commit_id/build_time macro pattern). The startup-log composition call site -- same function, same arguments, same buffer -- is left completely unchanged in both files. controller/testsuite/test.c (xce_test, confirmed to have no startup log) gets a direct in-place swap. All three files carry explicit comments marking the --version/startup-log divergence as deliberate. Verified independently by review with real builds and live daemon starts: --version shows <commit>-<fingerprint> for all three binaries, matching compile_commands.json; live startup logs for both daemons show the unchanged old <commit>-dirty format with the fingerprint never present. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
7ebcba6d49
commit
fd62e26bce
4 changed files with 49 additions and 8 deletions
|
|
@ -235,6 +235,14 @@ int main(int argc, char* argv[])
|
|||
* it outlives this point in main() (contract documented on
|
||||
* xce_compose_version() in utils.c). */
|
||||
static char version_buf[128];
|
||||
/* dirty-content-fingerprint task 3.2: SEPARATE buffer/composition, used
|
||||
* ONLY for argp_program_version (--version/-V). version_buf above is
|
||||
* left completely untouched -- its own xce_compose_version() call and
|
||||
* the two mutually-exclusive startup INFO log lines reading it (below)
|
||||
* are unaffected by this feature, per Requirement 3.2. This divergence
|
||||
* (the two call sites now showing different strings) is deliberate, not
|
||||
* an oversight. */
|
||||
static char version_display_buf[128];
|
||||
|
||||
memset(&arguments, 0x0, sizeof(arguments));
|
||||
|
||||
|
|
@ -242,7 +250,16 @@ int main(int argc, char* argv[])
|
|||
* pointer when --version/-V is processed. */
|
||||
xce_compose_version(version_buf, sizeof(version_buf), "xce v0.0.0.1-",
|
||||
STR(VERSION_COMMIT_ID), STR(VERSION_BUILD_TIME));
|
||||
argp_program_version = version_buf;
|
||||
/* dirty-content-fingerprint task 3.2: --version-only composition --
|
||||
* appends the dirty_fingerprint suffix (if any) on top of the same
|
||||
* commit/build_time inputs. Do NOT fold this into version_buf above; the
|
||||
* startup INFO log lines must keep showing the original, fingerprint-
|
||||
* less format (Req 3.2). */
|
||||
xce_compose_version_ex(version_display_buf, sizeof(version_display_buf),
|
||||
"xce v0.0.0.1-", STR(VERSION_COMMIT_ID),
|
||||
STR(VERSION_BUILD_TIME),
|
||||
STR(VERSION_DIRTY_FINGERPRINT));
|
||||
argp_program_version = version_display_buf;
|
||||
|
||||
argp_parse(&argp, argc, argv, 0, 0, &arguments);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue