-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improved Package Resolution Algorithm #16
Comments
Perhaps the starting point is to (initially) stick with a very simple resolution algorithm that activates all dependencies. Then, we make this work. That means:
This requires some reasonable changes to the current build process. |
At this stage, have implemented a simplistic approach:
There are some issues here, however. Firstly, one cannot fix a specific version of a library. Secondly, version conflicts are not supported gracefully (i.e. when different major versions of a package are requested). However, at the same time, it does resolve the major outstanding issue with the versioning system: that of transitively updating all libraries to use the latest version of a library. |
(@altmattr this may interest you)
Currently, the manner which packages are resolved is problematic. Specifically, when we have two packages which depend on different versions of a third. This is the classic problem of transitive dependencies, of course!! Currently, the resolution algorithm activates all versions of a given dependency. This completely fails because Whiley currently has no support for handling multiple versions of a given package. Hence, you can't tell which version you are actually compiling against and I don't even know which one will be generated.
Maven (see [1]):
NPM (see here):
This package manager makes little effort to handle resolution, and appears to simply allow different versions of a package to coexist.
Cargo (see here):
This appears to allow different versions of a package to coexist. However, it doesn't allow multiple versions which semver compatible to coexist. The algorithm is employ is a relatively simple DFS approach. There are some "bombs" which can explode the amount of work it performs (see here).
Rust also employs the
Cargo.lock
file which helps to mitigate the cost of solving the dependency graph. Specifically, this maps out all the packages which are activated.Thoughts
Overall, Rust seems to have a sensible approach. However, a critical aspect of this is that it allows multiple activations of the same package (provided they are semver incompatible). For example,
v2.x
can be activated alongsidev1.x
. This means adding support for multiple package activations to Whiley.The text was updated successfully, but these errors were encountered: