Description
Some people are excited about .ghc.environment files, while others are mildly annoyed. I think there's probable cause to make this configurable on cabal's end.
To this end, I suggest (modulo bikeshed) to implement a flag, e.g. --pkg-environment-scope=LEVEL
, where LEVEL can be one of
all
(default & current behaviour, generate ghc env files with all transitive dependencies of project's (non-qualified) goals)- build-target (e.g.
:pkg:Cabal
orlib:Cabal
orCabal:test:parser-tests
): generate ghc env files containing only the stated goal's /direct/ dependencies) -
(ornone
oroff
ordisable
?): disable generation of any ghc env files
This flag would also be persistable via cabal.project.(local)
.
Note: Item 2. is not the short-term goal of this feature request! I've included the 2. item mostly to motivate why it makes sense to design this to be a flag that's more than merely a boolean --{disable,enable}-package-environment-files
flag.
Btw, a dual feature-request (allowing to opt-out from interpreting .ghc.environment files from GHC's side) has been filed at GHC #13753 -- however, that one will be too late for GHC 8.0.2 users.
Current status:
- Starting with GHC 8.4.3, ghc is more verbose when picking up pkg envs (see http://git.haskell.org/ghc.git/commit/00049e2dce93b1e468c3fde3287371eb988aafdc)
- Starting with GHC 8.4.4, ghc supports the special
-
environment which inhibits the default lookup logic (see http://git.haskell.org/ghc.git/commit/8f3c149d94814e4f278b08c562f06fc257eb3c43)
/cc @RyanGlScott