tweag / rules_haskell

Haskell rules for Bazel.
https://haskell.build
Apache License 2.0
266 stars 80 forks source link

Add allow_newer flag to stack_snapshot #1477

Open facundominguez opened 3 years ago

facundominguez commented 3 years ago

When testing an unreleased version of GHC with a haskell project, usually the haskell dependencies have upper bounds that prevent the newer bootstrap libraries from being used.

With stack and cabal one can use a flag allow-newer to try building the packages even when their bounds ask for older libraries.

In the current state of rules_haskell, one has to patch all the packages in the dependency tree that need bounds relaxed.

A more convenient solution would be to add an attribute "allow_newer" to stack_snapshot that directs both stack and cabal to switch on their respective allow-newer flags.

facundominguez commented 3 years ago

Turns out that --allow-newer is supported by cabal-install, but not by Setup.hs/Cabal https://github.com/haskell/cabal/issues/3581

Apparently Setup.hs can be told to ignore the bounds, but then one has to be more explicit about deps and flag settings on the command line. It wouldn't be as simple as passing a flag.