Skip to content

feat(version): stamp the git build id into fbuild and fbuild-daemon (#1742 follow-up 1) - #1769

Merged
zackees merged 2 commits into
mainfrom
agent/dev-build-id
Oct 28, 2026
Merged

zackees merged 2 commits into
mainfrom
agent/dev-build-id

Conversation

@zackees

@zackees zackees commented Oct 28, 2026

Copy link
Copy Markdown
Member

Why

Two builds of the same workspace version were indistinguishable (#1742). An
editable install that kept yesterday's fbuild/fbuild-daemon printed the same
2.5.46 as a fresh one, so a feature that had already landed looked missing and
the blame landed on fbuild instead of on the stale binary. The same ambiguity
made fbuild daemon status useless for "is this daemon from my checkout?"
(#1739).

This implements follow-up 1 from #1742: embed a build id (git HEAD + dirty flag)
in the CLI and the daemon, and show it in fbuild --version and
fbuild daemon status.

What

  • crates/fbuild-core/build.rs (new) stamps FBUILD_BUILD_COMMIT
    (git rev-parse --short=12 HEAD) and FBUILD_BUILD_DIRTY
    (git status --porcelain --untracked-files=no). The probe is best-effort: no
    git, no .git, or a non-repository source tree degrades the stamp to
    unknown and never fails a build. cargo:rerun-if-changed on
    .git/HEAD/.git/index is what makes the stamp follow the checkout; a changed
    rustc-env value recompiles fbuild-core and relinks its dependents.
  • fbuild-core::build_id is the single reader: COMMIT, dirty(),
    build_id() (5fca4d49c9ab, 5fca4d49c9ab-dirty, or unknown),
    long_version() (2.5.47+git.5fca4d49c9ab-dirty). fbuild-core carries the
    stamp for the whole workspace, so the CLI and the daemon agree without a
    second git probe per binary.
  • fbuild --version now prints the long form via clap long_version;
    fbuild -V still prints the bare workspace version, so scripts that parse it
    are unaffected. The build id is valid semver build metadata.
  • fbuild daemon status / fbuild daemon list gained a Build: line from
    the new build_id field on /health and /api/daemon/info. When the daemon's
    build differs from the CLI's, both are named; a daemon that predates this
    change says so instead of printing a blank.
  • No fingerprint, cache key, or endpoint derivation changed: this is purely
    diagnostic surface.

Tests

build_id.rs (6) and cli::daemon_cmd::build_id_tests (3) are unit-tested pure
formatters: clean vs dirty id, unstamped builds reporting unknown even when
dirty, the long version staying version-parseable, and the three Build: label
cases (match / differ / pre-#1742 daemon). RED-first: with the dirty suffix
disabled, dirty_build_id_says_so fails with left: "5fca4d49c9ab" vs
right: "5fca4d49c9ab-dirty".

Closes follow-up 1 of #1742 (the uv cache-key mitigation already landed in #1741).

Two builds of the same workspace version were indistinguishable (#1742):
an editable install that kept yesterday's binaries printed the same
version as a fresh one, and a daemon left running from an older checkout
looked current. Implement follow-up 1 of #1742.

fbuild-core gains a build script that stamps FBUILD_BUILD_COMMIT
(git rev-parse --short=12 HEAD) and FBUILD_BUILD_DIRTY (tracked-file
status), plus a build_id module that reads them. Because every
version-reporting crate depends on fbuild-core, one probe keeps the CLI
and the daemon agreeing instead of duplicating git logic per binary. The
probe is best-effort: no git or no .git degrades the stamp to "unknown"
and never fails a build.

Surfaced as:
- fbuild --version: 2.5.47+git.5fca4d49135b[-dirty] (clap long_version;
  -V still prints the bare version, and the id is semver build metadata)
- fbuild daemon status / daemon list: a Build: line, from the new
  build_id field on /health and /api/daemon/info. A differing daemon
  names both builds; a pre-#1742 daemon says so instead of printing blank.

No fingerprint, cache key or endpoint derivation changed; this is
diagnostic surface only.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The nested HealthResponse/DaemonInfoResponse literals grew by one line in
handlers/health.rs, and the inventory records line numbers.
@zackees
zackees added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit e5ebdc3 Oct 28, 2026
27 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant