-
Notifications
You must be signed in to change notification settings - Fork 106
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
Decentralized package management #33
Comments
Overall I like this direction. However I'm confused about how this works in practice. Perhaps it's just a terminology issue. Like PyPI, Crates serves both as a registry (metadata), and code distribution. I agree that it's not feasible for fpm to host and distribute code. It's a huge ordeal and technical challenge. However, do you also mean that fpm wouldn't have a centralized metadata registry? If yes, how would a newcomer to Fortran and fpm search for packages? It seems to me that if you don't have some centralized metadata registry, the user would need to know what package they need and how to download it. |
I think it's a step by step process, we start with the step 1. below, then we progress to step 2. and then to step 3.:
If step 1. is fully developed, there can actually be a "decentralized package registry". It would work just like described in step 2. (see the issue #34 for details), except that there would not be a centralized name for a package, so people could submit various packages (as url) that can have the same name. Then |
Coming from #34, let's discuss how the step 1 (no centralized registry) works. This means we don't need Let's say I just want to @certik How does this work? It seems to me that we need some metadata even at this stage. Or is the user expected to enter something like: [dependencies]
name = "datetime"
url = "https://github.com/wavebitscientific/datetime-fortran" to their fpm.toml? Both approaches seem okay to me for now (latter is simpler), I'm just not clear what's your idea how this works. |
The step 2 in #34 is what we should eventually do, and then step 3 in #35. It looks like we got agreement on both. You can only install So let's start with step 1 in this issue #33. In here I propose to do exactly what Cargo does. Say I want to use I would have this in my [dependencies]
datetime = "1.7.0" Once step 2 is implemented, then [dependencies]
datetime = { version = "1.7.0", registry = "my-registry" } Until then, in this step 1, we do not have a registry, so you have to also tell it where it can download the [dependencies]
datetime = { git = "https://github.com/wavebitscientific/datetime-fortran", tag = "v1.7.0" } However, since we want to move to a registry, and since most projects follow the convention of prefixing the version by
So with this extension, you would do: [dependencies]
datetime = { version = "1.7.0", git = "https://github.com/wavebitscientific/datetime-fortran" } And then later once we move to a registry, you just remove the |
Cargo actually has a different meaning for this: [dependencies]
datetime = { version = "1.7.0", git = "https://github.com/wavebitscientific/datetime-fortran" } This means that when working in this package, it will download the latest master version of datetime, but for a package that depends on this one, the transitive dependency is version 1.7.0 of datetime from the default registry. I'm not saying we definitely shouldn't do what you're suggesting, but if we do it will preclude us from ending up with the same functionality as Cargo. It would also impose a tagging convention on people's repositories that will be unnecessary once we have a proper registry. Also, relying on git tags for official release version identifiers is wide open for abuse. |
Perfect, this is what we're after as a first step: [dependencies]
datetime = { git = "https://github.com/wavebitscientific/datetime-fortran", tag = "v1.7.0" } This alone will already be a huge improvement over the current state of things. We can work out the nuances of |
@everythingfunctional I am glad you noticed that. Let's not do my proposal then, just use |
@everythingfunctional, @milancurcic I think this issue is fixed now? |
Yes, IMO this is good to close. |
Yep, go ahead and close it. |
Rust allows the packages to be decentralized, they do not have to be listed at https://crates.io/.
The Go language does not even have a centralized package registry at all, see this blog post that explains it in the section "Package Management":
https://nullprogram.com/blog/2020/01/21/
I don't like the Go's model that the name of the package is the url, I prefer the Rust model where a package has a simple name, but you specify where it can be downloaded. The end result is the same. (Overall, the Rust package management seems much more thought out, and it seems they fixed the issues that Go is tackling long time ago.)
I want to implement the same approach for fpm. That will allow us to build an ecosystem of packages for Fortran, without a "goldrush" to reserve a popular package name in a centralized registry. Then, as we have a healthy ecosystem of packages, we can add a centralized registry later.
The text was updated successfully, but these errors were encountered: