velxio/backend/app
David Montero 0c65de16ad espidf: preprocessor-aware include scanning (root cause of foreign libraries in user_libs_all)
Reported 2026-08-03: every ESP32 build in a user's project failed with
errors from libraries he never installed, emitted from user_libs_all --
a folder his file list does not even show, in projects he had recreated
from scratch.

Root cause: _detect_external_includes was a bare regex with no
preprocessor state. ESPAsyncWebServer guards <Hash.h> behind
'#if defined(ESP8266) || defined(TARGET_RP2040)', so the compiler never
sees it on ESP32 -- but the scanner reported it anyway. The resolver
then searched the ~1000 shared-cache libraries, matched stemi-hexapod's
src/Hash.h (a hexapod-robot library), merged it WHOLE, and compiled all
of its sources; each failed on its own unrelated includes.

The scanner now tracks #if/#ifdef/#ifndef/#elif/#else/#endif nesting and
strips comments. A branch is skipped ONLY when every identifier in its
condition is a platform macro known to be undefined on ESP32; unknown
macros keep the branch LIVE, because hiding a genuinely needed header
would be a much worse failure than the old over-reporting. Verified
against the real ESPAsyncWebServer shape plus nesting/elif/else/comment
cases (9 new tests, 15 green in the espidf suites).

Complements the platform-header guard from the previous commit, which
stays as defence in depth.
2026-08-04 05:45:24 +02:00
..
api compile: thread initiated_by through CompileRequest and metrics extras 2026-07-31 20:22:29 +02:00
core feat(opencore): extract Pico W WiFi to a pluggable PIO peripheral seam 2026-06-15 08:33:28 +02:00
database refactor(oss-split): remove auth/DB/admin stack from OSS 2026-05-14 13:36:31 -03:00
mcp
…
models refactor(oss-split): remove auth/DB/admin stack from OSS 2026-05-14 13:36:31 -03:00
schemas refactor(oss-split): remove auth/DB/admin stack from OSS 2026-05-14 13:36:31 -03:00
services espidf: preprocessor-aware include scanning (root cause of foreign libraries in user_libs_all) 2026-08-04 05:45:24 +02:00
utils refactor(oss-split): remove auth/DB/admin stack from OSS 2026-05-14 13:36:31 -03:00
__init__.py
…
main.py feat(flash): write compiled sketches to real USB boards (phases D1+D3) 2026-05-27 00:20:20 -03:00