Skip to content

fix(esp): honor or reject IDF framework requests instead of silently building Arduino #1664

Closed

Description

@zackees

Context

During FastLED/FastLED#4773 validation, esp32dev_idf5_component passes with framework=arduino, espidf, but this does not exercise ESP-IDF CMake/component integration.

Verified in two rounds:

  • Exact fbuild tag v2.5.37, commit a03aaa5: crates/fbuild-build-esp/src/esp32/orchestrator/build.rs calls resolve_pioarduino_packages; packages.rs resolves the Arduino-backed Esp32Framework.
  • The staged project preserves the dual framework option, but build metadata identifies fbuild compile_commands.json; compile commands build Arduino cores/esp32/main.cpp, generated sketch src/main.cpp, and native FastLED library objects. No CMake configuration artifacts demonstrate idf_component_register() execution.

FastLED's current ci/boards.py comments describe historical CMake coverage. Its root component CMake contract also requires arduino-esp32, so bare-IDF coverage remains independently unproven. FastLED#3724 was closed but these coverage limitations remain.

Proposal

Make ESP framework selection explicit. Unsupported espidf or dual-framework requests must fail clearly instead of producing an Arduino-only success. Implement genuine component/bare-IDF support separately if required, with actual build-artifact evidence.

Acceptance criteria

  • RED: a project requesting an IDF integration mode currently proceeds through the Arduino-only native build pipeline.
  • GREEN: the requested framework is honored, or a precise unsupported-framework error rejects it before compilation.
  • Metadata records the requested and effective frameworks and integration mode.
  • Claim CMake/IDF coverage only after artifacts prove component registration and intended application entry point.
  • Add regression coverage for both framework=espidf and framework=arduino, espidf; preserve supported Arduino builds.

Decisions

Activity

  1. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Fixed on main — closing with the evidence I re-verified today.

    • 8088892a (PR fix(esp32): reject framework = espidf instead of silently building Arduino (#1664) #1730, fix(esp32): reject framework = espidf instead of silently building Arduino) rejects a bare framework = espidf request before any build work, instead of building it as Arduino and reporting success.
    • crates/fbuild-build-esp/src/esp32/orchestrator/helpers.rs on main now classifies the request (RequestedFrameworks): bare espidf → unsupported-espidf error; arduino, espidf → still builds, labelled as an Arduino-on-IDF build (that is a real Arduino-on-IDF build, not an IDF component build).
    • 0b0053ea (PR feat(esp32): record requested framework and integration mode in the package summary (#1664) #1766) additionally records the requested framework and integration mode in the package summary, so a build's choice is visible after the fact.
    • Test: bare_espidf_framework_is_rejected_before_building (plus the accept-path cases) in crates/fbuild-build-esp/src/esp32/orchestrator/tests.rs.

    Bare-IDF / CMake component builds remain out of scope and are tracked separately in #1761.

    — fbuild steward (automated)

  2. zackees commented on Nov 3, 2026

    @zackees
    MemberAuthor

    Round-1 implementation plan (owner-requested ESP-IDF-only support):

    • Research the pinned PlatformIO espressif32 v6.10.0 SCons builder and framework package, including CMake configuration, generated components and SCons reconstruction of the component graph.
    • Add a separate pure-IDF adapter for ESP32-S3. Keep Arduino and arduino+espidf on the unchanged Arduino adapter. Other bare-IDF MCU requests retain a truthful rejection.
    • Resolve framework-espidf 3.50400.0 and matching GCC 14.2.0+20241119 through the existing registry/mirror/checksummed package cache. Delegate Kconfig, all compilation/linking and image generation to upstream CMake/ninja.
    • Prefer native project CMakeLists.txt/components; generate a build-local main wrapper for a minimal src/app_main project. Seed IDF Kconfig from native defaults/active configuration and the fragment/INI/CONFIG flag overlays; IDF generates the header.
    • Export firmware.elf, firmware.bin, bootloader.bin and partitions.bin plus compile_commands.json, using the existing size reporter. Validate the IDF flash manifest against the existing deployer's offsets; reject unsupported layouts rather than misflash.
    • Add framework-dispatch regression tests and an opt-in real platform build test, then validate, review and leave one PR open and unmerged. Follow-ups cover other Xtensa/RISC-V targets, newer IDF releases, arbitrary flash manifests and wider project configuration.
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