`-hide-package` and .ghc.environment files
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
I can't figure out how to `-hide-package` in the presence of `.ghc.environment` files, which renders my application unusable unless I manually edit the automatically-generated environment file each time
**To Reproduce**
Steps to reproduce the behavior:
1. Clone https://github.com/gibiansky/IHaskell/
1. Checkout `a442c0b6d4cf1fb17eaa3bf2827f04b21ad334bf` (current master as of this writing)
1. Change the `cabal.project` file to avoid building any `ihaskell-display` packages:
```
packages: .
./ipython-kernel
./ghc-parser
```
1. Install Jupyter and system dependencies
1. `cabal v2-run -- ihaskell install`
1. `cabal v2-exec -- jupyter notebook` and launch a notebook with the Haskell kernel
1. Observe an error like this one: `ihaskell: Ambiguous module name ‘Language.Haskell.TH’: it was found in multiple packages: ghc-lib-parser-8.8.0.20190723 template-haskell-2.14.0.0`
1. `cabal v1-run -- ihaskell install`
1. `cabal v1-exec -- jupyter notebook` and launch a notebook with the Haskell kernel
1. No error is observed.
Additionally, if I edit the environment file that is being used and remove the line referring to `ghc-lib-parser` then the kernel restarts and then works without any errors.
**Expected behavior**
I'm hiding `ghc-lib-parser` to avoid precisely the error above, so my expectation is that Cabal will respect the `-hide-package ghc-lib-parser` flag I am passing to GHC.
**System information**
- NixOS 19.09
- `cabal-install 3.0.0.0`
- `GHC 8.6.5`
Contributor guide
Assessment
This issue has not been assessed yet.