Skip to content

compilation database not reliable between cores #3182

Description

@UltraBlackLinux

Describe the problem

Hey there,

I've just run into quite annoying issue with the compilation database trying to compile an example sketch for the ESP32-C6:

Image

If I open that file the error turns into a 'freertos/FreeRTOS.h' file not found error although that might just be caused by the directory switch and therefore missing compile-commands.json.

Edit: A seemingly related issue:
Image

Edit 2: Even more surprisingly, My editor thinkgs the Zigbee.h header is unused and instead tried to import ZigbeeDimmableLight.h which now causes the build to fail, as the arduino-cli can't find that header. The compilation database is basically unusable as-is...

Other cores like the official Arduino core or MiniCore work completely fine. The Esp32 core instead is fighting me quite hard.

Any idea what's wrong?

Thanks!

To reproduce

  1. obtain https://raw.githubusercontent.com/espressif/arduino-esp32/refs/heads/master/libraries/Zigbee/examples/Zigbee_Dimmable_Light/Zigbee_Dimmable_Light.ino
  2. arduino-cli compile . -b esp32:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed --build-path build && cp build/compile-commands.json .
  3. open the code file in your favourite editor using the clangd LSP

Expected behavior

It should be able to find all used libraries like with the Arduino and MiniCore cores

Arduino CLI version

arduino-cli Version: 1.4.1 Commit: e394193

Operating system

Linux

Operating system version

Endeavour OS, linux on 7.0.3-zen1-2-zen

Additional context

Can't try the nightly build because git clone times out and the nightly builds webpage returns a bad gateway error.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions