Add build info to firmware and CLI, bump version to 0.2.0 #3

Merged
selu merged 3 commits from esp-idf-5.5.6 into master 2026-10-28 15:11:03 +00:00
Owner

Adds build info to the firmware and the irbt CLI and bumps the version to 0.2.0 (tagged v0.2.0).

What's new

  • Git commit in the version. Versions now read 0.2.0 (v0.2.0 2026-10-28), following the format of rustc -V. Untagged commits show as v0.2.0-1-gabc1234, -dirty marks uncommitted changes, and unknown is shown when built outside git.
  • irbt status now shows the firmware's commit, its rustc (esp toolchain), the ESP-IDF version read at runtime, and the versions of esp-idf-svc/-hal/-sys, esp32-nimble and embassy-time. With --json, these appear under a new "build" key.
  • irbt -V shows the CLI's commit, and irbt --version adds rustc, the protocol version and the versions of key dependencies.

How

  • A new build-info crate is used as a build-dependency by the firmware and the CLI. It embeds git describe + the commit date, $RUSTC -V and selected Cargo.lock versions at compile time. It reruns when HEAD, the index, refs (including refs/tags) or the sources change.
  • Protocol: a new Command::GetBuildInfo / Reply::BuildInfo pair is appended at the end of the enums. Existing encodings don't change, so PROTOCOL_VERSION stays at 1, and a golden test pins the new command's encoding. DeviceInfo.firmware_version now includes the commit, so older CLIs see it too.
  • Older firmware drops requests it can't decode, so the CLI only asks for build info when the firmware version contains a commit. This avoids waiting for a timeout.

Testing

  • cargo test --workspace and clippy (-D warnings) pass on the host workspace and the firmware. The firmware release build passes.
  • I checked the embedded strings in the firmware ELF and the output of irbt -V / --version.
  • Not yet tested on hardware: irbt status against a flashed board.

🤖 Generated with Claude Code

Adds build info to the firmware and the `irbt` CLI and bumps the version to 0.2.0 (tagged `v0.2.0`). ## What's new - **Git commit in the version.** Versions now read `0.2.0 (v0.2.0 2026-10-28)`, following the format of `rustc -V`. Untagged commits show as `v0.2.0-1-gabc1234`, `-dirty` marks uncommitted changes, and `unknown` is shown when built outside git. - **`irbt status`** now shows the firmware's commit, its rustc (esp toolchain), the ESP-IDF version read at runtime, and the versions of `esp-idf-svc`/`-hal`/`-sys`, `esp32-nimble` and `embassy-time`. With `--json`, these appear under a new `"build"` key. - **`irbt -V`** shows the CLI's commit, and **`irbt --version`** adds rustc, the protocol version and the versions of key dependencies. ## How - A new `build-info` crate is used as a build-dependency by the firmware and the CLI. It embeds `git describe` + the commit date, `$RUSTC -V` and selected `Cargo.lock` versions at compile time. It reruns when HEAD, the index, refs (including `refs/tags`) or the sources change. - **Protocol:** a new `Command::GetBuildInfo` / `Reply::BuildInfo` pair is appended at the end of the enums. Existing encodings don't change, so `PROTOCOL_VERSION` stays at 1, and a golden test pins the new command's encoding. `DeviceInfo.firmware_version` now includes the commit, so older CLIs see it too. - Older firmware drops requests it can't decode, so the CLI only asks for build info when the firmware version contains a commit. This avoids waiting for a timeout. ## Testing - `cargo test --workspace` and clippy (`-D warnings`) pass on the host workspace and the firmware. The firmware release build passes. - I checked the embedded strings in the firmware ELF and the output of `irbt -V` / `--version`. - Not yet tested on hardware: `irbt status` against a flashed board. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A new build-info build-dependency embeds `git describe` + commit date,
the rustc version and selected Cargo.lock versions at compile time.

The firmware version now reads like `0.1.0 (c7f30e8 2026-10-28)`, and a
new GetBuildInfo command returns the commit, rustc, the runtime ESP-IDF
version and the esp-idf-*/esp32-nimble/embassy-time versions. Appending
the command and reply keeps the wire format compatible, so
PROTOCOL_VERSION stays at 1. `irbt status` shows the build info, and
skips the request for firmware whose version has no commit (older
firmware drops unknown requests). `irbt -V` shows the CLI's commit, and
`--version` adds the toolchain and dependency versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rerun the build-info script when tags change
Some checks failed
Continuous Integration / Firmware (pull_request) Failing after 3s
Continuous Integration / Firmware-2 (pull_request) Failing after 45s
Continuous Integration / Firmware-1 (pull_request) Failing after 1m53s
Continuous Integration / Host tools (pull_request) Failing after 3s
Continuous Integration / Host tools-1 (pull_request) Failing after 3s
Continuous Integration / Host tools-2 (pull_request) Failing after 3s
eb2b5623fe
`git describe --tags` output depends on tags, but only HEAD, the index,
packed-refs and the branch ref were watched, so a new tag on an
already-built commit wasn't picked up. Also watch refs/tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
selu merged commit cd337ffd48 into master 2026-10-28 15:11:03 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
selu/ir-bt-bridge!3
No description provided.