haskell-CI / haskell-ci

Scripts and instructions for using CI services (e.g. Travis CI or Appveyor) with multiple GHC configurations
GNU General Public License v3.0
431 stars 70 forks source link

Make `any` constraints configurable #728

Closed RyanGlScott closed 1 month ago

RyanGlScott commented 1 month ago

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 https://github.com/haskell/cabal/issues/9917#issuecomment-2134882778.

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 commented 1 month ago

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

The https://github.com/haskell/cabal/issues/9917#issuecomment-2134882778 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

RyanGlScott commented 1 month ago

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 https://github.com/haskell/cabal/issues/9917#issuecomment-2134882778.