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 dependency name in metadata #2

Merged
merged 1 commit into from
Jul 13, 2021
Merged

Correct dependency name in metadata #2

merged 1 commit into from
Jul 13, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jul 13, 2021

The depends field of the library.properties metadata file specifies the dependencies that should be installed along with this library via Library Manager. This requires the use of the library name that is locked in when a library is submitted to Library Manager.

The "LiquidCrystal I2C" was named that way when it was added to Library Manager. Since then, the library maintainer changed the name in that library's metadata, but this does not affect the name in Library Manager (all the releases made under the new name are rejected by the indexer).

The depends field of the library.properties metadata file specifies the dependencies that should be installed along with this library via Library Manager. This requires the use of the library name that is locked in when a library is submitted to Library Manager.

The "LiquidCrystal I2C" was named that way when it was added to Library Manager. Since then, the library maintainer changed the name in the metadata, but this does not affect the name in Library Manager (all the releases made under the new name are rejected by the indexer).
@NicoHood
Copy link

But isnt that an issue with the library manager? Did you report that issue? It should either ignore the error or output a warning message.

@per1234
Copy link
Contributor Author

per1234 commented Jul 14, 2021

There is an error in Arduino IDE (I tested with 1.8.15), but it is unfortunately quite cryptic:

 no protocol: 
java.lang.RuntimeException: java.net.MalformedURLException: no protocol: 
	at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:250)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.MalformedURLException: no protocol: 
	at java.net.URL.<init>(URL.java:593)
	at java.net.URL.<init>(URL.java:490)
	at java.net.URL.<init>(URL.java:439)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:64)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:60)
	at cc.arduino.contributions.libraries.LibraryInstaller.performInstall(LibraryInstaller.java:155)
	at cc.arduino.contributions.libraries.LibraryInstaller.install(LibraryInstaller.java:125)
	at cc.arduino.contributions.libraries.ui.LibraryManagerUI.lambda$onInstallPressed$4(LibraryManagerUI.java:240)
	... 1 more

Arduino CLI used to have a problem with incorrect library names in the depends field and I did report that and it was fixed:
arduino/arduino-cli#534
In that issue, I mentioned the equivalent Arduino IDE issue in passing:

The Arduino IDE also displays undesirable behavior when installing MD_Parola@3.2.0. I did not submit a separate report for that because I thought it might be resolved by fixing the issue in arduino-cli.

The current development strategy is that non-GUI specific fixes and enhancements are made in Arduino CLI from whence they propagate to all the other tooling based on Arduino CLI, which includes both the classic Arduino IDE and Arduino IDE 2.x. But that process is very slow with the classic Arduino IDE because there is still quite a bit of non-GUI Java code that hasn't been replaced by switching to using the equivalent functionality of Arduino CLI. So it's not only a matter of updating the Arduino CLI version to the one with the fix. That is not a problem with Arduino IDE 2.x because it was built around Arduino CLI from the very start.

In general, Arduino CLI now provides a helpful error when the library dependency is incorrect:

$ arduino-cli lib install MD_Parola@3.2.0
Error installing MD_Parola: Error resolving dependencies for MD_Parola@3.2.0: dependency 'MD_MAX72xx' is not available

It turns out that there is a very corner case bug in Arduino CLI (and thus in Arduino IDE 2.x) that causes it to hang when attempting to install the specific combination of dependencies specified by NanoProtoShield. I have reported that bug to the Arduino CLI developers.

That Arduino CLI bug only occurs with the previous incorrectly spelled "LiquidCrystal_I2C" dependency. It will no longer occur when installing the releases of NanoProtoShield with the fix.

Arduino Lint's rule LP048 checks for incorrect names in the depends field, but violations of the rule only result in a warning. The reason I configured it that way is because in the case of a creating multiple interdependent libraries at the same time, the rule will give a false positive up until the libraries have been added to the Library Manager index.

@ZachEnglish
Copy link
Owner

I pulled in this change, pushed out another release and tested it in a sandbox and it works perfectly now. Thanks all for the help on this! I really appreciate it!
image

@per1234
Copy link
Contributor Author

per1234 commented Jul 16, 2021

You're welcome. I'm glad to hear Library Manager is now able to provide a complete installation.
Regards, Per

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.

3 participants