-
-
Notifications
You must be signed in to change notification settings - Fork 385
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
Fix resolution of library names when checking for upgrades #1725
Conversation
The real name for a lib (the name stored in the library.properties) is required to find a library in the index. The installed name, which matches the diretory name, is not valid for looking up libraries in the index. Libraries that do not have a library.properties file, or where the name value in that file does not match the value in library_index.json, cannot be upgrade by the CLI. Also Fix tests for outdated libs The tests for update and outdated changed the library.properties file for an installed lib, but also wiped out the name field. Since we rely on that field to determine the library name when using the RealName property, the test's change was causing a failure outside the scope of the test itself.
They are already marked as such in the
Of course the average user will be using the
1.5 format is a requirement for inclusion in the index, so there are no "legacy" format libraries in the index.
Thanks for pointing that out. I am against it. In my opinion, there should be one and only one name for each library, which is always used when referring to the library in the Arduino CLI output and in the commands. So I think the way you chose to make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @stonehippo!
This PR fixes only one of several of the symptoms of an unintuitive and flawed approach to handling names of installed libraries. However, it does indeed fix that symptom and thus is a valuable contribution by making the behavior of Arduino CLI less buggy in this respect.
So I am in support of merging this, even though the big picture is that the entire local library name system needs to be reworked from the root of the problem in the design of github.com/arduino/arduino-cli/arduino/libraries.Library
on up.
I'll give a little time in case other maintainers want to review before merging.
Thanks, @per1234. I agree re the current system. It's really hard to make definitive calls about the state of a user's installed libraries vs the index. You're right that this is only a patch over the symptoms, but it's going to take some collective work to reconcile the deeper issue. |
Please check if the PR fulfills these requirements
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)This change resolves #1041, where packages that have upgrades based on
library_index.json
do not show up as upgradable with using thearduino-cli lib
commands.When using the
arduino-cli lib
commands to check for or apply updates, packages that have spaces in the name in the index are not shown as upgradable.The overall behavior is unchanged and commands remain as currently implemented and documented. However, the resolution of packages that have spaces in the names now works, so commands such as
arduino-cli lib list --updatable
will now show all upgradable packages.titled accordingly?
No
See how to contribute