cabal
cabal copied to clipboard
Multiple Home Units support
Currently (with cabal-install 3.6), when running cabal repl with multiple components, users see the following error message:
$ cabal repl comp1 comp2
cabal: Cannot open a repl for multiple components at once. The targets
'comp1' and 'comp2' refer to different components..
The reason for this limitation is that current versions of ghci do not support
loading multiple components as source. Load just one component and when you
make changes to a dependent component then quit and reload.
The ability to load REPL with multiple components is commonly known as "Multiple Home Units (MHU)". The following blog post by Matthew Pickering (Well-Typed) from January 7, 2022, claims that this feature is implemented in GHC and now it's up to build tools to support it:
- https://well-typed.com/blog/2022/01/multiple-home-units/
I haven't found an issue in Cabal tracking the implementation of Multiple Home Units. There's a similar issue but it seems to be talking about something else:
- https://github.com/haskell/cabal/issues/3659
Yes, I think you are right this is not being added yet and we do need it. PR welcome (perhaps many small PRs, baby step style)
I think we could just have a single point of support for now that turns a repl call with multiple targets into an invocation of ghci with multiple home units. However, that won't be super useful yet, given ghci's apparently limited support of multiple home units still. https://gitlab.haskell.org/ghc/ghc/-/issues/20889
Apparently @wz1000 is working on this?
Yes, I'm working on this. I'll have a patch up shortly.
@wz1000 just a gentle inquiry: do you have any news on that patch you mentioned?
Did #8726 fix this?
Yes #8726 fixed this.