Skip to content

fix: retry benchmark cold builds, unify tracing/log for per-crate clippy, sync uv.lock - #2059

Merged
zackees merged 3 commits into
mainfrom
feat/bench-framework-mirror
Nov 17, 2026
Merged

zackees merged 3 commits into
mainfrom
feat/bench-framework-mirror

Conversation

@zackees

@zackees zackees commented Nov 17, 2026

Copy link
Copy Markdown
Member

An automation asked to "reproduce the build error and fix it" without saying which build. I ran every repo gate. Plain cargo check, CI, and the windows-msvc cross-clippy were green on main bf798aa8. Three real failures turned up, one commit each.

1. Benchmark run failed: no retry on PlatformIO/fbuild cold builds

Failure. Benchmark run 44094404157 on bf798aa8 failed after 105 minutes:

build comparison benchmark failed: command failed with exit status: 1: "pio" "run" "--project-dir" ".../bench/blink" "--environment" "esp32s3"

The benchmark log artifact shows the cause. One TCP reset hit PlatformIO's 347 MB esp32-core-3.3.12-libs.tar.xz download on the 10 Mbit/s shaped link:

Tool Manager: Error: Please read https://bit.ly/package-manager-ioerror
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(27078920 bytes read, 320157164 more expected)', ...)

The same run had already survived a connection reset by peer during arduino-cli core install. That install has been retried since 8943ee9. The PlatformIO and fbuild cold builds download their packages inside the timed build, and they got only one attempt.

Fix. timed_cold_build retries timed_build up to COLD_INSTALL_ATTEMPTS times for PlatformIO and fbuild.

  • The retries happen inside the timer, as for the Arduino install, so a retry can only make that tool's cold time look worse.
  • Arduino's compile downloads nothing, so it keeps one attempt.
  • retry is now generic over its return value.
  • measure_tool carries #[expect(too_many_lines)], so its call site only swaps the function name and the function does not grow.

Tests. Two new tests, written RED first: retry_returns_the_successful_attempts_value and every_downloading_cold_build_is_retried.

I did not re-run the 10 Mbit/s benchmark locally. It needs the CI network namespace and takes about 100 minutes. The next scheduled or push run is the end-to-end check.

2. Per-crate clippy fails for 14 of 21 workspace members

Failure. On clean main, soldr cargo clippy -p <crate> --all-targets -- -D warnings exited 101 for 14 crates: fbuild-config, -paths, -serial, -build, -build-engine, -build-esp, -build-arm, -build-mcu, -deploy, -python, -test-support, -header-scan, -library-select and bench-fastled-examples.

error: this lint expectation is unfulfilled
   --> crates/fbuild-core/src/usb/data.rs:193:10
193 | #[expect(clippy::cognitive_complexity, reason = "baseline, zackees/ci.yml#229")]

Once that error was cleared, the same problem showed in crates/fbuild-packages-fetch/src/disk_cache/gc.rs:49 and downloader.rs:624.

This is the command that uv run --script lint <file.rs> runs, and so does the PostToolUse lint hook (ci/hooks/lint.py). Editing any file in those crates therefore failed the hook. The workspace-wide lint and CI stayed green, which hid it.

Root cause.

  • axum's default tower-log feature turns on tracing/log, but only in graphs that contain axum: fbuild-daemon, fbuild-cli, and fbuild-core's dev-dependencies.
  • tracing/log adds branches to every tracing::*! expansion, and clippy counts them toward cognitive_complexity.
  • The workspace lint therefore sees these functions over 25. A per-crate build without axum sees them under 25, so the #[expect] is unfulfilled.

Fix. Enable tracing's log feature at the workspace dependency, so every graph expands the macros the same way.

  • Cargo.lock is unchanged.
  • fbuild-cli and fbuild-daemon already ship with this feature on.
  • fbuild-python installs no log logger and no global tracing dispatcher, so its events go to log's no-op default.

I first tried extracting a helper from try_install_online_cache. With log on, the macros alone still score 31/25, so a refactor cannot fix this. I reverted it.

3. Stale uv.lock

195f5e9 bumped pyproject.toml to 2.5.52 but left uv.lock at 2.5.51.

  • uv lock --check exits 1 on main.
  • Every uv run in the project rewrites uv.lock and dirties the tree, and ci/local_gate.py then refuses to run.

The fix is a one-line lock sync.

Gates, before and after

Gate main bf798aa this branch
Benchmark workflow (run 44094404157) failure (transient download, no retry) not re-run (needs CI netns)
soldr cargo clippy -p <each of 21 members> --all-targets -- -D warnings 14 × exit 101 21 × exit 0
uv run --script lint crates/fbuild-config/src/lib.rs (single-file / hook) fails (same clippy -p) exit 0
uv lock --check exit 1 exit 0
uv run --script lint (fmt + workspace clippy + dylint) exit 0 exit 0
bash test — exit 0, 4548 passed / 0 failed
soldr cargo clippy --workspace --all-targets --target x86_64-pc-windows-msvc -- -D warnings exit 0 exit 0
CI Python self-tests (LOCAL_UNITTEST_MODULES, with local_gate.py's deps) pass pass

The bash test "before" cell is blank because I first ran it with the bench change already applied. On main alone it would have run 2 fewer tests.

Not reproducible here

  • macOS targets: not installed locally. CI covers them.
  • The 10 Mbit/s benchmark: see section 1.
  • bash lint --cpp: lint is a uv run --script Python entry point. It has no --cpp mode, and bash lint is not how it runs.

🤖 Generated with Claude Code

zackees and others added 3 commits November 17, 2026 07:25
195f5e9 bumped pyproject.toml to 2.5.52 but left uv.lock at 2.5.51, so
`uv lock --check` fails on main and every `uv run` in the project
rewrites uv.lock, dirtying the tree (which ci/local_gate.py then refuses
to run on).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…load failures

Benchmark run 44094404157 failed after 105 minutes because one TCP reset
broke PlatformIO's 347 MB esp32-core-libs download on the shaped
10 Mbit/s link (ChunkedEncodingError / IncompleteRead). Arduino CLI's
cold install has been retried since 8943ee9, but the PlatformIO and
fbuild cold builds, which download their packages inside the timed
build, got a single attempt.

Retry them up to COLD_INSTALL_ATTEMPTS times inside the timer, like the
Arduino install, so a retry can only make that tool's cold time look
worse. Arduino's compile downloads nothing and keeps one attempt.
timed_cold_build takes timed_build's arguments so measure_tool (which
carries a too_many_lines expect) does not grow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hes the workspace

axum's default tower-log feature turns on tracing/log, but only in graphs
that contain axum (fbuild-daemon, fbuild-cli, and fbuild-core's
dev-dependencies). tracing/log adds branches to every tracing::*! macro
expansion, which clippy counts toward cognitive_complexity. The
workspace lint therefore measured
crates/fbuild-core/src/usb/data.rs:193 (try_install_online_cache) over
25, and its #[expect(clippy::cognitive_complexity)] held. A per-crate run
measured it under 25, so the expectation was unfulfilled. The same
applied to crates/fbuild-packages-fetch/src/disk_cache/gc.rs:49 and
downloader.rs:624.

On main, `soldr cargo clippy -p <crate> --all-targets -- -D warnings`
failed with 'this lint expectation is unfulfilled' for 14 of 21 workspace
members. The single-file lint mode and the PostToolUse lint hook both
run that command, so editing any file in those crates failed the hook.

Turning the feature on at the workspace dependency gives every graph the
same expansion. fbuild-cli and fbuild-daemon already ship with it on.
fbuild-python installs no log logger and no global tracing dispatcher,
so its events go to the log facade's no-op default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 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

@zackees
zackees added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit dc7d6ce Nov 17, 2026
31 checks passed
zackees added a commit that referenced this pull request Nov 18, 2026
Brings #2051 (reroot relative spelling), #2057 (rp2040 large future),
#2058 (respell has_root / native tool spelling / renesas OnceCell), #2059
(bench framework + tracing feature) and #2063/#2067. Only conflict was
fbuild-toolchain esp32.rs test fixture, resolved to main's #2058 native-spelling
semantics (explicit native_name let-binding).
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 18, 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