Skip to content

Version management features missing for installed libraries with non-semver versioning #2385

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

Open
3 tasks done
per1234 opened this issue Feb 23, 2024 · 0 comments
Open
3 tasks done
Labels
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 Feb 23, 2024

Describe the problem

Although compliance with the SemVer specification when versioning library releases is recommended to library maintainers, it is not mandatory. Arduino allows an version number that is compliant with what is referred to as "relaxed SemVer". This means that a library might have a version number with a form like 1.2 or even 1.

🐛 If a library is installed that has a non-SemVer version number, some of Library Manager's version management features are not available for that library:

  • Missing version selector menu
  • Missing "UPDATE" button
  • Missing "Remove" context menu item
  • Non-functional "Other Versions" context menu item

To reproduce

  1. Use Library Manager to install version 1.61.0 of the "AccelStepper" library.
    Note that after installing, the library entry shows the installed version number is "1.61".
    🐛 The version selector menu disappears from the "AccelStepper" library entry.
    🐛 There is no "UPDATE" button on the the "AccelStepper" library entry, even though a newer version of the library is available.
    image
  2. Hover the mouse pointer over the "AccelStepper" entry.
  3. You will see a ●●● icon appear near the top right corner of the library entry. Click on that icon.
    🐛 There is no "Remove" item in the menu, even though the library is installed.
    image
  4. Select "Other Versions" from the menu.
    A sub-menu will open.
  5. Select "1.59.0" from the menu.
    🐛 Version 1.59.0 of the library is not installed.

Expected behavior

Version management features are always available.

Arduino IDE version

aa9b10d

Operating system

Windows

Operating system version

11

Additional context

When a library release is added to the (Library Manager index](http://downloads.arduino.cc/libraries/library_index.json), the version number is converted to the SemVer equivalent (e.g., 1.2 -> 1.2.0). This means that the version numbers in the cc.arduino.cli.commands.v1.LibrarySearch response (which is based on the data from the index) are in SemVer format even when the library's actual version number is not.

Conversely, the version numbers in the cc.arduino.cli.commands.v1.LibraryList response (which is based on the installed library metadata) are in whatever format used by the library maintainer (arduino/arduino-cli#1727).

This means that there is a mismatch between the version numbers from the two responses (both of which are used by the Arduino IDE Library Manager) under these conditions. I suspect the bug is related to this mismatch.

Workaround

Install different version of library
  1. Hover the mouse pointer over the "<version number> installed" label on the library's Library Manager entry.
    The label will change to "REMOVE".
  2. Click on "REMOVE".
    The "Uninstall" dialog will open.
  3. Click the "YES" button in the dialog.
  4. Wait for the uninstall process to finish.
    A version selector menu will now appear on the library's Library Manager entry.
  5. Select the version you want to install from the version selector menu.
  6. Click the "INSTALL" button.
Update library

Use the "Installing different version" procedure described above to install the latest version of the library.

Uninstall library
  1. Hover the mouse pointer over the "<version number> installed" label on the library's Library Manager entry.
    The label will change to "REMOVE".
  2. Click on "REMOVE".
    The "Uninstall" dialog will open.
  3. Click the "YES" button in the dialog.
  4. Wait for the uninstall process to finish.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

1 participant