Skip to content

Uninstall does not remove lib binaries #285

Closed
@mastrolinux

Description

@mastrolinux
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 WiFiNINA@1.4.0...
WiFiNINA@1.4.0 already downloaded
Installing WiFiNINA@1.4.0...
Installed WiFiNINA@1.4.0
$ arduino-cli lib uninstall 'WiFiNINA'
Uninstalling WiFiNINA@1.4.0...
$ 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'
WiFiNINA@1.4.0 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

Activity

masci

masci commented on Jul 29, 2019

@masci
Contributor

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

per1234 commented on Jul 30, 2019

@per1234
Contributor

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

masci commented on Jul 30, 2019

@masci
Contributor

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

cmaglie commented on Jul 30, 2019

@cmaglie
Member

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

masci

masci commented on Sep 26, 2019

@masci
Contributor

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.

removed their assignment
on Sep 26, 2019
howjmay

howjmay commented on Jan 8, 2020

@howjmay
Contributor

May I try this issue?

masci

masci commented on Jan 9, 2020

@masci
Contributor

@howjmay yes please!

howjmay

howjmay commented on Jan 17, 2020

@howjmay
Contributor

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

masci commented on Feb 17, 2020

@masci
Contributor

Fix released with 0.8.0, closing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @masci@cmaglie@mastrolinux@per1234@howjmay

        Issue actions

          Uninstall does not remove lib binaries · Issue #285 · arduino/arduino-cli