Skip to content

Upstream draft: esp32 build fails on include dirs ESP-IDF declares but never creates (patch 0018) #36

Closed as not planned

Description

@bdbarnett

Overlay patch 0018 (#35) works around a MicroPython esp32 build bug that upstream has too. Below is a draft issue for micropython/micropython, for a maintainer to post or edit; it isn't posted. Our upstream posture is case by case: patch our overlay and draft upstream.


Title: esp32: build fails when a user C module links an IDF component that declares a non-existent include directory

Port, board and/or hardware: esp32, ESP32_GENERIC_S3, ESP-IDF v5.5.4 (fresh clone)

MicroPython version: v1.29.0, and master as of 2026-10-06

Reproduction: build any ESP32-S3 firmware with a user C module that links an ESP-IDF component through target_link_libraries(usermod_x INTERFACE idf::esp_driver_cam) (or idf::esp_lcd), against a fresh clone of ESP-IDF v5.5.4.

Expected: it builds.

Observed: configure fails: Include directory '<IDF>/components/esp_hw_support/mspi_timing_tuning/port/esp32s3/include' is not a directory.

Why: ESP-IDF v5.5.4's esp32s3 mspi_timing_tuning port adds include to its interface include directories, but no files are tracked there, so git never creates the directory. py/usermod.cmake gathers include directories transitively from libraries linked by user modules, so that path lands in MICROPY_INC_USERMOD. ports/esp32/esp32_common.cmake then passes it to idf_component_register(INCLUDE_DIRS ...), which checks that each one exists. A checkout that was once at an older ESP-IDF tag keeps the empty directory and hides the problem.

Fix we carry: in esp32_common.cmake, filter MICROPY_INC_USERMOD to directories that exist (keeping generator expressions) before idf_component_register(). It's patch 0018 in https://github.com/PyDevices/micropython-pydevices/tree/main/patches/micropython.


After posting, add the link here and in the patch header. Drop the patch when upstream fixes it.

Activity

  1. bdbarnett commented on Oct 8, 2026

    @bdbarnett
    ContributorAuthor

    Status 2026-10-08: the draft above is unchanged and still waits for a maintainer to post it to micropython/micropython. Patch 0018 is still in the overlay and still needed: ESP-IDF is pinned at v5.5.4 and MicroPython at v1.29.0.

  2. bdbarnett commented on Oct 9, 2026

    @bdbarnett
    ContributorAuthor

    Closing: the upstream report won't be filed. Patch 0018 stays in the overlay for as long as the pinned MicroPython and ESP-IDF need it, and is re-checked whenever either pin moves.

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions