Skip to content
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

Correct library names in depends metadata field #1

Merged
merged 2 commits into from
Jul 21, 2022
Merged

Correct library names in depends metadata field #1

merged 2 commits into from
Jul 21, 2022

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jul 21, 2022

The depends field of the library.properties metadata file specifies the dependencies that should be installed along with the library by the Arduino Library Manager.

While Arduino IDE 1.x is fairly lenient about the quality of the metadata, Arduino CLI (and thus the tools that use it such as Arduino IDE 2.x as well: arduino/arduino-ide#621) is more strict. If any of the items in the field are not available from the Arduino Library Manager, installation fails:

$ arduino-cli lib install M5Family
Error installing M5Family: No valid dependencies solution found: dependency 'M5Unit-UHF-RFID' is not available

This also applies to transitive dependencies:

$ arduino-cli lib install M5Stack
Error installing M5Stack: No valid dependencies solution found

The problematic names:

M5Unit-UHF-RFID

You can see the registered name in the last of the pipe-separated fields here:

https://github.com/arduino/library-registry/blob/977b91bd38014ed5c5b978518f6a4ec3694570a4/registry.txt#L4530

https://github.com/m5stack/UNIT_UHF_RFID.git|Contributed|UNIT_UHF_RFID

M5-FPC1020A

The correct name M5_FPC1020A was already present later in the depends field, so it was only necessary to remove the invalid name.


You might consider setting up an automated check in your library repository for compliance with the Arduino Library specification. This could run on every commit and pull request to ensure such violations are caught immediately.

Arduino provides a GitHub Actions action that makes this very easy to do by adding a simple YAML file to the repository:

https://github.com/arduino/arduino-lint-action#readme

This action uses the same Arduino Lint tool as the Library Manager system.

It is in use in all the official Arduino library repositories (example).


The `depends` field of the library.properties metadata field specifies the dependencies that should be installed along with the library by the Arduino Library Manager.

While Arduino IDE 1.x is fairly lenient about the quality of the metadata, Arduino CLI (and thus the tools that use it such as Arduino IDE 2.x as well) is more strict. If any of the items in the field are not available from the Arduino Library Manager, installation fails:

$ arduino-cli lib install M5Family
Error installing M5Family: No valid dependencies solution found: dependency 'M5Unit-UHF-RFID' is not available

This also applies to transitive dependencies:

$ arduino-cli lib install M5Stack
Error installing M5Stack: No valid dependencies solution found
@Tinyu-Zhao
Copy link
Collaborator

Tinyu-Zhao commented Jul 21, 2022

Thanks for the reminder, but I have some questions about M5Unit-UHF-RFID. Is it because this repository is not submitted in the Arduino Library Manager that it can't be downloaded, or is it because the name of this repository does not conform to the relevant specification that causes the problem?
By the way, I seem to have forgotten to re-submit the M5Unit-UHF-RFID repository, because we are recently unifying our repositories and renaming them, and since it would take too long to process the renaming operation in Arduino Library Management, it would also add a lot of work for you guys, so I just used the rename and submit it directly in Arduino Library Management. So I used the operation of renaming and submitting in the Arduino library management, and then I will delete the renamed repository in your place.

@per1234
Copy link
Contributor Author

per1234 commented Jul 21, 2022

Is it because this repository is not submitted in the Arduino Library Manager that it can't be downloaded

No. It was submitted: arduino/library-registry#759

is it because the name of this repository does not conform to the relevant specification that causes the problem?

No. There is no problem with the name of the repository.

It is very simple. There is a unique identifier for every library in the Arduino Library Manager. The depends field MUST use that unique identifier when referencing dependencies, and NOTHING ELSE.

The unique identifier is the value the name field of the library.properties metadata file had at the latest tag at the time of the submission. Right here:

https://github.com/m5stack/M5Unit-UHF-RFID/blob/ce2de3c6d5530c712d23a5a109fec37b7c534b95/library.properties#L1

name=UNIT_UHF_RFID

So the only valid way to refer to this library when using the Library Manager system is "UNIT_UHF_RFID". The name of the repository is completely irrelevant.

@Tinyu-Zhao
Copy link
Collaborator

Ok, I understand, I will submit M5Unit-UHF-RFID and modify the relevant fields in Depends to replace UNIT_UHF_RFID
Thanks for your help!

@Tinyu-Zhao Tinyu-Zhao merged commit 65528dc into m5stack:main Jul 21, 2022
@Tinyu-Zhao
Copy link
Collaborator

Hi per1234, we have recently received feedback from users that they are unable to press the download button due to too many dependencies, is there no other way than to use Arduino 2.x or the Arduino CLI?
The reason for putting the dependencies into one library is to reduce the need to install the library for new users, but this is certainly not a problem for veterans.

@per1234
Copy link
Contributor Author

per1234 commented Jul 28, 2022

Hi @Tinyu-Zhao. I'm sorry for the inconvenience. I am aware of this bug in Arduino IDE 1.x, which is being tracked by the Arduino developers here:

arduino/Arduino#10647

Unfortunately I don't know of any workaround for the bug.

@Tinyu-Zhao
Copy link
Collaborator

Hi @Tinyu-Zhao. I'm sorry for the inconvenience. I am aware of this bug in Arduino IDE 1.x, which is being tracked by the Arduino developers here:

arduino/Arduino#10647

Unfortunately I don't know of any workaround for the bug.

Thank you for your answer, I intend to teach users to use the Arduino CLI to download libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants