cabal
cabal copied to clipboard
Cabal multi-repl doesn't consider ghc-options in cabal.project
Describe the bug
When using cabal with multi-repl feature enabled, cabal doesn't pass ghc-options defined in cabal.project either under the specific package <package-name> or under program-options
To Reproduce Steps to reproduce the behavior:
- Clone the repo https://github.com/pranaysashank/cabal-multi-repl-bug
- Run
cabal repl all, notice the error about ExplicitNamespaces - Enable
TypeFamiliesorExplicitNamespaceson top of theMyLibmodule infoo/src/MyLib.hs - Run
cabal repl allagain and notice it loads fine
Expected behavior A clear and concise description of what you expected to happen.
Multi-repl should consider ghc-options just the same as normal repl, I also think the release should be on hold until this issue is fixed.
System information
- Operating system: nixos
cabal,ghcversions: 3.11, 9.8.2
Additional context Add any other context about the problem here.
- This affects
haskell-language-serveras well when used in multi-repl mode - We enable a bunch of ghc-options under program-options in cabal.project to enable them for all packages at once, so it'd be nice if multi repl works with this as well.
I put up a fix in #10017
Someone should add your example as a test, thanks for providing a nice minimal reproducer.
@mpickering thanks for the quick fix, I can confirm it works. I have a new issue: when the ghc-options field contains +RTS <options> -RTS this seems to break the parser and I get the error: target +RTS is not a module or a source file. I guess this should be a hls bug, since everything works fine with cabal repl all (my only compliant is it's very slow to begin compilation)