-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Support for mutliple mayor versions of the same package #593
Comments
On second though, this isn't quite what I want, because it means you have to write Then there's another issue: a module may import other modules from the same package. Should those imports also specify the mayor version number? If so, that would complicate local development as you'll end up with e.g. |
Thinking out loud here: I really don't want version numbers of full URIs in imports (e.g. What we could do is introduce a canonical alias/name for packages in
The syntax would be:
Within The structure in
When processing the
The local name is explicit so you can deal with the rare scenario of two different packages having the same last component, by just giving them a different local name. This setup should allow us to keep the current import setup, while supporting multiple mayor versions, and without the current problem of different packages introducing conflicting module names. It does complicate processing imports a bit, and parsing of With that said, I've probably overlooked something, so this will need some time to "simmer". |
Description
Based on the discussion found here:
Inko's package manager doesn't allow for multiple mayor versions of the same package. This is annoying, and can make upgrading packages a challenge. Go's approach to this problem (given it uses the same version algorithm) is to treat different mayor versions as different packages, thus "http" 1.2.3 and "http" 2.0.0 are treated as being entirely different.
Go does make the mistake of special-casing v0/v1 so you don't need to include the version in the import, but I think that's a mistake as it's not consistent and it's ambiguous. For Inko, we'd make the version explicit in the import, thus you'd need to write this:
Including the versions in the import takes some getting used to, but it beats having to switch to a massively complex SAT solving scheme and compiling dependencies on a per package basis, and dealing with all the troubles this will probably bring.
Implementation wise this would be pretty simple:
(URI, mayor version)
(or something along those lines)./dep/src
, instead of placing package "foo" in./dep/src/foo
, we place it in./dep/src/vMAYOR/foo
, whereMAYOR
is the mayor version numberRelated work
No response
The text was updated successfully, but these errors were encountered: