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

Support for GHC version (range) specific flags. #564

Open
merijn opened this issue Dec 2, 2021 · 2 comments
Open

Support for GHC version (range) specific flags. #564

merijn opened this issue Dec 2, 2021 · 2 comments

Comments

@merijn
Copy link
Contributor

merijn commented Dec 2, 2021

When using -Werror on CI, the fact that warning flags change over time can lead to issues where code cannot be warning free across all supported versions. A solution is to toggle of certain warnings for specific GHC versions, but currently there is no way to specify --local-ghc-options for only some GHC versions.

The missing-methods warning is currently special-cased via cfgErrorMissingMethods, it would be nice if we could generalise this to specify "GHC flags per version range".

@phadej
Copy link
Collaborator

phadej commented Dec 2, 2021

So far all per-GHC options where configured like:

tests: >= 9.0

-- or
werror: >=9.0

i.e. we have a very specific thing and we set a compiler version when it's enabled.

With things like ghc-options it's hard(er) as I don't know how we would configure them.

if impl(ghc >=9.0)
  local-ghc-options: ...

is one idea, but I don't know how to elegantly implement it.

I'm fine with adding werror option. The more general approach: feel free to try, but do not be offended if I wont merge the patch.

@phadej
Copy link
Collaborator

phadej commented Jan 5, 2022

The haskell/cabal#7783 once released will force us to think about this, especially

if impl(ghc >=9.0)
  local-ghc-options: ...

I might or might not try stuff before hand.

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