Uh oh!
There was an error while loading. Please reload this page.
fix(esp32): fingerprint the esptool resolution in the BIN reuse check - #1240
Conversation
Closes#1238 BinArtifactCache gains a serde-defaulted esptool_fingerprint: empty for a provisioned absolute-path esptool (resolution cannot drift, so pre-existing cache records stay valid and caching behaves exactly as before), a short SHA-256 of the caller's PATH for bare-name spawns. Since #1236 the esptool spawn resolves against the per-request caller PATH, so two requests with different caller PATHs can resolve different esptool binaries — they must never share a cached firmware.bin. The shared BUILD_FINGERPRINT_VERSION constant is left untouched: bumping it would invalidate every unrelated cache, and the serde default already yields the correct match semantics. Also adds the end-to-end subprocess test proving run_command resolves a bare executable from an overlay PATH (staged uniquely named probe in a TempDir), that absolute-path spawns work without an overlay, and that the bare name fails without the overlay. 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 Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe change adds backward-compatible esptool fingerprints to BIN cache records. Bare-name resolution fingerprints the caller ChangesEsptool cache fingerprinting
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
🚥 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 |
Closes#1238
What
Since #1236, the ESP32
elf2imageesptool spawn resolves against the per-request caller PATH — butcan_reuse_bin/BinArtifactCacherecorded nothing about which esptool produced the cachedfirmware.bin. Two requests with different caller PATHs can resolve bare-nameesptoolto different binaries (venv vs system, different versions), and the second silently reused the first one's bin. CodeRabbit originally flagged and confirmed this on the superseded PR #1231.How
BinArtifactCachegains#[serde(default)] esptool_fingerprint: String.current_bin_cache, compared by the existing struct equality incan_reuse_bin.BUILD_FINGERPRINT_VERSIONbump: it's shared by unrelated caches, and the serde default already yields correct match semantics (old records deserialize as"", mismatching any caller-PATH fingerprint — invalidation only in the correct direction).run_commandtest CodeRabbit requested on fix(daemon): forward the caller CLI's PATH per request for bare-name tool spawns #1231: a uniquely-named probe executable staged in a TempDir proves bare-name resolution comes from the overlay PATH (and fails without it), while absolute-path spawns are unaffected.RED → GREEN
RED on current main (
exit=101):GREEN after the fix: that test plus
absolute_esptool_bin_reuse_ignores_caller_pathandrun_command_resolves_bare_name_from_overlay_pathall pass.Tests
soldr cargo test -p fbuild-build-engine -p fbuild-core -p fbuild-build-esp— 751 tests, 0 failures.soldr cargo clippy --workspace --all-targets -- -D warningsclean; fmt applied.🤖 Generated with Claude Code
Summary by CodeRabbit