chore: move git SHA and version out of global defines - #61
Merged
Merged
Conversation
The git SHA, dirty flag and version were global defines, so every commit changed every compile command and forced a full rebuild. They now reach only src/util/BuildInfo.cpp, which exposes them through AppVersion::. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XgLRarbAmBVepTPKCK7mgd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: every commit changed the global CROSSINK_GIT_SHA/CROSSINK_GIT_DIRTY defines, so every source file recompiled after each commit (about 11 min on 4 cores).
After: a new commit recompiles only
src/util/BuildInfo.cpp(47 s incremental on the C3).How:
scripts/git_branch.pypasses CROSSINK_VERSION, CROSSINK_GIT_SHA and CROSSINK_GIT_DIRTY only tosrc/util/BuildInfo.cppthroughenv.AddBuildMiddleware. The script falls back to global defines where middleware is unavailable.AppVersion.hnow declares accessors:version(),versionLabel(),userAgent(),gitSha(),gitDirty()andgitDirtyFlag(). Every caller uses them. CROSSINK_PIOENV and CROSSINK_BUILD_ENV stay global.Sizes vs development 0b1b2ec:
The 819 unit tests pass.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XgLRarbAmBVepTPKCK7mgd
Generated by Claude Code