Skip to content
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

Delete temporary build directory after compilation #1671

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alranel
Copy link
Member

@alranel alranel commented Feb 21, 2022

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Bug fix (somewhat).

  • What is the current behavior?

The temporary build directory created by arduino-cli compile is not deleted when the process is done. When running many jobs, the impact on free disk space can be visible.

  • What is the new behavior?

The temporary build directory is deleted when compilation is done.

No breaking change.

  • Other information:

See how to contribute

@ubidefeo
Copy link

@alranel
If I'm not wrong this directory is the one containing files used for Language Server and Debugger.
@cmaglie and @silvanocerza can you confirm?

@silvanocerza
Copy link
Contributor

I confirm what @ubidefeo is saying. I don't think we should make this change, all in all I think it has been an improvement.

We could offer a way for user to delete all those temporary folders though. There's already a cache clean command, we could take advantage of it to also delete all arduino-sketch-<md5_hash> in the temp folder.

@PaulStoffregen
Copy link
Sponsor

Perhaps the oldest leftover temporary files could be found and deleted? It could be based on the file age, or space used, or both. A few people might not want any files left over, but probably most people just wish to avoid boundless growth over long term use.

@ubidefeo
Copy link

@silvanocerza @PaulStoffregen
one would assume that an Operating System deleted files in temporary folders every now and then.
I think we could leverage cache clean to do that

@per1234 per1234 added topic: code Related to content of the project itself type: enhancement Proposed improvement labels Feb 23, 2022
@alranel
Copy link
Member Author

alranel commented Feb 23, 2022

Gotcha. I was under the erroneous assumption that everything we store under /tmp are temporary files but I understand we're also storing cache files there. I believe there are more standard places where to store cache files, such as ~/Library/Caches on macOS and ~/.cache on Linux, and there's also a XDG_CACHE_HOME env variable.

Apart from location, maybe using the prefix arduino-cache- in combination with the proposed cache clean command could help.

(Feel free to close this pull request of course)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants