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

Library manager: dependency resolver (take 2) #8600

Merged
merged 12 commits into from
Jul 18, 2019

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Mar 4, 2019

Second attempt to solve #5795.
This PR updates #6004 and replace it.

The dependency tree is read from the library_index.json, downloaded from arduino.cc, this json is build from the information contained in the library.properties of each library so, to complete this PR, we should add a field in the library.properties to explicitly specify dependencies.
In this PR the dependent libraries are handled without versions constraints, this will be added in a future development.

The latest commit has been added for testing purposes and it will be removed before merging this PR: it disables the automatic download of library_index.json and reads the index from library_index_test.json, this way we can test this PR by providing a fake library_index_test.json.

This is the index that I used for testing: library_index_test.zip that contains a modified fake entry:

    {
      "name": "ArduinoCloud",
      "version": "1.0.0",
      "author": "Arduino",
      "maintainer": "Arduino \u003c[email protected]\u003e",
      "sentence": "Easly connect your Arduino/Genuino board to the Arduino Cloud",
      "paragraph": "Easly connect your Arduino/Genuino board to the Arduino Cloud",
      "website": "https://github.com/arduino-libraries/ArduinoCloud",
      "category": "Communication",
      "architectures": [
        "*"
      ],
      "types": [
        "Arduino"
      ],
      "requires": [
        { "name": "WiFi101" },
        { "name": "ArduinoSound" }
      ],
      "url": "http://downloads.arduino.cc/libraries/github.com/arduino-libraries/ArduinoCloud-1.0.0.zip",
      "archiveFileName": "ArduinoCloud-1.0.0.zip",
      "size": 45097,
      "checksum": "SHA-256:679a73db1aa4825652882ff71d7a3fb4992f4f79b41cb4a0a6c5c912adbfa848"
    },

and this is the dialog that appears when we try to install "ArduinoCloud":

image

(of course ArduinoCloud doesn't need ArduinoSound, this is just for testing multiple dependencies)

This PR requires a change in the library indexer (to report requires field in library_index.json) that is begin done right now.

@cmaglie cmaglie self-assigned this Mar 4, 2019
@cmaglie cmaglie added Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix) Component: Board/Lib Manager Boards Manager or Library Manager labels Mar 4, 2019
@cmaglie cmaglie force-pushed the lib-deps-dialog-2 branch from e5427a5 to 1f727d3 Compare March 14, 2019 02:14
@arduino arduino deleted a comment from ArduinoBot Mar 14, 2019
@sandeepmistry
Copy link
Contributor

This is looking good!

Screen Shot 2019-04-04 at 10 55 32 AM

However, the modal window appeared on the top left hand side, when testing this on macOS 10.14.4.

@cleveHEX
Copy link

cleveHEX commented Apr 21, 2019

@cmaglie
How this works in CLI? If I run arduino --install-library "DHT sensor library", will it install Adafruit Unified Sensor (I mean if config was set properly)?

cmaglie added 11 commits July 15, 2019 22:36
The new method will be used in next commits to handle installations
of multiple libraries.
This commit fix also minor bug in progress bar.
It's no more required to pass this information from outside,
just library that is being installed is now sufficient.
This is the base for the GUI that will be introduced in the
next commits.
Consider a case where the user decides to install a library `A` that
depends on library `B` and `B` is not up-to-date (i.e. is installed a
version that is not the latest), then the user is asked to "install"
both libraries `A` and `B`, effectively upgrading `B`.

With this change the already installed library `B` is left untouched
and not displayed in the missing dependencies.
@cmaglie cmaglie force-pushed the lib-deps-dialog-2 branch from 1f727d3 to 4268ce9 Compare July 15, 2019 20:58
@arduino arduino deleted a comment from ArduinoBot Jul 15, 2019
@arduino arduino deleted a comment from ArduinoBot Jul 17, 2019
@facchinm facchinm merged commit 1cacd79 into arduino:master Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Board/Lib Manager Boards Manager or Library Manager Component: IDE The Arduino IDE feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants