ghc-pkg on 8.8.1 with cabal 3.0 does not list user installed packages
Summary
ghc-pkg on 8.8.1 with cabal 3.0 does not list user installed packages
Steps to reproduce
Install a package, try to list it with "ghc-pkg list" e.g.
ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.1
cabal --version
cabal-install version 3.0.0.0
bash-3.2$ cabal install QuickCheck
Resolving dependencies...
Up to date
Warning: You asked to install executables, but there are no executables in
target: QuickCheck. Perhaps you want to use --lib to install libraries
instead.
bash-3.2$ cabal install --lib QuickCheck
Resolving dependencies...
Up to date
bash-3.2$ ghc-pkg list|fgrep -i Quick
Expected behavior
I expect ghc-pkg list to show QuickCheck
Environment
- GHC version used: 8.8.1
- Cabal version used: 3.0
Optional:
- Operating System: macOS 10.14.6
- System Architecture: x86-64
Additional context:
Daniel G wrote in https://github.com/haskell/cabal/issues/6262
I think this is expected behaviour, at least from the cabal side of things. Version 3.0.0.0 switched to using v2-build by default so installed libraries are now registered into the "default" package environment file in .ghc//environments/default as well as a package-db in .cabal/store/ghc-/package.db which GHC doesn't know about by itself.
AFAICS ghc-pkg simply doesn't have support for listing package environments which sort of kind of makes sense but also breaks this workflow. I think this should be reported as a GHC bug but I'm not sure it would even be a good idea to add pkg-env support to ghc-pkg.