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.
<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.
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.
I think the way Arduino IDE 1.x does library installations is something like this:
Library archive is downloaded to Arduino15/staging/libraries
Library archive is extracted to a folder with a randomized name like arduino_139918 under <sketchbook folder>/libraries
If the target library installation location already exists, it is deleted
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.
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:
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:
Select Sketch > Include Library > Add ZIP Library... from the Arduino IDE menus.
Select the downloaded file (SigFox-1.0.3.zip).
Click the Open button.
Use the Arduino IDE Library Manager to install the latest version of the "Arduino SigFox for MKRFox1200" library.
Select File > Quit from the Arduino IDE menus.
Start the Arduino IDE.
Click the INSTALL MANUALLY button on the "Updates are available for some of your libraries." notification.
The "Arduino SigFox for MKRFox1200" library is shown as updatable, even though you just installed the latest version via Library Manager.
Hover the mouse pointer over the "Arduino SigFox for MKRFox1200" library entry in Library Manager.
Click the "INSTALL" button
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.
@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.
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.
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.
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.
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:
Trying to update again (have done it several times over several days)
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...
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.