Skip to content

Renaming a tab does not remove the file from build cache #970

Closed as not planned
@alranel

Description

@alranel

Describe the problem

When renaming a tab, the old file with its old contents gets still compiled during the build. This leads to unexpected and very confusing compilation results and errors. User has no way to fix the issue apart from locating the build cache directory and clean it up manually.

To reproduce

  1. Create a new sketch and save it.
  2. Create a new tab (call it like foo.c) and put some non-compiling code in it (like Foobar foo;).
  3. Compile the sketch.
  4. Use the "Rename" command to rename the tab to something else (like bar.c).
  5. Replace the content of the tab with some legit code (like #define FOOBAR).
  6. Compile the sketch.

You'll see an error related the bad code you actually deleted (Foobar foo;) located in a file which should not exist anymore (foo.c).
If you locate the temporary build cache directory, you'll see that the old file was not removed.

Expected behavior

After a rename, the old file should be removed from the build directory and not be taken into account for compilation.

Arduino IDE version

Original report

2.0.0-rc6

Last verified with

d24a391

Operating system

macOS

Operating system version

10.15.7

Issue checklist

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions