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

Temporary directory doesn't seem to be cleaned after installation / update #340

Closed
AnthonyGrondin opened this issue Sep 5, 2023 · 5 comments · Fixed by #344
Closed

Temporary directory doesn't seem to be cleaned after installation / update #340

AnthonyGrondin opened this issue Sep 5, 2023 · 5 comments · Fixed by #344
Labels
bug Something isn't working

Comments

@AnthonyGrondin
Copy link

Bug description

tempfile doesn't seem to automatically clear the directory it creates after updating or installing the toolchain.
I get a lot of /tmp/.tmpXXXXXX/ directories that are used by espup to store the downloaded assets. Each one is about 1.2Gb, so changing frequently between toolchains can result in a clogged up /tmp/ quite rapidly.

  • Would you like to work on a fix? No

To Reproduce

Steps to reproduce the behavior:

  1. Install any toolchain espup install -v 1.70.0.0
  2. Note the /tmp/.tmpXXXXXX/ it creates, in the logs
  3. Install any other toolchain espup update -v 1.72.0.0
  4. Note the /tmp/.tmpXXXXXX/ it creates, in the logs
  5. Check /tmp/, both folders are still present after installation.

Expected behavior

Directories should be cleaned when the program ends or crash.
See resource leaking in tempfile

Screenshots

N/A

Environment

  • OS: 5.15.109-1-MANJARO
  • espup version: 0.5.0

Additional context

N/A

@AnthonyGrondin AnthonyGrondin added the bug Something isn't working label Sep 5, 2023
@github-project-automation github-project-automation bot moved this to Todo in esp-rs Sep 5, 2023
@SergioGasquez
Copy link
Member

Thanks for reporting the issue! I think I've found the issue, tomorrow I will do some further testing an open a PR for it.

@SergioGasquez SergioGasquez linked a pull request Sep 7, 2023 that will close this issue
@SergioGasquez
Copy link
Member

Hi! Just created #344, do you mind trying the fix proposed in the PR?

cargo uninstall espup
cargo install espup --git https://github.com/SergioGasquez/espup --branch fix/tmp-folders
espup install 

@AnthonyGrondin
Copy link
Author

I can confirm that this fixes my issue.

It will still leave the temporary directory there if the process is interrupted with Ctrl^C , but the main case is fixed.

@SergioGasquez
Copy link
Member

Thanks for the testing!

@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Sep 7, 2023
@AnthonyGrondin
Copy link
Author

Thanks for taking care of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants