platformio-core icon indicating copy to clipboard operation
platformio-core copied to clipboard

COMPILATIONDB_INCLUDE_TOOLCHAIN=True skips WiFi

Open sakhnik opened this issue 8 months ago • 2 comments

When I build the default compile db, I've got the following output and WiFi.h gets properly found:

Scanning dependencies...
Dependency Graph
|-- Adafruit NeoPixel @ 1.12.5
|-- arduino-timer @ 3.0.1
|-- WiFi @ 3.2.0

When I add env.Replace(COMPILATIONDB_INCLUDE_TOOLCHAIN=True) to extra_script.py,

Scanning dependencies...
Dependency Graph
|-- Adafruit NeoPixel @ 1.12.5
|-- arduino-timer @ 3.0.1
Warning! `COMPILATIONDB_INCLUDE_TOOLCHAIN` is scoping
Warning! `COMPILATIONDB_INCLUDE_TOOLCHAIN` is scoping

So I can have either WiFi.h found by clangd or <algorithm> but not both. How could I have them both found by clangd?

[env:esp32c3]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
monitor_speed = 115200
extra_scripts = pre:extra_script.py
lib_deps = 
    adafruit/Adafruit NeoPixel@^1.11.0
    contrem/arduino-timer@^3.0.1

sakhnik avatar May 21 '25 04:05 sakhnik

Same issue here, happening with arduino-pico framework.

LukaszMoskala avatar Jun 10 '25 12:06 LukaszMoskala

Okay, by some miracle, I figured this out. Remove the COMPILATIONDB_INCLUDE_TOOLCHAIN option, then add --query-driver=/**/.platformio/**/bin/*-g++,/**/.platformio/**/bin/*-gcc to clangd.

Hopefully it works for you too.

LukaszMoskala avatar Jun 10 '25 15:06 LukaszMoskala