Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cabal multi-repl doesn't consider ghc-options in cabal.project #10015

Closed
pranaysashank opened this issue May 16, 2024 · 2 comments
Closed

Cabal multi-repl doesn't consider ghc-options in cabal.project #10015

pranaysashank opened this issue May 16, 2024 · 2 comments

Comments

@pranaysashank
Copy link

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:

  1. Clone the repo https://github.com/pranaysashank/cabal-multi-repl-bug
  2. Run cabal repl all, notice the error about ExplicitNamespaces
  3. Enable TypeFamilies or ExplicitNamespaces on top of the MyLib module in foo/src/MyLib.hs
  4. Run cabal repl all again 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, ghc versions: 3.11, 9.8.2

Additional context
Add any other context about the problem here.

  • This affects haskell-language-server as 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.
@mpickering
Copy link
Collaborator

I put up a fix in #10017

Someone should add your example as a test, thanks for providing a nice minimal reproducer.

@pranaysashank
Copy link
Author

@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)

Mikolaj pushed a commit to mpickering/cabal that referenced this issue May 24, 2024
mpickering added a commit to mpickering/cabal that referenced this issue May 30, 2024
These options are configured into the program by Cabal, so we also need
to extract these and put them into the mutli-file.

Fixes haskell#10015
mpickering added a commit to mpickering/cabal that referenced this issue May 30, 2024
These options are configured into the program by Cabal, so we also need
to extract these and put them into the mutli-file.

Fixes haskell#10015
@mergify mergify bot closed this as completed in 539cb7b Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants