Skip to content

lib list and lib examples use incorrect library name #1577

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
per1234 opened this issue Dec 1, 2021 · 1 comment
Closed

lib list and lib examples use incorrect library name #1577

per1234 opened this issue Dec 1, 2021 · 1 comment
Assignees
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Dec 1, 2021

Bug Report

The name of an Arduino library is defined by the name property of its library.properties metadata file.

This is the sole unique identifier for the library, which is used in the LIBRARY_NAME argument of the arduino-cli lib commands. However, two of the commands instead use the library's folder name for the library name instead of its real name.

Current behavior

The following demonstration uses the "Arduino SigFox for MKRFox1200" library, the name of which is defined here:
https://github.com/arduino-libraries/SigFox/blob/1.0.4/library.properties#L1

name=Arduino SigFox for MKRFox1200

This library was selected because the spaces in the name cause the "normalized" Library Manager installation folder name (Arduino_SigFox_for_MKRFox1200) to be different from the library name.

$ arduino-cli version
arduino-cli.exe  Version: nightly-20211201 Commit: 55ad9ec Date: 2021-12-01T01:29:21Z

$ arduino-cli lib search "Arduino_SigFox_for_MKRFox1200"
Updating index: library_index.json.gz downloaded ?  19988.48% 00m02s1s
Updating index: library_index.json.sig downloaded
No libraries matching your search.

$ arduino-cli lib search "Arduino SigFox for MKRFox1200"
Updating index: library_index.json.gz downloaded ?  19988.48% 00m02s1s
Updating index: library_index.json.sig downloaded
Name: "Arduino SigFox for MKRFox1200"
  Author: Arduino
  Maintainer: Arduino LLC
  Sentence: Helper library for MKRFox1200 board and ATAB8520E Sigfox module
  Paragraph: This library allows some high level operations on Sigfox module, to ease integration with existing projects
  Website: https://www.arduino.cc/en/Reference/SigFox
  Category: Device Control
  Architecture: samd
  Types: Arduino
  Versions: [1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4]

$ arduino-cli lib download "Arduino_SigFox_for_MKRFox1200"
Error downloading Arduino_SigFox_for_MKRFox1200: Library 'Arduino_SigFox_for_MKRFox1200' not found

$ arduino-cli lib download "Arduino SigFox for MKRFox1200"
Arduino SigFox for [email protected] downloaded

$ arduino-cli lib install "Arduino_SigFox_for_MKRFox1200"
Error installing Arduino_SigFox_for_MKRFox1200: Library 'Arduino_SigFox_for_MKRFox1200' not found

$ arduino-cli lib install "Arduino SigFox for MKRFox1200"
Downloading Arduino SigFox for [email protected]...
Arduino SigFox for [email protected] already downloaded
Installing Arduino SigFox for [email protected]...
Installed Arduino SigFox for [email protected]

$ arduino-cli lib deps "Arduino_SigFox_for_MKRFox1200"
Error resolving dependencies for Arduino_SigFox_for_MKRFox1200: Library 'Arduino_SigFox_for_MKRFox1200' not found


$ arduino-cli lib deps "Arduino SigFox for MKRFox1200"
✕ Arduino SigFox for MKRFox1200 1.0.4 must be installed.

$ arduino-cli lib list "Arduino_SigFox_for_MKRFox1200"
Name                          Installed     Available         Location              Description
Arduino_SigFox_for_MKRFox1200 1.0.4         -                 LIBRARY_LOCATION_USER -

$ arduino-cli lib list "Arduino SigFox for MKRFox1200"
No libraries installed.

$ arduino-cli lib examples "Arduino_SigFox_for_MKRFox1200"
Examples for library Arduino_SigFox_for_MKRFox1200
  - C:\Users\per\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200\examples\EventTrigger
  - C:\Users\per\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200\examples\FirstConfiguration
  - C:\Users\per\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200\examples\SendBoolean
  - C:\Users\per\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200\examples\WeatherMonitor
  - C:\Users\per\Documents\Arduino\libraries\Arduino_SigFox_for_MKRFox1200\examples\WeatherMonitorStream

$ arduino-cli lib examples "Arduino SigFox for MKRFox1200"
No libraries found.

Notice that in all cases except lib list and lib examples, the library name is "Arduino SigFox for MKRFox1200", while that correct name is not recognized when used in the library name argument of the final two commands.

Expected behavior

Libraries are always referred to by the correct name, consistently from one command to another.

Environment

  • CLI version: nightly-20211201 Commit: 55ad9ec Date: 2021-12-01T01:29:21Z
  • OS and platform: Windows 10

Additional context

There is one case where the library folder name determines the library name: the "1.0 format" or "legacy" libraries that do not have a library.properties metadata file:

https://arduino.github.io/arduino-cli/dev/library-specification/#old-library-format-pre-15


The name field value is sometimes referred to as the "real name" or "fancy name".

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Dec 1, 2021
@per1234
Copy link
Contributor Author

per1234 commented Feb 14, 2022

Closing as duplicate of #932

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants