Open lerno opened 1 year ago
Go Modules work like this:
3. Dependency resolution per major library version is done by picking the minimal version. E.g. module Foo requires Bar 1.5+ and module Baz requires 1.3+. Our module using Bar and Baz will resolve the minimal version to 1.5. This is the version that will be used. Note that if Foo used 2.5+, then both Bar 2.5 and 1.3 would be required.
You mean Bar and Baz resolve to 1.3 right?
How would the version be specified? only in the project or other manifest file or in the module path as is the case in Go?
No, they resolve to 1.5 since Bar needs 1.5+. Different major versions are considered distinct libraries.
Module would be defined in manifest.json / project.json. A simple scheme is saying -lib foolib
grabs any foolib -lib foolib@1.5
means foolib 1.5+ etc:
foolib@1.3-1.5
version 1.3 to 1.5foolib@-1.3
version up to 1.3foolib@1.5/1.3/1.0
version 1.5+, excluding 1.3 and 1.0 Ideally look up if there is some standardized way to do the above.
Things like this should be considered: https://www.lucidchart.com/techblog/2017/03/15/package-management-stop-using-version-ranges/
Maybe also have a look at what Zig si doing. They have introduced their package manager recently (I havent looked at it yet).
I am not really looking at a package manager. I think downloading dependencies using other means is fine. Because of how C3 libraries work (essentially zip files with some metadata) they're easy to just drop manually into any project - no package manager needed. The only thing that's necessary is to determine how to select a package if you have dropped two libraries of the same type into your dependencies. Basically "what does that mean" when you then want to include a library.
Because we're not doing package dependency resolution for pulling in packages, we're essentially only about selection.
So say that you have your code, and then you drop in foolib@1.5.1
foolib@1.5.0
foolib@2.3.0
?
So for example it could work like this:
--lib foolib
=> use the latest, 2.3.0--lib foolib@1
=> use the latest 1.x => 1.5.1--lib foolib@1.5.0
=> use 1.5.0--lib foolib --lib barlib
and barlib depends on 1.5.0+
=> Use 1.5.0 (MVS)--lib foolib@2 --lib barlib
=> error (or link both??)--lib foolib@1 --lib barlib
=> Use 1.5.0 (MVS)I like this actually. Package managers are a nightmare. Thanks for the explanations.
Consider some versioning scheme for various elements in the build/manifests:
Possible design: