Skip to content

Library update/install with --no-overwrite will perform the update if it's possible to keep already installed dependencies at their current version #2431

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 6 commits into from
Nov 27, 2023

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Nov 22, 2023

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

  • Updated the semver library to the latest version with many improvements.
  • Allows to install libraries with lib install --no-overwrite flags when there are already installed dependencies
  • Adds a --no-overwrite flag to lib deps to check the solution found by the install planner.

See #1799 for more details.

What is the current behavior?

$ arduino-cli lib deps EncoderTool@2.2.0  
✕ Bounce2 2.71.0 is required but 2.53 is currently installed.
✕ EncoderTool 2.2.0 must be installed.

$ arduino-cli lib deps EncoderTool@2.2.0 --no-overwrite
Error: unknown flag: --no-overwrite
[....]

$ arduino-cli lib install EncoderTool@2.2.0 --no-overwrite
Error installing EncoderTool: Library Bounce2@2.71.0 is already installed, but with a different version: Bounce2@2.53

What is the new behavior?

$ arduino-cli lib deps EncoderTool@2.2.0  
✕ Bounce2 2.71.0 is required but 2.53 is currently installed.
✕ EncoderTool 2.2.0 must be installed.

$ arduino-cli lib deps EncoderTool@2.2.0 --no-overwrite
✓ Bounce2 2.53 is already installed.
✕ EncoderTool 2.2.0 must be installed.

$ arduino-cli lib install EncoderTool@2.2.0 --no-overwrite
Already installed Bounce2@2.53.0
Downloading EncoderTool@2.2.0...
EncoderTool@2.2.0 EncoderTool@2.2.0 already downloaded
Installing EncoderTool@2.2.0...
Installed EncoderTool@2.2.0

Does this PR introduce a breaking change, and is titled accordingly?

Other information

@cmaglie cmaglie added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Nov 22, 2023
@cmaglie cmaglie self-assigned this Nov 22, 2023
@cmaglie cmaglie force-pushed the semver-improvements branch from d7e6b72 to 5940923 Compare November 22, 2023 12:05
Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (89f8f04) 67.33% compared to head (f76d12a) 67.43%.
Report is 1 commits behind head on master.

Files Patch % Lines
...ino/libraries/librariesmanager/librariesmanager.go 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2431      +/-   ##
==========================================
+ Coverage   67.33%   67.43%   +0.10%     
==========================================
  Files         210      210              
  Lines       20567    20591      +24     
==========================================
+ Hits        13849    13886      +37     
+ Misses       5581     5572       -9     
+ Partials     1137     1133       -4     
Flag Coverage Δ
unit 67.43% <96.72%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmaglie cmaglie force-pushed the semver-improvements branch 2 times, most recently from f9eef49 to 9c14b77 Compare November 23, 2023 17:04
@cmaglie cmaglie changed the title Updated semver library / other improvements (draft) Library update/install with --no-overwrite will perform the update if it's possible to keep already installed dependencies at their current version Nov 27, 2023
@cmaglie cmaglie force-pushed the semver-improvements branch from 9c14b77 to b352d90 Compare November 27, 2023 12:16
@cmaglie cmaglie marked this pull request as ready for review November 27, 2023 12:22
Previously the --no-overwrite flag would fail to install if a library
dependency was already installed but not at the latest version.
After this change the already present library may be accepted as a
dependency if it match the version constraints of the installed library.
@cmaglie cmaglie merged commit 0381aa5 into arduino:master Nov 27, 2023
@cmaglie cmaglie deleted the semver-improvements branch November 27, 2023 14:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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