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

lib install --no-overwrite fails when dependency version constraints would allow installation to be done without an "overwrite" #1799

Closed
3 tasks done
per1234 opened this issue Jul 12, 2022 · 0 comments · Fixed by #2431
Assignees
Labels
conclusion: resolved Issue was resolved 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 Jul 12, 2022

Describe the problem

The --no-overwrite flag (#1793) prevents arduino-cli lib install from installing a library if this would result in a change to any existing library installation.

In addition to the target library, this applies to any dependencies of the library which would be installed along with it.

Library dependencies are defined by the depends field of the library.properties metadata file. This field supports the use of version constraints, which can be used to specify a dependency on a specific version or version range rather than the default behavior of installing the latest version of the dependency.

🐛 The arduino-cli lib install --no-overwrite command fails when no change to existing installations would have resulted from installation of the library due to its dependency version constraints.

To reproduce

$ arduino-cli version
arduino-cli.exe  Version: 0.25.0-rc1 Commit: 63b53c0f Date: 2022-07-12T01:46:05Z

$ arduino-cli lib install [email protected]
Downloading [email protected]...
[email protected] downloaded
Installing [email protected]...
Installed [email protected]

$ arduino-cli lib uninstall EncoderTool
Library EncoderTool is not installed

$ arduino-cli lib install --no-overwrite [email protected]
Error installing EncoderTool: Library [email protected] is already installed, but with a different version: [email protected]

The library [email protected] has the following depends field:

depends=Bounce2 (>=2.53)

🐛 In the demo above, installation of [email protected] need not have resulted in any changes to the existing library installations because the installed version of the "Bounce2" library dependency matched the version constraint specified for the dependency. Yet the installation failed anyway.

Expected behavior

In the demo above:

  • Install the "EncoderTool" library (because the installation can be done without changing any existing library installations)
  • Do not update the "Bounce2" library (because the --no-overwrite flag was used in the command)

Arduino CLI version

0.25.0-rc1 Commit: 63b53c0

Operating system

Windows

Operating system version

Windows 10

Additional context

Previously discussed at #1793 (review)

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment