-
Notifications
You must be signed in to change notification settings - Fork 3
Add support for cabal-2.0 caret operator & trailing-zero normalisation #2
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
Comments
Thanks for starting this discussion! In my optimistic CLI design, your two cases would make independent aggregators. For example,
and
Of course, this doesn't scale at all :) I think it is a little controversial how we should write build-depends sections. Everyone may have their own policy and preference about it. So ultimately in my opinion, However, if there are not so many potential aggregators we should use, I think we can still rely on single Below is my personal opinion about the two options you proposed: trailing-0 normalisationI didn't know the discussion about the trailing-0 version numbers. In fact, your very example of So, I think I can live with
|
Fwiw, I don't think there's gonna that many aggregators (but I can think of yet another one: PVP-bounded by minor versions).
You're referring to the build dependencies of |
No. I meant build-depends of a package that one uses As for the build dependencies of This issue can be divided into two components.
"trailing-0 normalisation" is related to the component 1, while So, my plan is:
|
I totally agree that Making the 0-normalisation the default sounds reasonable to me. I think I've already mentioned all aggregators that make sense to me (in the context of Hackage's PVP policy), i.e. specifically
I don't think anyone will need to disable 0-normalisation other than for debugging/testing purposes. PS: Btw, does |
Thanks for your opinion! I'll (re)design
No, it doesn't.
Even if there were good parsers, however, I don't think |
I wrote a test spec for
@hvr if you have time, could you review it? They are just pairs of input versions and the output version range. |
@debug-ito Awesome! I'll try to, but I'm a bit busy right now w/ preparations for GHC 8.2.1RC2 & Cabal 2.0 coming up, so it'll probably be some time till I get to it. Can you remind me sometime next week again? |
OK, I will. Thanks! |
@hvr Hi! Do you have time for review? On |
@debug-ito I just gave it test-drive, and the results look good to me! |
Thanks! I'll release it. |
Just released staversion-0.2.1.0, which includes |
If the option formats versions incorrectly, just open a new issue. |
Uh oh!
There was an error while loading. Please reload this page.
This tool looks very promising, I'm glad you've written it!
I was looking into adding support myself, but noticed that
staversion
relies upon Cabal for version range handling. So I guess this needs to wait till Cabal-2.0 is officially released. Also I'm not sure how you want the CLI to be designed. I think there's two optional modifiers which I'd like to have available in the CLI:^>=
operator (requirescabal-version:>=2.0
)trailing-0 normalisation
A range such as
can be simplified even more, if the invariant can be assumed that there can only be
base-4.9
orbase-4.9.0.0
uploaded to Hackage, but not both:which consequently simplifies into
(See also haskell/hackage-server@27f9727).
^>=
operatorWith the new
^>=
operator (documented here), the examplecan be written more tersely as (
--caret
is just a strawman-proposal)and this can be combined with the zero-normalisation via e.g.
--zero-norm
(again, strawman-proposal, open for bikeshed):Which IMO is more concise and more readable than the original version-range-union
staversion
currently emits. Besides readability, another reason I introduced the newcaret
operator inCabal
is that formally two different major versions of a package can be effectively two totally different APIs (in the extreme case; there's a few examples on Hackage for that), and the use of||
visually hints at this property IMO a bit better than having a merged version range>= 0.9 && < 1.2
which IMO gives the wrong impression.What do you think?
/cc @phadej @bergmark
The text was updated successfully, but these errors were encountered: