Repository navigation
fix(esp32): keep #include_next headers out of the header farm - #1567
Conversation
On pioarduino 3.3.x (IDF 5.5) esp_assert.h does `#include "assert.h"`. In the merged farm root newlib's platform_include/assert.h sits beside it, so GCC finds it relative to the includer -- and restarts its `#include_next <assert.h>` from the start of the chain, which lands on the same header again and `#pragma once` drops it. The toolchain assert.h never loads and every TU using assert() fails with `implicit declaration of '__assert_func'`. A block directory holding any `#include_next` header now keeps its own -I (found via the search chain, as before the farm). Format version 2 rebuilds existing farms. Fixes #1566. Part of #1559.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: FastLED/fbuild/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe include farm now keeps a block directory outside the farm when a listed file contains an ChangesInclude farm planning
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change preserves separate include-search positions for headers using Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change keeps headers that depend on include-search order in their original directories and rebuilds incompatible cached farms. It does not appear to broaden which project or toolchain headers a build can reach. Some unusual cache and file-change conditions remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Fixes #1566, a regression from #1550 found while verifying #1559.
Symptom: on current
main, every build on pioarduino arduino-esp32 3.3.11 (IDF 5.5) fails withimplicit declaration of function '__assert_func', e.g.tests/platform/esp32s3 -e esp32s3. Replaying the same compile with the original-Ilist succeeds.Cause:
esp_common/include/esp_assert.hdoes a quoted#include "assert.h". In the merged farm root, newlib'splatform_include/assert.hsits beside it, so GCC finds it relative to the including file. The farm's equivalence check passed because it is the same file the chain found.#include_nextfor a header found that way. The restarted search finds the farm'sassert.hagain, and#pragma oncedrops it, so the toolchain'sassert.hnever loads.-Htraces of both variants: the first divergence is exactly at that#include_next.Fix: a block directory that holds any header containing
#include_nextkeeps its own-I. Its headers are then always reached via the search chain, exactly as without the farm.FORMAT_VERSIONbecomes 2, so existing farms are rebuilt.Test:
include_next_header_beside_a_quoted_includer_keeps_its_directoryfails without the fix (red check done) and passes with it. All 11include_farmtests pass.End-to-end:
tests/platform/esp32s3-I)bench/blinkSummary by CodeRabbit
#include_next, avoiding incorrect header lookup through merged directories.