From a860141bb9de0b6d383ef3421247a3e2d5ecad10 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Fri, 21 Aug 2026 03:54:37 +0000 Subject: [PATCH] feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define Adds a dirty_fingerprint string meson option (default '') alongside the already-shipped build-time-versioning feature's commit_id/build_time options, and threads it through add_project_arguments() as VERSION_DIRTY_FINGERPRINT for every C component. Purely additive, non-behavioral plumbing -- nothing consumes the new define yet. Verified independently by review: a bare meson setup with zero -D options configures cleanly, and all 542 C compile commands carry the new (empty) define, matching the existing commit_id/build_time defines' counts exactly. Co-Authored-By: Claude Sonnet 5 --- .kiro/specs/dirty-content-fingerprint/tasks.md | 7 +++---- src/meson.build | 3 ++- src/meson.options | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.kiro/specs/dirty-content-fingerprint/tasks.md b/.kiro/specs/dirty-content-fingerprint/tasks.md index f6af5212..6b06d808 100644 --- a/.kiro/specs/dirty-content-fingerprint/tasks.md +++ b/.kiro/specs/dirty-content-fingerprint/tasks.md @@ -1,9 +1,8 @@ # Implementation Plan -- [ ] 1. Foundation: dirty_fingerprint meson option and C-wide define - - Add a `dirty_fingerprint` meson option (string, default `''`) alongside the existing `commit_id`/`build_time` options in `src/meson.options` - - Extend `src/meson.build`'s existing `add_project_arguments()` call to also define `VERSION_DIRTY_FINGERPRINT` for every C component, mirroring `VERSION_COMMIT_ID`/`VERSION_BUILD_TIME` - - Observable: a plain `meson setup` with the option unset still configures successfully (the define resolves to empty string, no build failure) +- [x] 1. Foundation: dirty_fingerprint meson option and C-wide define + - `dirty_fingerprint` meson option (string, default `''`) added in `src/meson.options`, byte-for-byte matching `commit_id`/`build_time`'s style/type/yield; `add_project_arguments()` extended with `-DVERSION_DIRTY_FINGERPRINT=` + - Observable confirmed live (independently re-verified by review, fresh scratch build): a bare `meson setup` with zero `-D` options configures cleanly (73 targets); all 542 C compile commands contain the new define (empty string), matching the existing two defines' counts exactly; no consumption code touched yet - _Requirements: 1.1, 5.1_ - [ ] 2. Foundation: compute real fingerprint values at both build entry points diff --git a/src/meson.build b/src/meson.build index 17b05ee8..cca71ad8 100644 --- a/src/meson.build +++ b/src/meson.build @@ -28,7 +28,8 @@ if get_option('buildtype') == 'debug' endif add_project_arguments(['-DVERSION_COMMIT_ID='+get_option('commit_id'), - '-DVERSION_BUILD_TIME='+get_option('build_time')], language: 'c') + '-DVERSION_BUILD_TIME='+get_option('build_time'), + '-DVERSION_DIRTY_FINGERPRINT='+get_option('dirty_fingerprint')], language: 'c') # Programs needed by all components go_compiler = find_program('go') diff --git a/src/meson.options b/src/meson.options index a59b0234..ba1bd525 100644 --- a/src/meson.options +++ b/src/meson.options @@ -1,6 +1,7 @@ option('with_debug', type: 'boolean', value: false, yield: true) option('commit_id', type: 'string', value:'', yield: true) option('build_time', type: 'string', value:'', yield: true) +option('dirty_fingerprint', type: 'string', value:'', yield: true) option('component', type: 'combo', choices: ['all', 'xcecore', 'xcecli'], value: 'all',