Proposal: Don't read environment files by default

Bardur Arantsson spam at
Thu Mar 28 17:01:44 UTC 2019

On 28/03/2019 14.58, Oleg Grenrus wrote:
> There is. Add
>     write-ghc-environment-files: never
> to your ~/.cabal/config assuming you have cabal-insall- or later.

That doesn't really work if you actually want to be able to use both
ways of working, does it? That same thing applies to


which someone else posted, but at least that can be done by tooling
before invoking ghc. It's odd to have to change a global setting to
avoid this. (However, thanks for the hints -- I'll be setting that
GHC_ENVIRONMENT from now on.)

+1 for changing the default.

It seems really weird to force other tooling to opt out when this could
easily be solved by just having

   cabal ghci
   cabal ghc

commands which set up the environment properly and tell users to use
that if they want to use cabal's environment files. FWIW, I also see
e.g. ghc as low-level tooling akin to the plain 'gcc' command whereas
e.g. cabal or stack are more like cmake + make/ninja, i.e. it's not
something users should really be running unless they know what they're
doing *and* it should be as tooling-friendly as possible.


More information about the ghc-devs mailing list