haskell / haskell/cabal

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

Open
#11,317 6 comments 0 reactions 0 assignees View on GitHub
re: multi-repl type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.