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

Make any constraints configurable #728

Closed
RyanGlScott opened this issue May 28, 2024 · 2 comments
Closed

Make any constraints configurable #728

RyanGlScott opened this issue May 28, 2024 · 2 comments

Comments

@RyanGlScott
Copy link
Contributor

RyanGlScott commented May 28, 2024

After #727, haskell-ci uses any in all generated installed constraints. While I agree with this change in principle, in practice it prevents cabal from picking a build plan for one of my projects that uses a custom Setup.hs script. See haskell/cabal#9917 (comment).

Unfortunately, I am not aware of a workaround for this problem other than to remove the any constraint altogether. Would you agree to adding a haskell-ci configuration option that allows toggling the use of any in the generated constraints? (Perhaps it could be called --installed-any to mirror the existing --installed flag.) That way, I could work around this problem without needing to resort to patching the generated YAML file manually.

@phadej
Copy link
Collaborator

phadej commented May 28, 2024

@RyanGlScott you can configure which dependencies are constraint with installed:. E.g. to disable it all together installed: -all, or selectivelyinstalled: +all -Cabal.

The haskell/cabal#9917 (comment) is however the true issue, and I'm not keen into working around cabal-install release management troubles.

EDIT: The purpose of the check is to constraint that the package is built against GHC-bundled dependencies. This includes ./Setup and also build-tool-depends dependencies. C.f. nixpkgs and Stackage setups, these cannot use multiple versions of same package (AFAIK, maybe the situation has improved).

The flip-side is that there might be restrictive setup-depends, which is not caught if any. is not used. E.g. https://github.com/haskell/entropy/blob/f33d65001e96eb947879eb886840546787d556f3/entropy.cabal#L34

@phadej phadej closed this as completed May 28, 2024
@RyanGlScott
Copy link
Contributor Author

Thanks, @phadej. I can confirm that adding installed: +all -Cabal -Cabal-syntax to my cabal.haskell-ci file suffices to work around the issue described in haskell/cabal#9917 (comment).

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

No branches or pull requests

2 participants