-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Added no_overwrite
flag in LibraryInstall
#1793
Added no_overwrite
flag in LibraryInstall
#1793
Conversation
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.
How about switching the flag to something like --overwrite
and inverting the logic?
This type of interface where you have to use a double negative to get a true is not terribly intuitive.
I'm reconsidering my previous suggestion because:
|
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.
It would be good to add test coverage of dependencies handling, including custom version constraints.
0651e1d
to
0ad48e0
Compare
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.
The behavior when there are custom dependency version constraints is not as I expected.
The library [email protected] has the following depends
field:
depends=Bounce2 (>=2.53)
My expectation is that if [email protected] is already installed, installation of [email protected] will:
- Install the EncoderTool (because the currently installed version of the dependency matches its constraint)
- Not update the Bounce2 library
But the installation fails:
$ arduino-cli version
arduino-cli.exe Version: git-snapshot Commit: 0ad48e07 Date: 2022-07-08T10:52:47Z
$ arduino-cli lib install [email protected]
Downloading [email protected]...
[email protected] downloaded
Installing [email protected]...
Installed [email protected]
$ arduino-cli lib install --no-overwrite [email protected]
Error installing EncoderTool: Library [email protected] is already installed, but with a different version: [email protected]
I see and you're right with your expected output. As it is now the To achieve your request we need to change how the resolver behaves, BTW this change it's quite involved and requires more work on the library dependencies resolution part. We need to:
So for now I think we can postpone this to a future release since it will not be a breaking change but an improvement to the currently available commands. If you agree, I would ask you to move the example above to a new 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)What kind of change does this PR introduce?
Added a flag to
lib install
to skip library install if the library is already installed (no upgrades or downgrades)What is the current behavior?
The library is installed, possibly replacing another version already installed.
What is the new behavior?
If the
no_overwrite
flag is set the installation is aborted if the installed library will replace another already installed library.Does this PR introduce a breaking change, and is titled accordingly?
no