Repository navigation
Description
Context
Filed from FastLED #2700 — fbuild needs to own ESP toolchain/package resolution end-to-end so ESP32-S3/ESP32-P4/etc. builds never require hardcoded local PlatformIO package paths or a PlatformIO fallback.
Failure modes observed
-
fbuild surface error is opaque. While building
examples/AutoResearch/AutoResearch.inowithbash compile esp32s3 --examples AutoResearch(FastLED side), fbuild's streaming build path failed with:error: daemon error: stream error: error decoding response bodyThe user-facing error gives no clue what actually failed (
crates/fbuild-cli/src/daemon_client.rs:516). This needs to surface the underlying daemon-side error (the daemon must serialize a usable final event before the stream closes — even on a crash path). -
PlatformIO-fallback path also stalls. A temporary PlatformIO fallback ran into pioarduino
[email protected]'splatform.jsonrequiring[email protected]+20241119even for an ESP32-S3 build. PlatformIO then stalled atDownloading 0%. The machine already had a usable local RISC-V toolchain at<HOME>/.platformio/packages/toolchain-riscv32-espwith package metadata for14.2.0+20251107and a.piopmURI, but PlatformIO refused to reuse it. (FastLED policy is that fbuild should be the exclusive board-build path; this point just illustrates why the PlatformIO escape hatch isn't viable.) -
fbuild currently only resolves the MCU-primary toolchain.
crates/fbuild-build/src/esp32/orchestrator/packages.rs::resolve_pioarduino_packagescallsget_toolchain_metadata_url(is_riscv)which returns exactly one oftoolchain-riscv32-esportoolchain-xtensa-esp-elf. The pioarduinoplatform.jsonlists multiple toolchain packages in itspackagessection (Xtensa + RISC-V for ULP helper, etc.); fbuild skips the secondary ones. If a real build ever needs the secondary toolchain, fbuild won't provision it and won't even diagnose its absence.
Acceptance criteria
Mirrors FastLED #2700:
bash compile esp32s3 --examples AutoResearch(and equivalent direct fbuild invocations) succeeds through fbuild without--platformio,--no-filter, or generatedplatform_packagespath overrides.bash autoresearch esp32s3 --lcd …builds/deploys through fbuild only.- No generated config needs user-specific paths such as
C:/Users/<user>/.platformio/packages/toolchain-riscv32-esp. - fbuild reports a clear actionable error when a required ESP toolchain is missing or incompatible, instead of failing as
stream error: error decoding response body. - Regression coverage covers ESP32-S3 with a cached
pioarduino/platform-espressif32and the RISC-V helper toolchain requirement.
Proposed scope
- Better diagnostics on the streaming build path. Make
build_streamingdecode a finalOperationResponse(or equivalent error envelope) even on the failure path, so users get an actionable message instead ofstream error: error decoding response body. Daemon side: ensure a terminal event is always sent (and flushed) before the stream is closed. - Audit pioarduino
platform.jsonpackage consumption. Enumerate thepackagessection and provision every package referenced by the orchestrator's build (toolchains, frameworks, helper toolchains), not just the MCU-primary toolchain. - Version-compatibility policy. Decide whether fbuild should:
- (a) accept a newer cached toolchain (e.g.
14.2.0+20251107whenplatform.jsonasks for14.2.0+20241119), or - (b) always provision the exact manifest version into its own cache.
Document and test the choice.
- (a) accept a newer cached toolchain (e.g.
- Tests.
- Unit test: feeding a real pioarduino
platform.json(54.03.20) intoEsp32Platform::get_package_urlreturns the RISC-V helper toolchain URL for ESP32-S3. - Integration: a
tests/platform/esp32s3build that usesplatform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.20/platform-espressif32.zip(not the stockplatform = espressif32) succeeds end-to-end.
- Unit test: feeding a real pioarduino
Related
- FastLED #2700 (this issue's parent)
- FastLED #2507 (prior ESP32-P4 autoresearch fbuild failure)
- fbuild#378 (ESP32-C2 skeleton install — same orchestrator/packages area)
- fbuild#380 (route ESP32-S3 writes through esptool — landed in 2.2.17)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
chore(deps): bump fbuild 2.2.28 -> 2.3.0 for daemon serial WS batching (
fix(teensy4/autoresearch): honest FlexPWM RX + wrapper deadline + wat…