Skip to content

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

Closed

Description

@zackees

Summary

pioarduino platform releases that predate the unified ESP32 toolchain, such as 51.03.04 (arduino-esp32 3.0 / IDF 5.1), declare per-MCU toolchains from the PlatformIO registry:

"toolchain-xtensa-esp32s3": { "owner": "espressif", "version": "12.2.0+20230208" },
"toolchain-riscv32-esp":    { "owner": "espressif", "version": "12.2.0+20230208" }

fbuild's ESP32 toolchain resolution only understands the unified metadata-URL scheme (toolchain-xtensa-esp-elf / toolchain-riscv32-esp whose version is a URL). Until now such a pin was never actually built: releases before #1434 ignored platform = pins, and the fix for the resulting 404 falls back to the stable platform with a warning (the PR that fixes the 404).

What honoring these pins would take

  • Resolve owner/tool/name@version through the registry API. https://api.registry.platformio.org/v3/packages/espressif/tool/toolchain-xtensa-esp32s3 lists every version's files per system (linux_x86_64, windows_amd64, darwin_arm64, …) with download_url and sha256.
  • Per-MCU binary prefixes (xtensa-esp32s3-elf-, not xtensa-esp-elf-) and the matching directory layout.
  • GCC 12-era compile/link flag differences against the 3.0 framework.

PlatformIO alias requirement

The selected pioarduino release's platform.json contains valid owner/tool/name@version package aliases. fbuild must resolve those aliases through PlatformIO registry metadata to the host-specific archive URL and checksum, then use the per-MCU compiler and matching build recipe. Falling back to stable or refusing a valid published alias is not completion; fail early only for an unavailable version, unsupported host, or genuinely unsupported package.

Acceptance criteria

  • RED: a focused 51.03.04 resolution/build repro records the current fallback to stable instead of the declared [email protected]+20230208.
  • GREEN: the same valid release resolves and installs the declared per-MCU registry toolchain for the host and builds with its compatible framework/flags, without a stable fallback; verify URL/checksum and log requested versus resolved versions.
  • Invalid or unavailable aliases fail before compilation with a clear diagnostic; no valid pin is treated as implemented merely because it is rejected.
  • Unit tests: use offline registry fixtures for espressif/[email protected]+20230208 and RISC-V companion packages on Linux, Windows, and macOS host selectors. Assert the shared fbuild-core resolver returns the matching host payload URL/checksum and per-MCU prefix, then the ESP32 adapter consumes it without falling back to stable.

Why it matters

FastLED pins 51.03.04 for its "IDF 5.1" coverage boards, and that coverage has silently built against stable the whole time. Honoring the pin would make it real.

🤖 Generated with Claude Code

Core generic-path testing gate

  • RED → GREEN: add an offline fbuild-core test for the exact espressif/tool/[email protected]+20230208 PlatformIO path and its RISC-V companion. Resolve through the same public entry point used by arbitrary owner/type/name paths, without ESP32 dispatch or hard-coded package names.
  • Assert exact version, host-selected PlatformIO URL and SHA-256, stable cache identity, and platform-manifest dependency identity on Linux, Windows, and macOS fixtures. A synthetic valid package path outside the native platform enum must resolve its payload too; unsupported native builds fail only after payload resolution.
  • Keep a separate ESP32 adapter/build test proving it consumes the core result and selects the per-MCU executable prefix and compatible flags, with no stable fallback. The offline core matrix must run in CI without live registry access, PlatformIO installation, or compiler downloads.

Activity

  1. added a commit that references this issue on Sep 18, 2026
  2. zackees commented on Sep 26, 2026

    @zackees
    MemberAuthor

    Testing-criteria clarification: this child’s representative platform fixture must pass through the public, platform-agnostic fbuild-core resolver specified in #1491, then through its native adapter. Assert the exact requested payload/source identities (including host-specific URL and checksum when published), manifest dependency and explicit override precedence, and no substitution by the family default. Core unit tests must also cover synthetic unknown-platform and generic PlatformIO package paths independently of native build support. Keep offline unit tests separate from the actual compile/build integration repro.

  3. zackees commented on Sep 27, 2026

    @zackees
    MemberAuthor

    Local pinned 51.03.04 validation update: the exact PlatformIO registry payload for espressif/[email protected]+20230208 downloads with SHA-256 verification, reports xtensa-esp32s3-elf-gcc 12.2.0, and fbuild install --check recognizes it offline as present. The matching Arduino 3.0.4 framework initially exposed two GCC14-only recipe flags (-mdisable-hardware-atomics and -fuse-cxa-atexit); removing them only for old per-MCU Xtensa toolchains yields a successful local firmware build. This build used an explicit diagnostic esptool override and is NOT yet acceptance: the selected platform pins tool-esptoolpy to https://github.com/pioarduino/esptool/releases/download/v4.7.5/esptool.zip (a Python source archive with runtime dependencies), while fbuild currently substitutes a Tasmota standalone v4.7.5 URL that returns 404. Default install/build remains failing until the pinned esptool package is handled faithfully. Focused offline resolver and GCC12 flag tests pass.

  4. zackees commented on Sep 27, 2026

    @zackees
    MemberAuthor

    Update: PR #1504 now fixes the previously reported esptool blocker as well. It provisions the exact pioarduino v4.7.5 source archive in an isolated uv-managed environment, uses v4-compatible elf2image flags, and fails if a pinned package cannot be provisioned instead of falling back to an arbitrary PATH tool. A cold local build with no override produced firmware.bin using GCC 12.2.0 and Arduino 3.0.4; fbuild install --check reports the pinned toolchain and esptool as present. The existing GCC 14.2.0 ESP32-S3 build also passes. CI is running; issue remains open until PR validation and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions