velxio/backend
David Montero dccb70aacd fix(espidf): treat C++ stdlib headers as built-in in user_libs bundler
The user_libs_all bundler in _resolve_library_components does BFS over the
sketch's external includes, copying each matching Arduino library into
one merged IDF component.  Anything not in _BUILTIN_HEADERS is treated as
an external library to resolve, and the lookup just scans
/root/Arduino/libraries/ for a directory whose `src/` (or root) holds a
matching header file.

_BUILTIN_HEADERS only listed C headers (stdint.h, stdio.h, …).  The C++
wrappers (cstdint, cstdio, cmath, …) and the STL containers (vector,
complex, string, …) were absent.  Result: any library transitively
#including <cstdint> or <vector> caused the bundler to "resolve" the
header against /root/Arduino/libraries/ArduinoSTL/ — an AVR-only
uClibc++ port that ships every C++ stdlib header as plain files. Once
ArduinoSTL was matched the bundler dragged in ALL of it, including
complex.cpp:

    template class _UCXXEXPORT complex<float>;

which fails on the ESP-IDF Xtensa toolchain because _UCXXEXPORT isn't
defined in that compile context AND the symbol already exists in the
real libstdc++ pulled in by <complex>.  Net effect: every ESP32 sketch
whose deps transitively include a C++ stdlib header (e.g. ESP32Servo
includes <cstdint>) blew up with 66+ errors before the servo example
even reached the link step.

Fix: extend _BUILTIN_HEADERS to cover the full set of C++ stdlib
wrappers and STL headers so the bundler never treats them as installable
libraries.  The Xtensa GCC + libstdc++ shipped by ESP-IDF provides them
natively; ArduinoSTL never has any business being part of an ESP32 build.

Verified end-to-end on /example/esp32-servo: compile now succeeds, sketch
boots, moving the potentiometer drives the wokwi-servo angle (Pot=2801 →
Angle=123 deg, servo arm rotates).
2026-05-22 18:48:14 +02:00
..
app fix(espidf): treat C++ stdlib headers as built-in in user_libs bundler 2026-05-22 18:48:14 +02:00
scripts
sdk feat(chips): programmable retro CPU chips with external ROM 2026-05-18 23:38:18 -03:00
tests feat(compile): ESP-IDF compile options + request dedup 2026-05-18 21:50:45 -03:00
.env.example chore(oss): drop dead auth/DB dependencies from OSS image 2026-05-14 17:06:27 -03:00
Dockerfile fix(arduino-cli): pin ATTinyCore to 1.4.1 (azduino.com micronucleus host unreachable) 2026-05-22 15:15:53 +02:00
debug_qemu.py
mcp_server.py
mcp_sse_server.py
requirements.txt feat(sim): boot_images module + Pi 3 emulation restored 2026-05-16 05:41:46 +02:00