--enable-multi-repl --repl-no-load panics with "link: GHC not built to link this way: LinkInMemory"
Describe the bug
I have a multi-package project setup. I tried to load two packages with cabal repl --enable-multi-repl --repl-no-load and it fails:
[armando@nixos:~/work/my-project/haskell]$ cabal repl --enable-multi-repl --repl-no-load my-project:library:my-project my-project-interface:library:my-project-interface
Warning: The package list for 'hackage.haskell.org' is 453 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Build profile: -w ghc-9.10.3 -O1
In order, the following will be built (use -v for more details):
- my-project-interface-0.1.0.0 (interactive) (lib) (configuration changed)
- my-project-0.1.0.0 (interactive) (lib) (configuration changed)
Configuring library for my-project-interface-0.1.0.0...
Preprocessing library for my-project-interface-0.1.0.0...
Configuring library for my-project-0.1.0.0...
Preprocessing library for my-project-0.1.0.0...
GHCi, version 9.10.3: https://www.haskell.org/ghc/ :? for help
ghc-9.10.3: panic! (the 'impossible' happened)
GHC version 9.10.3:
link: GHC not built to link this way: LinkInMemory
CallStack (from HasCallStack):
panic, called at compiler/GHC/Driver/Pipeline.hs:382:22 in ghc-9.10.3-b976:GHC.Driver.Pipeline
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
To Reproduce
- Create a multi-package project (i.e. multiple packages in a
cabal.project) - Try to load multiple packages with
cabal repl --enable-multi-repl --repl-no-load
Expected behavior
I expect a REPL to pop without loading any modules. And then I expect to be able to load any module and have it + its transitive deps loaded (across the packages)
System information
- NixOS 24.05.20240512.2057814 (Uakari)
-
ghc9.10.3 -
cabal3.16.0.0
Additional context Add any other context about the problem here.
--repl-no-load and --enable-multi-repl don't work together at the moment.
In 9.14, GHC will have a specific flag which will allow --repl-no-load to be implemented in a more robust manner (see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/14448). Cabal will have to be adopted to use this flag when GHC supports it.