Skip to content

Sketch source move to build folder bug: file extension changing #1699

Closed
@VNovytskyi

Description

@VNovytskyi

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

  1. Create a new project with files: test.ino, myLib.h, myLib.c
  2. Write wrong code in myLib.c to creating the build error
  3. Try to build the project
  4. Rename myLib.c to myLib.cpp and fix the build error
  5. 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

Metadata

Metadata

Assignees

Labels

conclusion: duplicateHas already been submittedtopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions