-
Notifications
You must be signed in to change notification settings - Fork 841
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
Handling of the ^>= operator #3464
Comments
I 👍'ed this (weakly), meaning: I wasn't aware of the discussion but your argument's convincing. |
The fact that almost no one is aware of the discussion is a big problem, major changes to the way we do versioning should have more community awareness around them. But it's not my discussion to try and open up. |
For reference, the Cabal docs describe "soft" bounds as:
The PR that introduced A more recent PR (haskell/cabal#4575) added the ability to ignore only Anyway, all that to say: I can't find any stated direction for the |
Please don't count me as "not aware" (I had seen and ignored rumours on Twitter, maybe your feed? — also not Haskelling enough right now) but feel free to use more solid evidence :-). OTOH, you made me curious. OTOH, the plan is actually semi-documented. Let me quote the Cabal 2 changelog on this feature: http://coldwa.st/e/blog/2017-09-09-Cabal-2-0.html
Note the link is to a different section of the manual, and it describes behavior 1 here (no hint about future changes). OTOH, while that post (from a Cabal maintainer) is the "Cabal 2 release announcement", I could only find it from /r/haskell. Took me ~30 actual minutes. I had even seen it once before. So yes, I understand why most people haven't seen this. I've pinged people on haskell/cabal#4807 and haskell/cabal#4013. Last, available public discussion of I guess people are busy doing feasibility studies on their plans, that's why they aren't public—which is fine. Hopefully people will get to discuss what to do when results are in. OTOH, with the current docs Cabal 2 will work as an "extended beta" because docs are limited, which is not the worst result (though it doesn't seem intentional) till Nix-style builds are working. |
Thanks for the release announcement link, that was the first pubic mention of the soft bound concept I've seen. |
Treating Once automatic version bound relaxation is implemented, I think that you can treat it in the same way you treat manual version bound updates via |
Thanks for the feedback @23Skidoo. I'm pretty confused about what the plans are around the In other words, I disagree with the idea that "it's a bit early to worry about that." Frankly, before release was the right time to worry about this. |
Seems like the semantics (however open) are nothing different from Cabal package updates, as mentioned; in fact updates from soft bounds are more limited (since you opt in in advance and only allow relaxing bounds). I guess the open problem is "how do we check a bound is safe to relax". It's not enough to check if a package A still builds after relaxing the dependency on B, one must check if the API is still compatible (PVP-wise). I can imagine counterexamples using CPP (and questionable choices); more examples might be possible with typeclass instances. |
The
The "syntax sugar" description refers to how the caret operator works in Cabal/ The "automatically inferred upper bound" description is also valid today -- in that sense, there will be no changes to the semantics of the caret operator in the future. However, current implementation is able to infer only trivial upper bounds (i.e. The long-term plan is to implement more advanced automatic inference of upper bounds -- releasing The reason we need new syntax to distinguish between weak (caret-style) and strong ( So to me (and to @Blaisorblade, it seems) this future scheme looks not much different from |
That makes sense and is about what I expected based on haskell/cabal#4575. It sounds like the Hackage matrix builder will make use of relaxing Also, does that mean that the |
More or less, though the process will likely be fully automatic edit: It will most likely work via
So this will transform
edit: I talked with @hvr, and he thinks that automatically relaxing lower bounds will be also feasible, since the machinery required for that is essentially the same as for relaxing upper bounds. |
Thanks again for clarifying @23Skidoo. My confusion comes from the fact that the private discussions I've been included in have been discussing soft bounds/ |
I talked with @hvr about future plans for automatic bounds relaxation, and while the full solution will have some additional parts (like a tool for PVP compliance checking), the big picture I described in the comment above is basically correct. I also updated my reply to @tfausak above. |
Sounds like Hackage will treat However, it sounds like Cabal will actually treat |
Alright, I'm going to close this issue and leave the behavior as is currently implemented (doing whatever Cabal-the-library does). If there are changes in the future, it will affect the entire ecosystem, so may as well join the crowd. |
Cabal 2.0 introduces a new operator,
^>=
. The next release of Stack will be the first release to support this format. The documented meaning of^>=
, and the behavior of the built-in helper functions in Cabal (the library), is to treat^>= x.y.z
as identical to>= x.y.z && < x.(y + 1)
(with some more clarification around single component version numbers).There has additionally been discussion ongoing in a number of places about this operator implying a "soft bound," and instead of requiring build tools to respect a bound, use it as evidence of prior build success to support the dependency solving case.
This leaves the question for Stack: how should we treat this operator. I can think of four options:
foo ^>= 1.2.3
, Stack will refuse to build it withfoo-1.3
(unlessallow-newer
is used).^>=
bounds. Note that this is in complete contradiction of the Cabal docs themselves, but appears to be the intended direction for the future.^>=
operator entirely. This may sound nice as a stop-gap until this situation is sorted out upstream, but Hackage is already allowing packages to be uploaded with this new operator, so such a move will disallow their usage with Stack.^>=
operator indicating that the semantics of the operator may change in a future release.I'm opening this issue on the Stack issue tracker, but it also impacts Stackage. In the Stackage case, it's easier to argue for a ruling of (3), since we already impose restrictions on which packages from Hackage are accepted.
I think my preferences are:
My feelings aren't strong on this though, I'd love to hear other thoughts.
The text was updated successfully, but these errors were encountered: