Library Manager RC9.x Updateable list

Sorry in advance as much of this has probably been covered before.

But I am curious about how the current RCs and how the Library Manager, update code decides on which libraries to update and what constraints it uses on doing this. I am curious as it is showing a ton of libraries need updating. And I have been bit in the past.

Sorry I know that is not a very clear question, so maybe better if I describe a few usages patterns.

a) I used library manager to install the library, and I have not mucked with the library at all. Assume if updates are available, then it shows up in list.

b) Installed by Board Manager, in the hardware... area for libraries. I assume these are not updated by library manager?

c) I install library some other way? zip file or the like. Assume it is not touched?

Now the more interesting cases:

d) I used library manager - And I modified the library manually? Does it check anything before it blindly updates?

d1) Library manager downloaded. Found bugs, download github project to make updates or are in the process of making updates. WIll it replace my github project?

d2) Like d1) except I download github to different directory (d:\github...) and then make a link to it in the /project (mklink /j ...) Again will it try to update. If so, will it remove the junction and update in the arduino library folder or will it update the github code.

e) I had a lot of libraries installed, my Arduino15 directory appeared to be corrupted (earlier when ESP32 specific install caused IDE2 not to start). So I deleted the Arduino15 and created a new one. So most of the libraries installed were orphaned. Will it only try to update those libraries that were installed after that, or will it try to update others?

Probably enough for now.

And again sorry if all of this has been asked before. I decided to post as to maybe then try to fill in some of these blanks myself.

Thanks
Kurt

P.S. - Still wish there was a described way to delete installed libraries. For example, maybe I downloaded the Adafruit ADXL343 library to help out someone on PJRC forum who was having issues. But when I was done with it, maybe I simply want to remove it.

I also would like to see some answers to @KurtE 's questions posted above.

I have libraries which I specifically added changes to to suit some of my special needs. Now the new update facility wants to update them - I will lose my changes if it does while they work fine as is.

Also there are some libraries we do not want to update since the latest update causes incompatibility issues.

I really would like an option to not display the update notification when starting the IDE.

The new added facilities when opening the library manager is great and, for me, sufficient. I would not like to accidently hit the wrong option in the update notification.

The first thing I should make clear is that the Library Manager and Boards Manager update capability was added in Arduino IDE 2.0.0-rc9.3. So this is the reason why you may now suddenly be finding that a lot of libraries or boards platforms are updatable. They were updatable even before, but previous versions of Arduino IDE 2.x had no mechanism for notifying the user about this so updates were only done by manually going through the libraries in Library Manager and installing a newer version.

Correct.

Correct.

If the library is listed in Library Manager then it will be updatable via Library Manager regardless of how it was installed.

There is no mechanism for the IDE to determine how a library was installed. Manually installed libraries and Library Manager installed libraries are all just folders together under the libraries subfolder of the sketchbook.

Library Manager always installs the library to a folder named according to the name value specified in the library.properties metadata file of the library. This means that if you made a manual installation of a library to a folder matching that name, then the Library Manager update will overwrite the manually installed library. If you made a manual installation to a folder with a different name, then that folder will be left alone and a new folder will be added with the updated version, leaving you with two installations of the library.

For example, let's say you have manually installed a library with the following in its library.properties file:

name=Foo Bar
version=1.0.0

If a library named "Foo Bar" is in the Arduino Library Manager index and a new version (e.g., 2.0.0) is available from the index, Library Manager will offer an update.

If you manually installed this library like so:

<sketchbook folder>/
โ””โ”€โ”€ libraries/
    โ””โ”€โ”€ FooBar-main/

Then after the Library Manager update you will have this:

<sketchbook folder>/
โ””โ”€โ”€ libraries/
    โ”œโ”€โ”€ FooBar-main/
    โ””โ”€โ”€ Foo_Bar/
  • <sketchbook folder>/libraries/FooBar-main/ - contains the manually installed "Foo Bar"@1.0.0
  • <sketchbook folder>/libraries/Foo_Bar/ - contains the Library Manager installed "Foo Bar"@2.0.0

If you manually installed this library like so:

<sketchbook folder>/
โ””โ”€โ”€ libraries/
    โ””โ”€โ”€ Foo_Bar/

Then after the Library Manager update you will have this:

<sketchbook folder>/
โ””โ”€โ”€ libraries/
    โ””โ”€โ”€ Foo_Bar/
  • <sketchbook folder>/libraries/Foo_Bar/ - contains the Library Manager installed "Foo Bar"@2.0.0

No

Yes

I don't know. Give it a try and let us know what you find.

It is not clear to me what you mean by "orphaned".

Actions taken on the Arduino15 folder don't have any effect on the Library Manager. Library Manager works exclusively on the libraries in the libraries subfolder of the sketchbook. It does not recognize libraries from any other location. It never installs libraries to any other location. It never updates libraries from any other location.

Thanks for asking.

We have actually been discussing some of this within the Arduino Tooling Team over the last couple of days.

I have been preparing a couple of reports about this and will link those here as soon as I have finished.

Your wish is granted!

The libraries that are installed have an "INSTALLED" label in Library Manager. If you hover the mouse pointer over that label, it turns into an "UNINSTALL" button. Click that and the library will be deleted.

The need to improve this impossible to find and unintuitive UI is tracked here:

There is a known defect with this system related to the subject of manual installations. If the library was installed to a folder that doesn't follow the standard Library Manager naming system, you will get an error message when you attempt to uninstall:

Library <library name> is not installed

(where <library name> is the name of the library you attempted to uninstall)

That defect is being tracked here:

As long as the library is installed under its standardized folder name, the uninstall capability works fine. So it is already fully functional for libraries installed via Library Manager.

There is already one in the advanced settings:

  1. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
  2. Select the "Preferences: Open Settings (UI)" command from the menu.
  3. A "Preferences" tab will now open. Type arduino.checkForUpdates in the "Search Settings" field.
  4. Uncheck the box under the "Check For Updates" setting.
  5. Click the X icon on the "Preferences" tab to close it.
1 Like

Thanks for the clarifications.

Feels like it is working differently than what at least used to happen with Arduino 1.x
But who knows maybe that changed a while ago as well.

I know some things have changed like I used to get libraries installed with names like:

Where the highlighted one is: Adafruit_BusIO

I also remember reading a few years or more ago, about once you install a library you could not get rid of it. That the list of installed libraries was stored in some binary file or the like.

But that is probably several versions ago.

Thanks again

I think the way Arduino IDE 1.x does library installations is something like this:

  1. Library archive is downloaded to Arduino15/staging/libraries
  2. Library archive is extracted to a folder with a randomized name like arduino_139918 under <sketchbook folder>/libraries
  3. If the target library installation location already exists, it is deleted
  4. The extraction folder is renamed to the target library installation folder name

So if something went wrong during steps 3 or 4, you ended up with the library installation under this randomized folder name, with either another copy of the library under the expected folder, or else with an empty folder there.

Steps 3 or 4 could fail if there was a lock on a file or folder from the target folder due to having it open in another application. It might also be caused by antivirus software's "on-access"/"real--time" scanning interfering with the process.

Arduino CLI/Arduino IDE 2.x have a similar process, but there is a cleanup mechanism for the extraction folder.

For example:

$ tree -A -F -L 2 ~/Documents/Arduino/libraries/
C:/Users/per/Documents/Arduino/libraries/
โ””โ”€โ”€ Arduino_SigFox_for_MKRFox1200/
    โ”œโ”€โ”€ examples/
    โ”œโ”€โ”€ keywords.txt
    โ”œโ”€โ”€ library.properties
    โ””โ”€โ”€ src/

3 directories, 2 files

Now if I open the C:/Users/per/Documents/Arduino/libraries/Arduino_SigFox_for_MKRFox1200 folder and then try to upgrade the library, I get this:

$ arduino-cli lib upgrade "Arduino SigFox for MKRFox1200"
Downloading Arduino SigFox for MKRFox1200@1.0.4...
Arduino SigFox for MKRFox1200@1.0.4 already downloaded
Installing Arduino SigFox for MKRFox1200@1.0.4...
Replacing Arduino_SigFox_for_MKRFox1200@1.0.3 with Arduino SigFox for MKRFox1200@1.0.4...
Error upgrading libraries: Library install failed: moving extracted archive to destination dir: rename C:\Users\per\Documents\Arduino\libraries\package-1013994826\Arduino_SigFox_for_MKRFox1200-1.0.4 C:\Users\per\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200: Access is denied.

$ tree -A -F -L 2 ~/Documents/Arduino/libraries/
C:/Users/per/Documents/Arduino/libraries/
โ””โ”€โ”€ Arduino_SigFox_for_MKRFox1200/

1 directory, 0 files

Notice that, although the extraction was done at C:\Users\per\Documents\Arduino\libraries\package-1013994826\Arduino_SigFox_for_MKRFox1200-1.0.4, that folder was not left behind after the failed upgrade. I am left only with an empty folder where ""Arduino SigFox for MKRFox1200"@1.0.3 was previously installed.

If I try the same with Arduino IDE 1.8.19, I am left with this instead:

$ tree -A -F -L 2 ~/Documents/Arduino/libraries/
C:/Users/per/Documents/Arduino/libraries/
โ”œโ”€โ”€ Arduino_SigFox_for_MKRFox1200/
โ””โ”€โ”€ arduino_389810/
    โ”œโ”€โ”€ examples/
    โ”œโ”€โ”€ keywords.txt
    โ”œโ”€โ”€ library.properties
    โ””โ”€โ”€ src/

4 directories, 2 files

Unlike Arduino IDE 2.x, Arduino IDE 1.x does not provide any interface for uninstalling libraries:

No, nothing like that. The GUI simply doesn't provide the capability. You could always manually delete the library folder if you wanted to remove it.

Maybe Teensyduino works differently. I actually don't have a lot of knowledge about the differences between Teensyduino and Arduino IDE 1.x.

1 Like

I have now published the reports:

This is all in terms of Arduino CLI (since that is the origin of the defects). I'll provide a demo of the issue using the Arduino IDE interface in case that makes it easier to understand for those who are more familiar with the IDE than Arduino CLI:

  1. Download the ZIP file of an outdated version of the "Arduino SigFox for MKRFox1200" library: https://github.com/arduino-libraries/SigFox/archive/refs/tags/1.0.3.zip
  2. Select Sketch > Include Library > Add ZIP Library... from the Arduino IDE menus.
  3. Select the downloaded file (SigFox-1.0.3.zip).
  4. Click the Open button.
  5. Use the Arduino IDE Library Manager to install the latest version of the "Arduino SigFox for MKRFox1200" library.
  6. Select File > Quit from the Arduino IDE menus.
  7. Start the Arduino IDE.
  8. Click the INSTALL MANUALLY button on the "Updates are available for some of your libraries." notification.

:bug: The "Arduino SigFox for MKRFox1200" library is shown as updatable, even though you just installed the latest version via Library Manager.

  1. Hover the mouse pointer over the "Arduino SigFox for MKRFox1200" library entry in Library Manager.
  2. Click the "INSTALL" button

:bug: The "Output" view says "Already installed Arduino SigFox for MKRFox1200@1.0.4", but Library Manager continues to show that the library is updatable and that 1.0.3 is installed.

1 Like

@ptillisch thanks for that. I suspected something might be available in the advanced settings but where amongst the multitude of available option to find it. Now disabled.

You are welcome.

There are an overwhelming number of settings in this advanced settings interface. I most often use a default-ish configuration of the Arduino IDE since that is what the average user will have, but I configure VS Code as I like and I remember it was quite a project working through all the settings when I first migrated from using Notepad++ to VS Code as my general purpose text editor.

If you are ever looking for an Arduino-specific setting such as Library Manager updates, use the sidebar to navigate to the Extensions > Arduino section of the settings (the Arduino IDE is implemented as an extension installed in an Eclipse Theia application). All the Arduino-specific settings are found there, so this reduces the number of settings to search through.

@ptillisch Thanks for the advice.

Something a bit unrelated. Quite a long time ago I mentioned that the "hover: delay" is not sticking when changed - it only persist for the current session while the new value is actually retained, needing a reset before changing again.

It is still not working. I would like it to be a bit longer (1200) than the default 300 so as to allow me to position the cursor, and possibly click, before the information popup shows. I do want the popup, it is extremely useful, but it needs to be delayed a bit longer, at least for me.

Any possible work around?

This bug is tracked by the Arduino IDE developers here:

I verified that it still occurs with the latest version of the IDE.

Some new information: it also occurs when using the Theia Blueprint demonstration application for the Eclipse Theia IDE framework the Arduino IDE is built on. I can not reproduce the bug in VS Code. This means it is a bug in the Theia codebase rather than in the Arduino IDE or VS Code codebases (Theia is based on VS Code).

I did a bit of tinkering around and didn't find one.

@ptillisch thanks for the reply. I am aware of the tracking and am keeping an eye on it.

Pity the problem is not in the IDE where it would be relatively straightforward to fix.

This currently is my only major pain. The hover is hugely helpful for quickly checking function variable types or initialised values, so not really an option to disable. With the hover popping up so quickly it is sometimes difficult to update code.

Thanks for checking.

@ptillisch - I opened a new issue up on update manager wanting to update libraries when it clearly did not install the library.

IDE 2 - Library Manager - Should not update Library linked in and/or which is a git clone ยท Issue #1459 ยท arduino/arduino-ide (github.com)

Specifically - I wish that the IDE2 would not include in it's updatable list, that is shown when the IDE checks for updatable libraries, any library directory it sees that contain git files, like on windows a .git directory.

Yesterday I experimented a couple of times, where I have a git version that I am using.
Note: I typically keep all of my github projects contained in one place: d:\github and I make
symbolic links to them in places like the /libraries folder.
(Windows 11 I do this with command like: mklink /J SDFat d:\github\SDFat

A couple of times, I tried an update of a library which I knew was a junction to my github project.
These did have a lower version number.

The first try Arduino I believe tried to do something like: download the updated zip file, unzip it to a new directory, then try to rename the directory to the actual name. It also does something to the older version.

The first try errored out saying it could not rename the directory (access denied). I then went and looked and neither the temporary directory existed, nor the junction to the github version.
Trying update again succeeded.

I have not tried in a while on what would happen if the github project was directly within the libraries folder.

Secondary note/question? Where does the update manager get the version number of current installed from? Example:
image

Trying to update again (have done it several times over several days)
image

Looking at:


C:\Users\kurte\Documents\Arduino\libraries\Adafruit_BusIO>more library.properties
name=Adafruit BusIO
version=1.13.2
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=This is a library for abstracting away UART, I2C and SPI interfacing
paragraph=This is a library for abstracting away UART, I2C and SPI interfacing
category=Signal Input/Output
url=https://github.com/adafruit/Adafruit_BusIO
architectures=*

Note: In this case it is a normal library install...
image

I think it is a good suggestion. Due to the same folder being used for both the manually installed and the Library Manager installed libraries, there is no mechanism to identify which libraries were installed via Library Manager. However, the presence of a Git repository is a guarantee that a library was not installed via Library Manager, since the Library Manager system does not distribute the Git repository for the sake of efficiency.

It gets it from the version field of the library.properties metadata file.

It sounds like this bug:

Do a search of the libraries folder to see if any of the other library.properties files contain the string:

name=Adafruit BusIO

It might be in one of the folders with a randomized temporary name something like arduino_345456 that Arduino IDE 1.x used to create sometimes if a library installation could not be completed successfully.

1 Like

Good guess

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.