cabal icon indicating copy to clipboard operation
cabal copied to clipboard

multi-repl fails with internal library mixins: incorrectly reports module not exposed

Open cgeorgii opened this issue 1 month ago • 4 comments

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:

  1. Clone the minimal reproduction: https://github.com/cgeorgii/cabal-multi-repl-mixin-bug

  2. Build the project (this succeeds): $ cabal build all

  3. 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
  • cabal version: 3.16
  • ghc version: 9.10.3

Additional context The package structure includes:

  • An internal library prelude that exposes the module MyPrelude
  • A main library that depends on multi-repl-mixin-bug:prelude with 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

cgeorgii avatar Dec 02 '25 13:12 cgeorgii

Thanks for the report! Looks like a dup of #11300

ulysses4ever avatar Dec 02 '25 14:12 ulysses4ever

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?

cgeorgii avatar Dec 02 '25 15:12 cgeorgii

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

ulysses4ever avatar Dec 02 '25 15:12 ulysses4ever

I imagine this is the same as #10181 ?

mpickering avatar Dec 04 '25 12:12 mpickering

I imagine this is the same as #10181 ?

Not sure. The error message looks different to me 🤔

cgeorgii avatar Dec 17 '25 12:12 cgeorgii