Uh oh!
There was an error while loading. Please reload this page.
fix(deploy): probe-rs spawns via run_command_blocking — no console flash, 120s timeout - #938
Conversation
…TE_NO_WINDOW + timeout) `run_probe_rs_download` / `run_probe_rs_reset` used raw `std::process::Command::output()`. The daemon is windowless on Windows, so each probe-rs invocation allocated a fresh console — a visible console window flashed on the user's screen for the duration of every SWD flash. Route both through `fbuild_core::subprocess::run_command_blocking`, which is the blessed wrapper (`ban_raw_subprocess` dylint) and already sets `CREATE_NO_WINDOW` on Windows, strips MSYS env vars, and applies a timeout. New `PROBE_RS_TIMEOUT` = 120 s: a healthy LPC845-BRK flash completes in ~2 s; past 120 s the probe is wedged and the deploy should fail with captured stderr instead of holding the daemon's spawn_blocking slot forever. Why the dylint didn't catch this at merge time: the Dylint CI workflow has been failing on main at the driver-build step (dylint::library_packages::build_library), so the gate was not enforcing when #935 landed. Separate issue to follow for the CI infra fix. Refs: #935, #936 (probe-rs SWD dispatch), #264 (ban_raw_subprocess). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRefactors probe_rs.rs to replace direct std::process::Command usage with the run_command_blocking helper, adding a 120-second PROBE_RS_TIMEOUT constant. Both run_probe_rs_download and run_probe_rs_reset now build ProbeRsRun directly from the helper's exit_code, stdout, and stderr fields. ChangesProbe-rs subprocess timeout migration
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant ProbeRsModule as run_probe_rs_download/run_probe_rs_reset
participant Subprocess as run_command_blocking
Caller->>ProbeRsModule: invoke probe-rs command
ProbeRsModule->>Subprocess: run_command_blocking(argv_refs, Some(PROBE_RS_TIMEOUT))
Subprocess-->>ProbeRsModule: exit_code, stdout, stderr
ProbeRsModule-->>Caller: ProbeRsRun
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Uh oh!
There was an error while loading. Please reload this page.
Problem
run_probe_rs_download/run_probe_rs_reset(crates/fbuild-deploy/src/probe_rs.rs) spawned probe-rs with rawstd::process::Command::output(). The daemon is windowless on Windows, so every SWD flash allocated a fresh console for the console-subsystemprobe-rs.exe— a visible console window flashed on the user's screen during each deploy. Observed live on an LPC845-BRK deploy today.Two additional gaps from bypassing the blessed wrapper:
spawn_blockingslot forever.Fix
Route both wrappers through
fbuild_core::subprocess::run_command_blocking— the house-standard spawn path (ban_raw_subprocessdylint) that already setsCREATE_NO_WINDOW(0x08000000) on Windows, strips MSYS env vars, and applies a timeout. NewPROBE_RS_TIMEOUT = 120 s: a healthy LPC845-BRK flash completes in ~2 s; past 120 s the probe is wedged and the deploy fails with the captured stderr instead of hanging.ToolOutput {stdout, stderr, exit_code}maps 1:1 ontoProbeRsRun, so callers are unchanged.Why the dylint didn't catch this
ban_raw_subprocesscovers exactly this pattern andprobe_rs.rsis not allowlisted — but the Dylint CI workflow has been failing on main at the driver-build step (dylint::library_packages::build_library, toolchain-alias retry exhaustion) for at least the last 5 runs. Red gate = zero enforcement, and #935 merged through the gap. Filing the CI-infra issue separately; this PR just removes the violation.Validation
soldr cargo check -p fbuild-deploy— clean.fbuild deploy -e lpc845via the FastLED autoresearch harness: flash completes (~2 s SWD via probe-rs), VCOM reopens immediately, freshly-flashed firmware answers JSON-RPC. Console-flash absence verified visually on a post-fix deploy.Refs: #935, #936 (probe-rs SWD dispatch), #264 (
ban_raw_subprocess).🤖 Generated with Claude Code
Summary by CodeRabbit
probe-rsactions by enforcing a timeout, helping prevent commands from hanging indefinitely.