-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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 #6004
Conversation
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.
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-6004-BUILD-655-linux32.tar.xz ℹ️ The |
I haven't looked at the code (yet), but my first question is: What will we use to identify a library? It looks like a string name is used, which I assume is the same string stored inside the library.properties of the library depended upon? Or is this the identifier used inside the library manager json? Questions that spring to mind:
|
yes, it's the
You can't, but the real question is: even if we can specify external dependency in some way how is the user supposed to install them? he needs to do anyway some actions outside the library manager (download zip, unpack etc.).
Renames are denied (except when we are forced for admin needs). |
what's missing for us to be able to apply this patch? |
Currently:
|
This sounds like a first step. but I think this is not enough. If I download a sketch/project from somewhere on the web and want to build the sketch, I first need to manually check the dependencies. I have to check the "includes" and maybe also the documentation. Then I need to search for the right library in the library manager and finally install it. THEN I can try to build it. And if I found the correct library with the correct version it will hopefully compile successfully. What about having a kind of "dependency-config" for a sketch or a kind of meta-information IN the sketch that lets the Arduino IDE detect which version the build would require and finally download the correct version. Of course this would add another level of complexity to a sketch. But it should be possible to have this kind of backward compatible: f dependency-information is available, use it. If it's not available, proceed as before: let the user find the dependencies on his own. Have there been any thoughts about this kind of sketch-to-lib-dependency-management? |
As I did not get feedback here, I tried to post the same idea/qustions to arduino developer mailinglist. NOw waiting for message approval ... |
I think sketch-to-lib-dependency-management would be too much for AIDE to handle. The original idea by OP would be enough for starters. |
superseded by #8600 |
This is an attempt to solve #5795.
The dependency tree is read from the
library_index.json
, downloaded fromarduino.cc
, this json is build from the information contained in thelibrary.properties
of each library so, to complete this PR, we should add a field in thelibrary.properties
to explicitly specificy 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 fromlibrary_index_test.json
, this way we can test this PR by providing a fakelibrary_index_test.json
.This is the index that I used for testing: library_index_test.zip that contains a modified fake entry:
and this is the dialog that appears when we try to install "ArduinoCloud":
(of course ArduinoCloud doesn't need ArduinoSound, this is just for testing multiple dependencies)
This PR also lead me to think about a possible simplification of the
ContributedLibrary
object model, but this is something for another PR to build on top of this one.