Skip to content

Uninstall does not remove lib binaries #285

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
mastrolinux opened this issue Jul 17, 2019 · 9 comments
Closed

Uninstall does not remove lib binaries #285

mastrolinux opened this issue Jul 17, 2019 · 9 comments

Comments

@mastrolinux
Copy link
Contributor

Bug Report

Lib uninstall should not only remove libs from the index but also remove the corresponding binary in .arduino15/staging/libraries/ or at least have an option to avoid removing the lib binary. Default behaviour should be to remove the bin too.

Current behavior

$ arduino-cli lib install 'WiFiNINA'
Downloading [email protected]...
[email protected] already downloaded
Installing [email protected]...
Installed [email protected]
$ arduino-cli lib uninstall 'WiFiNINA'
Uninstalling [email protected]...
$ ls -l ~/.arduino15/staging/libraries/
total 232
-rw-r--r-- 1 luca luca  83192 Jul 15 14:49 WiFiNINA-1.4.0.zip
$ arduino-cli lib download 'WiFiNINA'
[email protected] already downloaded

Expected behavior

Uninstall should remove the lib file

Environment

  • CLI version (output of arduino-cli version): arduino-cli Version: 0.3.7-alpha.preview Commit: BuildDate: 2019-07-17 10:37:06.0191213 +0000 UTC
  • Go version (if building from sources): 1.12
  • OS version: Windows 10, Windows WSL
@masci
Copy link
Contributor

masci commented Jul 29, 2019

Proposal:

  • rename any reference to staging as cache so it's more clear for the user what that directory tree contains
  • provide a set of cache subcommands the user can run to free up some space when needed, something on the lines of arduino-cli cache clean

@per1234
Copy link
Contributor

per1234 commented Jul 30, 2019

I think it's a reasonable proposal, but there are a couple of things that should be considered:


Since arduino/Arduino#9023, there is already a .arduino15/cache file in use by the Arduino IDE to store the cached Boards and Library Manager index files. The folder structure currently looks something like this:

.arduino15
|_cache
   |_arduino.esp8266.com
   |_downloads.arduino.cc
   |_raw.githubusercontent.com
   |_cache.json

So it might make sense to move the existing contents of the cache folder to a dedicated subfolder (something like .arduino15/cache/indexes), like what is currently done with libraries and packages in the staging folder. This will keep the folder organized nicely and prevent any chance of unwanted interactions between the different uses of the cache folder:

.arduino15
|_cache
   |_indexes
   |_libraries
   |_packages

The .arduino15/staging folder has been in use since Arduino IDE 1.6.4 so it's possible that changing the folder name might cause breakage of 3rd party applications. I don't have any evidence that anything is reliant on that specific path and can't think of a hypothetical case other than maybe some users having a custom script that clears it from time to time so likely this is a non-issue.


The library binaries in .arduino15/staging/libraries are unlikely to take up a significant amount of disk space, but the .arduino15/staging/packages folder can get pretty huge!

@masci
Copy link
Contributor

masci commented Jul 30, 2019

Thanks @per1234 for the insights, I think there's enough to rethink my approach, I'd rather avoid messing with folder names if this means breaking the old IDE, specially now that development iterations on the CLI are so fast we've no chance to keep up with the IDE.

Another option would be keep going with the staging terminology (albeit in all honesty the name is puzzling) and still give users the opportunity to clean libraries and packages with explicit commands like staging clean.

@mastrolinux thoughts?

@cmaglie
Copy link
Member

cmaglie commented Jul 30, 2019

We can still use cache clean (or whatever) on the command line but keep staging as the internal folder name.

@masci
Copy link
Contributor

masci commented Sep 26, 2019

In case somebody wants to contribute, to sum up the discussion what's need to be done here is a new cache clean command that would wipe the contents of the .arduino15/staging folder.

@masci masci removed their assignment Sep 26, 2019
@howjmay
Copy link
Contributor

howjmay commented Jan 8, 2020

May I try this issue?

@masci
Copy link
Contributor

masci commented Jan 9, 2020

@howjmay yes please!

@howjmay
Copy link
Contributor

howjmay commented Jan 17, 2020

I currently remove the default path of the caching file, but I think I may need a way out to remove caching file in other user-assigned path.
In order to do this, I think I may need to declare one more global variable to record the path of the caching file. I am still thinking if there is any other way out.

@masci
Copy link
Contributor

masci commented Feb 17, 2020

Fix released with 0.8.0, closing...

@masci masci closed this as completed Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants