Library Manager commands can produce redundant installations #1870
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
Libraries are identified by the "real name" defined in the
name
field of thelibrary.properties
metadata file (or by the folder name in the case of a "legacy"/"1.0 format" library that doesn't have a metadata file).During the implementation of the Arduino Library Manager system, an unfortunate decision was made to reuse the user's library folder (
<directories.data/libraries
orLIBRARY_LOCATION_USER
). This can be problematic because the set of libraries recognized by Library Manager include those installed by the user via alternative methods:arduino-cli lib install --git-url
arduino-cli lib install --zip-file
Libraries installed via
arduino-cli lib install
are always installed to a folder named by "sanitizing" the "real name". However, installations of a library made via other methods can have any arbitrary folder name.🐛 If a library was installed to a folder with a name different from the sanitized "real name", the Library Manager commands that install a library generate a separate installation of the library. This means that multiple libraries with the same identifier are installed in
LIBRARY_LOCATION_USER
, which breaks some of the Library Manager capabilities.To reproduce
lib install
demo🐛 There are now two "Arduino SigFox for MKRFox1200" libraries installed in
LIBRARY_LOCATION_USER
. It is impossible for some Library Manager commands to operate correctly under these conditions.lib upgrade
demo🐛 There are now two "Arduino SigFox for MKRFox1200" libraries installed in
LIBRARY_LOCATION_USER
. It is impossible for some Library Manager commands to operate correctly under these conditions.Expected behavior
arduino-cli lib
commands must never result in multiple libraries with the same identifier being installed inLIBRARY_LOCATION_USER
.They should use one of the following approaches:
Remove previous installation after installing to a new folder name.
OR
Update in place, using the folder name of the existing library.
Arduino CLI version
3cd782d
Operating system
Windows, Ubuntu
Operating system version
Windows 10, Ubuntu 20.04
Additional context
This produces the conditions for #1871
Issue checklist
The text was updated successfully, but these errors were encountered: