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 ignores the 'cabal-version' field when solving for setup dependencies #3751

Open
grayjay opened this issue Sep 1, 2016 · 8 comments
Open

Comments

@grayjay
Copy link
Collaborator

grayjay commented Sep 1, 2016

This can cause the build to fail when the setup-depends range for Cabal is less restrictive than the cabal-version for a given package. See #3723 (comment).

The current behavior is technically correct, because it is possible for a setup script to depend on one version of Cabal and implement the command interface from a different version. I think it would be better to prevent build failures in the more common case, though.

One solution is to update the setup-depends constraint on Cabal to reflect cabal-version before dependency solving.

@23Skidoo
Copy link
Member

23Skidoo commented Sep 1, 2016

This can cause the build to fail when the setup-depends range for Cabal is less restrictive than the cabal-version for a given package.

Can't we just make this an error in D.PD.Check?

@grayjay
Copy link
Collaborator Author

grayjay commented Sep 1, 2016

Yeah, that would also work. Is it okay if existing packages fail the check?

@23Skidoo
Copy link
Member

23Skidoo commented Sep 1, 2016

I think that we already have some (obsolete) packages on Hackage that fail cabal check.

@ezyang
Copy link
Contributor

ezyang commented Sep 6, 2016

@grayjay Are you planning to fix this bug? If so assign yourself and milestone this to 2.0 ;)

@grayjay
Copy link
Collaborator Author

grayjay commented Sep 7, 2016

I wasn't planning on fixing this soon.

@ezyang ezyang modified the milestones: , Triaged Sep 7, 2016
@ezyang
Copy link
Contributor

ezyang commented Sep 7, 2016

OK, I milestoned this appropriately.

@grayjay
Copy link
Collaborator Author

grayjay commented May 2, 2018

It might be better to add an implicit constraint, as in #5184, because that would also work when there is no direct dependency on Cabal. For example, a setup script could only declare a dependency on cabal-doctest.

@andreasabel
Copy link
Member

Here is a recent case of this in the wild:

cairo specifies cabal-version: 3.0, but in the custom setup only Cabal >= 2.0, so a recent cabal-install >= 3 can parse the cabal file, but the generated setup command build with Cabal < 3 then crashes as it does not understand this cabal file format.

So, cabal check should check that the constraint on Cabal for the setup should be at least cabal-version.

@grayjay wrote:

It might be better to add an implicit constraint

I also think that an implicit constraint is in order; everything else is counterintuitive. cabal check should still warn.

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

4 participants