Skip to content

EXTRA_HC_OPTS not passed to all compiler invocations when using cabal-3.8.1.0

In cabal 3.8.1.0 --ghc-options specified on command line only passes the options to local packages. Therefore setting EXTRA_HC_OPTS=-dcore-lint will only pass the option to the top-level package when it's built but none of the dependencies. This at least wastes work later if we try and recompile a dependency, or worse, it might just be we never compile it with core-lint.

Instead we should modify the cabal.project and add a section like:

package *
   ghc-options: -dcore-lint