Skip to content

Fix pinned pioarduino 51.x per-MCU toolchains - #1504

Merged
zackees merged 2 commits into
mainfrom
fix/esp32-per-mcu-toolchains-1444
Sep 27, 2026
Merged

zackees merged 2 commits into
mainfrom
fix/esp32-per-mcu-toolchains-1444

Conversation

@zackees

@zackees zackees commented Sep 27, 2026

Copy link
Copy Markdown
Member

Closes #1444. Part of #1491.

Resolve old pioarduino per-MCU Xtensa/RISC-V toolchains through the generic PlatformIO registry resolver, selecting the exact host archive and SHA-256 from the pinned owner/name/version instead of falling back to stable. Adapt GCC 12 flags for the Arduino 3.0 framework. Provision pioarduino’s pinned esptool 4.7.5 source archive in an isolated uv-managed tool environment rather than substituting a nonexistent Tasmota binary; use its v4 elf2image flags. A failed pinned tool install is now fatal, not a PATH fallback.

Validation: offline core registry tests (10), fbuild-library unit tests (257), fbuild-build-esp unit tests (120 before rebase, 123 after), fbuild-toolchain unit tests (153 passed, 1 pre-existing ignored), affected-crate Clippy with -D warnings, and cold local ESP32-S3 pinned build (GCC 12.2.0, firmware.bin produced) without overrides. Existing modern ESP32-S3/GCC 14.2.0 build still passes. Both builds rerun after rebasing onto current main. fbuild install --check reports the exact pinned toolchain and esptool packages as present.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: FastLED/fbuild/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 9ce80ff6-0103-4e48-9339-c5f2befb5633

📥 Commits

Reviewing files that changed from the base of the PR and between f2819cd and 2dcd0b5.

📒 Files selected for processing (10)
  • crates/fbuild-build-esp/src/esp32/esp32_linker.rs
  • crates/fbuild-build-esp/src/esp32/mcu_config.rs
  • crates/fbuild-build-esp/src/esp32/orchestrator/build.rs
  • crates/fbuild-build-esp/src/esp32/orchestrator/packages.rs
  • crates/fbuild-core/src/platformio_package.rs
  • crates/fbuild-core/tests/platformio_package_resolution.rs
  • crates/fbuild-library/src/library/esp32_platform.rs
  • crates/fbuild-library/src/library/esptool.rs
  • crates/fbuild-toolchain/src/toolchain/esp32.rs
  • tests/platform/esp32s3/platformio.ini

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

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees merged commit f2e2415 into main Sep 27, 2026
18 checks passed
@zackees
zackees deleted the fix/esp32-per-mcu-toolchains-1444 branch September 27, 2026 02:02
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 27, 2026
zackees added a commit that referenced this pull request Oct 2, 2026
…ino 53.x/54.x (#1605)

* fix(esp32): resolve unified toolchain by registry version for pioarduino 53.x/54.x

pioarduino 53.x/54.x platform.json names the unified
toolchain-xtensa-esp-elf by a PlatformIO registry version
(platformio/[email protected]+20241119), not a metadata
URL. #1504 treated 'no metadata URL' as 'per-MCU package' and looked up
toolchain-xtensa-<mcu>, which those releases do not declare, so every
ESP32 Xtensa build pinned to 53.x/54.x failed with
"package 'toolchain-xtensa-esp32s3' not found in platform.json".

Select the per-MCU name only when the platform omits the unified entry.

Co-Authored-By: Claude <[email protected]>

* fix(esp32): drop -fuse-cxa-atexit for every pre-GCC 14 toolchain

pioarduino 53.x pairs GCC 13.2 unified toolchains with an SDK that, like
51.x, does not define __dso_handle. The flag was only dropped for per-MCU
Xtensa packages, so once 53.x resolved its toolchain (previous commit)
esp32dev and esp32c3 failed to link with undefined __dso_handle.

Co-Authored-By: Claude <[email protected]>

* fix(esp32): prefer a declared per-MCU toolchain over the unified one

Review follow-up: official PlatformIO espressif32 6.x/7.x declares both
per-MCU GCC 8.4 toolchains and toolchain-xtensa-esp-elf, and its Arduino
builds use the per-MCU package. Preferring the unified entry would have
moved those builds to GCC 14 and skipped the legacy_gcc8 recipe.

Co-Authored-By: Claude <[email protected]>

* refactor(esp32): apply toolchain and SDK fixups as pure config -> config rules

Replace the in-place `Esp32McuConfig::adapt_to_toolchain` and
`disable_lto` mutators with a `fixups` module of side-effect-free rules.
Each rule (drop -fuse-cxa-atexit before GCC 14, drop the atomics switch on
per-MCU Xtensa, the GCC 8 linker recipe, language standards, and LTO
removal) is a named `Esp32McuConfig -> Esp32McuConfig` function, and the
orchestrator applies the composed fixup once per input:

    let mcu_config = fixups::for_toolchain(mcu_config, &toolchain_info);
    let mcu_config = fixups::for_sdk_ld_flags(mcu_config, &sdk_ld_flags);

Also replace the boolean-flag `selected_toolchain_name(mcu, unified)` with
`per_mcu_toolchain_name(mcu) -> Option<String>`, so `toolchain_name_for`
reads as "the declared per-MCU package, else the unified one".

Behaviour is unchanged.

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
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.

ESP32: provision per-MCU registry toolchains so pre-unified platform pins (pioarduino 51.x) actually build against their pin

1 participant