multi-repl fails with internal library mixins: incorrectly reports module not exposed
Describe the bug
cabal repl --enable-multi-repl all fails when using an internal library with mixins to rename a
module, incorrectly reporting that the module is not exposed. The same package configuration
works correctly with cabal build all, indicating the issue is specific to multi-repl's handling
of internal library mixins.
To Reproduce Steps to reproduce the behavior:
-
Clone the minimal reproduction: https://github.com/cgeorgii/cabal-multi-repl-mixin-bug
-
Build the project (this succeeds): $ cabal build all
-
Try to load all components in multi-repl (this fails): $ cabal repl --enable-multi-repl all
The error is:
Error:
Package 'multi-repl-mixin-bug-0.1.0.0' does not expose the module 'MyPrelude'
In mixins: multi-repl-mixin-bug:prelude (MyPrelude as Prelude)
In the stanza library
Expected behavior
cabal repl --enable-multi-repl all should succeed and load all components (internal library,
main library, executable, and test suite) into a multi-repl session, just as cabal build all
successfully builds them.
System information
- Operating system: Linux
-
cabalversion: 3.16 -
ghcversion: 9.10.3
Additional context The package structure includes:
- An internal library
preludethat exposes the moduleMyPrelude - A main library that depends on
multi-repl-mixin-bug:preludewith mixin:(MyPrelude as Prelude) - An executable and test suite using the same mixin pattern
Since cabal build all succeeds, this confirms the internal library correctly exposes
MyPrelude and the mixin syntax is valid. The issue appears to be that multi-repl incorrectly
processes or validates internal library mixins.
Complete reproduction repository: https://github.com/cgeorgii/cabal-multi-repl-mixin-bug
Thanks for the report! Looks like a dup of #11300
Well, I saw that issue when looking for duplicates but it didn't look exactly the error I was hitting. 🤷
Would you like me to close this and add context to #11300?
No, I haven't looked too close into it, and I trust you more on this one if you say they look dissimilar. Let's wait for our multi-repl gurus e.g. @mpickering
I imagine this is the same as #10181 ?