Skip to content

GHC Regression (GHC-87110) mixins not recognized, suggests package is hidden

Summary

Since Version 9.12.2 (did not test 9.12.1) calling cabal repl results in the following Message when using cabal mixins:

*** Exception: <interactive>:1:1: error: [GHC-87110]
    Could not load module `Relude'.
    It is a member of the hidden package `relude-1.2.2.0'.
    Use -v to see a list of the files searched for.

Hope this can be reproduced.

Steps to reproduce

see the following files for a minimal example:

example.cabal:

cabal-version: 3.4

-- This file has been generated from package.yaml by hpack version 0.38.0.
--
-- see: https://github.com/sol/hpack

name:           example
version:        0.1.0.0
description:    Please see the Readme
author:         Christian Berg
maintainer:     Christian Berg
license:        MIT
license-file:   LICENSE
build-type:     Simple

library
  exposed-modules:
      Example
  hs-source-dirs:
      src
  build-depends:
      base
    , relude
  mixins:
      base hiding (Prelude)
    , relude (Relude as Prelude)
  default-language: GHC2024

executable example-exe
  main-is: Main.hs
  hs-source-dirs:
      app
  ghc-options: -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      base
    , example
    , relude
  mixins:
      base hiding (Prelude)
    , relude (Relude as Prelude)
  default-language: GHC2024

app/Main.hs

module Main (main) where

import Example (projectName)

main :: IO ()
main = putStrLn ("Executable for " ++ projectName)

src/Example.hs:

module Example
    ( projectName
    ) where

projectName :: String
projectName = "example"

Expected behavior

I guess ghci should load without error when using mixins

Environment

  • GHC version used: 9.12.2
  • Cabal version used: 3.14.1.1-p1

Optional:

  • Operating System: Linux Mint 22.1
  • System Architecture: x86_64 (Intel Core i9-14900HX)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information