Skip to content
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

cabal-version is not set properly when using ^>= bounds #213

Closed
quasicomputational opened this issue Nov 8, 2017 · 4 comments
Closed

cabal-version is not set properly when using ^>= bounds #213

quasicomputational opened this issue Nov 8, 2017 · 4 comments

Comments

@quasicomputational
Copy link
Contributor

When ^>= is used, cabal-version needs to be at least 2.0. Hpack doesn't check for this, though.

@sol
Copy link
Owner

sol commented Nov 22, 2017

A PR would be more than welcome.

@tfausak
Copy link
Collaborator

tfausak commented Dec 11, 2017

For what it's worth, Cabal itself doesn't check for this either. If you run cabal check against a package description with ^>= bounds and cabal-version: >= 1.10, it will succeed.

Edited to add: Nevermind. I was wrong. cabal check correctly notices this problem.

@sol
Copy link
Owner

sol commented Feb 6, 2018

What we can do is parse ^>= and expand it as per the semantics given at https://www.haskell.org/cabal/users-guide/developing-packages.html#pkg-field-build-depends.

Independent from that, I think we want some syntactic sugar for version ranges, where he lower bound is inclusive and the upper bound is exclusive. Stuff like base >= 4.3.0.0 && < 5 is so common that I think it deserves dedicated support. I'm just not sure what the syntax would be, maybe

foo: x ~ y  # this desugars to ">= x && < 5"

If anybody has input on this, please comment!

@sol sol self-assigned this Feb 6, 2018
@tfausak
Copy link
Collaborator

tfausak commented Feb 6, 2018

Adding custom operators reminds me of #91. I don't think it's a bad idea per se, but it could get tricky if Cabal ends up using the same operator for something else. I think it would be better to lobby for the change in Cabal, then add it to hpack for users that aren't on the latest Cabal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants