Closed
Description
Brief
The problem consists of wrong Arduino CLI builder behaviour. When executing Arduino builder it creates a folder build/sketch/ and copies the source files into it. If we change the file extension the builder doesn't remove the old version of the file and still trying to build your application with the old file.
Steps to reproduce
- Create a new project with files:
test.ino
,myLib.h
,myLib.c
- Write wrong code in
myLib.c
to creating the build error - Try to build the project
- Rename
myLib.c
tomyLib.cpp
and fix the build error - Try to build the project again
Current behaviour
Arduino builder tries to build the project with myLib.c
though myLib.cpp
is in build/sketch/
Expected behaviour
Arduino CLI's builder must detect changing file extension and remove old file myLib.c and use new myLib.cpp
Command
arduino-cli compile --fqbn esp32:esp32:esp32:PSRAM=disabled,PartitionScheme=fatflash,CPUFreq=240,FlashMode=dio,FlashFreq=80,FlashSize=16M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=debug esp-xmodem-lib-file-test --build-path build --build-cache-path build --port COM11 --upload --export-binaries -v
Environment
- Arduino-cli version: 0.21.1 Commit: 9fcbb39 Date: 2022-02-24T15:41:45Z
- Windows 10 Pro 21H1 19043.1586