Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
alranel opened this issue Apr 26, 2022 · 4 comments
Closed
3 tasks done

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

alranel opened this issue Apr 26, 2022 · 4 comments
Assignees
Labels
conclusion: duplicate Has already been submitted conclusion: off topic Off topic for this repository topic: CLI Related to Arduino CLI type: imperfection Perceived defect in any part of project

Comments

@alranel
Copy link
Contributor

alranel commented Apr 26, 2022

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
@alranel alranel added the type: imperfection Perceived defect in any part of project label Apr 26, 2022
@per1234
Copy link
Contributor

per1234 commented Apr 26, 2022

Thanks for taking the time to submit an issue @alranel .

I see we have another report about this at arduino/arduino-cli#1240.

It is best to have only a single issue per subject so we can consolidate all relevant discussion to one place, so I'll go ahead and close this in favor of the other.

If you end up with additional information to share, feel free to comment in the other thread.

@per1234 per1234 closed this as completed Apr 26, 2022
@per1234 per1234 added conclusion: duplicate Has already been submitted topic: CLI Related to Arduino CLI labels Apr 26, 2022
@per1234 per1234 self-assigned this Apr 26, 2022
@alranel
Copy link
Contributor Author

alranel commented Apr 29, 2022

Thank you @per1234. That's the upstream issue and it's good to link it but I recommend to keep this one open as well because it ends up being a bug of a feature of the IDE as well. If we close it here it can't be attached to any milestone in the IDE project, and this is a pretty severe bug that in my opinion blocks the release of IDE 2.0 stable, or at least should be evaluated for that milestone

@alranel alranel reopened this May 7, 2022
@davegarthsimpson
Copy link
Contributor

Hi @per1234 what's the status on this one?

@per1234
Copy link
Contributor

per1234 commented Nov 15, 2022

@davegarthsimpson same status as it has been for the last 6 years: unresolved.

In order to resolve it, the following things must be done:

  1. Fix Previous file persists in build folder after renaming non-.ino sketch code file arduino-cli#1240
  2. Create a new release of Arduino CLI
  3. Bump Arduino IDE's Arduino CLI dependency to the version that contains the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted conclusion: off topic Off topic for this repository topic: CLI Related to Arduino CLI type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants