Compilation database references non-existent file
- [X] PlatformIO Core. If you’ve found a bug, please provide an information below.
You can erase any parts of this template not applicable to your Issue.
Configuration
Operating system:
Win10 x64
PlatformIO Version (platformio --version):
PlatformIO Core, version 6.1.4
Description of problem
For an Arduino compatible project, the .ino files are pre-processed into a temporary CPP file. That file is deleted by the PIO build after compilation (there is no flag to keep it: https://community.platformio.org/t/how-to-preserve-keep-temporary-ino-cpp-file/24824)
pio run --target compiledb references this file, which makes the compilation database useless.
Steps to Reproduce
- Create a project with
framework=arduino - Rename main.cpp to project_name.ino (this is the norm for the Arduino IDE)
- Run
pio run --target compiledb
Actual Results
compile_commands.json references a non-existent file: C:\\dev\\compiledb_bug\\src\\compiledb_bug.ino.cpp
Expected Results
compile_commands.json references real files (preferably the original INO files)
If problems with PlatformIO Build System:
The content of platformio.ini:
[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino```