Skip to content

chore: move git SHA and version out of global defines - #61

Merged
prokrypt merged 1 commit into
developmentfrom
chore/build-info-source
Sep 28, 2026
Merged

prokrypt merged 1 commit into
developmentfrom
chore/build-info-source

Conversation

@prokrypt

Copy link
Copy Markdown
Owner

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.py passes CROSSINK_VERSION, CROSSINK_GIT_SHA and CROSSINK_GIT_DIRTY only to src/util/BuildInfo.cpp through env.AddBuildMiddleware. The script falls back to global defines where middleware is unavailable. AppVersion.h now declares accessors: version(), versionLabel(), userAgent(), gitSha(), gitDirty() and gitDirtyFlag(). Every caller uses them. CROSSINK_PIOENV and CROSSINK_BUILD_ENV stay global.

Sizes vs development 0b1b2ec:

  • default (C3): +126 B flash, RAM +0
  • x4-pro-light-sleep: +272 B flash, RAM +0

The 819 unit tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XgLRarbAmBVepTPKCK7mgd


Generated by Claude Code

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
@prokrypt
prokrypt merged commit e0c27ab into development Sep 28, 2026
9 checks passed
@prokrypt
prokrypt deleted the chore/build-info-source branch September 28, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants