You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(esp32): header farm breaks #include_next headers found beside a quoted include (pioarduino 3.3.x: __assert_func undeclared) #1566
Regression from #1550, found while verifying #1559.
Symptom
On current main, any build on the pioarduino arduino-esp32 3.3.11 framework (IDF 5.5, e.g. tests/platform/esp32s3 -e esp32s3) fails in cores/esp32/esp32-hal-uart.c:
include-farms/<key>/assert.h:45:63: error: implicit declaration of function '__assert_func'
Replaying the same compile with the original SDK -I list, restored from the farm's farm.json, succeeds.
Cause
esp_common/include/esp_assert.h does a quoted#include "assert.h".
In the farm, esp_assert.h and assert.h (from newlib/platform_include) both sit in the merged farm root, so GCC finds assert.hbeside the including file. That is the same file the original -I chain found, so the farm's equivalence check passed.
GCC resolves #include_next differently for a header found via the current-directory rule. The search does not continue after that header's -I dir. It finds the farm's assert.h again, and #pragma once suppresses it.
The toolchain's newlib assert.h is therefore never included, so __assert_func is undeclared.
In the original list, assert.h is not beside esp_assert.h, so it is found via the chain, and #include_next continues past platform_include to the toolchain header.
Earlier layouts (the 2.x SDK and pioarduino 51) did not hit this case.
Fix
A block directory that holds any header containing #include_next is never farmed. It keeps its own -I, in original order, after the farm, so its headers are always reached via the search chain. The farm format version is bumped so existing farms are rebuilt.
Regression test: a quoted include of a sibling that uses #include_next keeps the sibling's directory. End-to-end: tests/platform/esp32s3 -e esp32s3 (3.3.11) builds again.
Activity
fix(esp32): keep #include_next headers out of the header farm (#1567)