-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add support for preferred-versions #8
Comments
I think we could probably do this nicely with a field in the metadata file. Also for deprecated versions. |
preferred-versions is a package level property (of course). Perhaps we need to have a package-level metadata file? (i.e. I think deprecated versions is implemented by marking those versions as not preferred, see https://hackage.haskell.org/packages/preferred |
... is it? I would have thought it was the aggregation of whether each individual version was preferred/deprecated? |
At least in hackage, it looks like preferred versions is a package level property. Eg see https://hackage.haskell.org/package/GPipe-GLFW/preferred/edit That said, there is no difference between a version outside the preferred range and one that is deprecated. I think I will just support deprecating versions. It's left to understand how that enters in the index since I believe this information can change multiple times. I need to do some digging. |
I thought about this today and I wrote down these notes. Hackage index has a per package AFAIK what hackage server shows as “deprecated versions” are just versions that are un-preferred. I’d be happy if someone could investigate this a bit better (e.g. how does affect the solver really?). The biggest work here is to figure out how to encode Maybe as a list of timestamp and version ranges. I am leaning over making the whole preferred version range explicit rather than trying to figure out deltas between them (as it becomes hard to figure out what the current state). Note that
|
Other thought. We could just mark versions as deprecated and/or preferred. E.g. |
I think it makes sense for the user-facing interface to be "is this version deprecated/preferred or not?". I think the fact that cabal turns it into a full-on constraint is juts more power than we need. We do need to do the timestamps, though... I guess in principle something can be deprecated and then later un-deprecated etc? So it's a bit like revisions, they can stack up. |
Yes, so
I am afraid this gets confusing quickly. What if you deprecate a version twice? Should that be an error? The |
I was thinking a bit about it, and I would vote for a
What your thoughts about it? Does it make sense, is there any case where this simple system fails to encode correctly “preferred version”? I was syncing about if the user wrote unintentionally a cycle of preferred versions … |
I'm actually unsure we want preferred versions. Deprecating versions is something people actually want to do, preferring versions is a bit weird. Does hackage even expose the ability to use them or are they just an implementation method for deprecated versions? |
I agree this sounds like an internal mechanism since I've not yet heard of any other package index giving this kind of front-facing option to the user… But I could rather understand it as a mechanism to customize the depreciation message like “please update to X version”, or maybe offering a soft-depreciation mechanism “please update to X version, as it will soon be depreciated”?
I should investigate … Unrelated, but could To sum up, you suggest closing this issue in favor of just implementing #18 right? |
Plenty of examples here https://hackage.haskell.org/packages/preferred E.g. this is a package with both preferred and deprecated versions https://hackage.haskell.org/package/composition-prelude/preferred I just notice that whole package deprecation (e.g. https://hackage.haskell.org/package/2captcha) does not seem to be reflected anywhere in the index (there's no |
I... guess I just don't know what they're trying to do with preferred-versions? It's quite strong: it adds a constraint to the solver, so if you prefer version X.Y, then if you release X.(Y+1), you either need to also prefer X.(Y+1) or un-prefer X.Y otherwise X.(Y+1) will never get used. It seems hard to use well.
I think it can be literally anything.
I am also wondering whether this would be simpler. I do think it would be nice to support what I think it is likely to be the most common use case: deprecate a single package version straightforwardly (it has a bug, was a mistaken release, or whatever). |
I think this is a reasonable pragmatic choice: in the metadata, we only support deprecating versions and not preferring versions. Preferring some versions could still be done by manually deprecating all the other ones. As you say, this covers most of the use cases and it has minimal implementation cost bacause it is still metadata scoped to the package-version, i.e. we don't have to implement a new per-package metadata file. If there's consensus, I proposed we close this one and move the discussion of the implementation to #18. |
I agree 👍 |
No description provided.
The text was updated successfully, but these errors were encountered: