Skip to content

[breaking] Fixed detection of double-install using lib install with --git-url or --zip-path #1983

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

Merged
merged 13 commits into from
Nov 29, 2022

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Nov 17, 2022

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)

What kind of change does this PR introduce?

Fix double install detection running lib install with --git-url or --zip-path flags.

What is the current behavior?

A double-install of a library may be the outcome of lib install command: it happens when a library is installed twice under two different subdirectories of the sketchbook's libraries folder.
See #1871 for more details and examples.

What is the new behavior?

The multiple install problem should be fixed.

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

Yes

@cmaglie cmaglie added priority: high Resolution is a high priority topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project criticality: medium Of moderate impact labels Nov 17, 2022
@cmaglie cmaglie added this to the Arduino CLI 1.0 milestone Nov 17, 2022
@cmaglie cmaglie self-assigned this Nov 17, 2022
@cmaglie cmaglie linked an issue Nov 17, 2022 that may be closed by this pull request
3 tasks
@cmaglie cmaglie force-pushed the fix_git_zip_install branch from 22fb998 to bdf27b0 Compare November 22, 2022 14:42
The errors are already reported upstream via returned `err` value
It now accepts library name and version as single arguments since we are
going to use this function also for libraries not present in the index.
Now it performs all the needed checks to avoid multiple installations.
Now it performs all the needed checks to avoid multiple installations
They were duplicated and spread around all the library install
functions.
This helped to find out 2 places where the `installDir` was unnecessary.
@cmaglie cmaglie force-pushed the fix_git_zip_install branch from d4fb7e3 to 174c2db Compare November 22, 2022 15:00
The installation folder is now taken from the `name` field in `library.properties`.
@cmaglie cmaglie marked this pull request as ready for review November 22, 2022 16:39
Co-authored-by: Umberto Baldi <[email protected]>
@cmaglie cmaglie merged commit c570916 into arduino:master Nov 29, 2022
@cmaglie cmaglie deleted the fix_git_zip_install branch November 29, 2022 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
criticality: medium Of moderate impact priority: high Resolution is a high priority topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple installations cause library to be perpetually updatable
2 participants