-
Notifications
You must be signed in to change notification settings - Fork 80
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
Remove the strict requirement for an independent storage backend #584
Comments
Hi Viktor! I hope you are doing well 🙂 The "alternate backends" corner of the Registry is underimplemented right now, as we chose to prioritise other things first in order to keep the initial scope manageable. However, I would say that the main idea of where to go (and perhaps a clearer vision of where not to go with it) is nailed down. I'll try to reason through it here below.
In my opinion the main reasons why a central Registry is useful to us right now are:
Accepting the proposal here would mean disposing of point (2) above, which is not the experience that we'd like to offer to the Registry users (i.e. if we were fine with the tradeoff that the Bower registry offered then we wouldn't be doing all this work in the first place) As you note this situation was discussed in #354, which in hindsight I find a confusing read, as a lot of the context was talked about but never written down in there. The other important conclusion that we reached at the time was "alternate backends are doing just fine with using package sets, no hurry in using the Registry for them" (which is what allowed us to stash this away for later). Your first sentence above is "I'm considering creating a registry for purenix", and I ask: do you need one? Is that a simpler/more effective setup than just using a package set? If you are using the new spago with the workspace:
set:
registry: 9.0.0 however, you can also reference it by URL: workspace:
set:
url: https://raw.githubusercontent.com/purescript/registry/main/package-sets/9.0.0.json Now, these package sets don't have to come from the Registry repo. You can point Spago at any URL, and it's able to read a bunch of different formats (there's unfortunately not a single line of documentation on this stuff yet, but on the other hand we're not even in alpha yet), so in the case of an alternate backend, you could alias packages and the package set file would look something like this: {
"version": "9.0.0",
"compiler": "0.15.4",
"published": "2023-01-04",
"packages": {
"prelude": {
"git": "https://github.com/purenix-org/purescript-prelude",
"ref": "0a991d6422d5d57650955fab8468f7af82dba944"
},
"bifunctors": "6.0.0",
...
}
} Specifying If the above makes somewhat sense, then I suppose that we could so something to help the authors of alternate package sets to keep them up to date, much like we automatically keep the official package sets up to date automatically. |
Hello Fabrizio! Long time no see! Thank you, I'm doing great! How about you?
I really like the structure of that last example, I just thought this was something that wouldn't be supported because of the type of a PackageSet only allows Is it reasonable for me to add a PR where I extend the |
I believe the intent is for Spago to support extended package sets with custom packages, but the registry will only release package sets of packages from the registry. Side note: can we rename the |
My current use case is purescript2nix, a small script to build purescript packages in nix using purs directly while fetching the dependencies from the registry. I wouldn’t want to implement the extended package sets into purescript2nix without updating the registry because it would be in direct violation of the spec.
|
@considerate I'm doing great as well, thanks 😊 As @MonoidMusician said, the upstream package sets that we host in the Registry are bound to use only packages that come from inside the Registry, hence the limitation in the type you linked. However, any other package set doesn't have to have this limitation, and in fact Spago can understand many more different formats. The type that we use for that is here (and in addition to this new format we also support the current package set format). |
@MonoidMusician and I'm on board with renaming the |
Thank you for the comments @MonoidMusician @f-f.
I see. I'm weary about each package manager specifying the format of package sets as this might lead to divergence and incompatibilities between the package managers. However, I understand that it's not really my call to make. Hopefully the registry spec can at least serve as a least common denominator and a minimal requirement of what each package manager should support. In the short-term I'll implement the |
Closing this since the original issue of requiring a storage backend does not seem to be there. |
We have tried to keep the Registry spec footprint to a minimal size, as we'll have to support for a very long time anything that we introduce (due to our forwards-compatibility guarantee). |
I'm considering creating a registry for purenix. I have looked at #354 and I think that the simplest solution for
purenix
would be to just create a separate registry repository given the small number of supported packages rather than adding abackend
field to each package in the registry.I think it's feasible for me to create a registry with
metadata
and a corresponding registry index with cachedmanifests
. However, I wouldn't want to replicate all the work in this repository and I would like to avoid setting up a separate storage backend.However, as it stands, the registry is tightly coupled to a single storage backend because the PublishedMetadata only contains the fields
hash
,bytes
, andpublishedTime
.If the PublishedMetadata had an alternative representation that uniquely declares how to fetch the package from the original
location
instead there would be no requirement for the separate storage backend.I understand that not having a separate storage backend would imply issues with disappearing packages that the main registry aims to avoid. However, for alternative registries like the one for
purenix
and maybe one forpurerl
I think loosening this constraint and having the package manager fetch the source from their original locations is preferable.The text was updated successfully, but these errors were encountered: