Skip to content

GHC seems to ignore the package name of modules imported with {#- SOURCE #-}

I have attached an archive with source bundles of two small Cabal packages A and B. Please build and register package A by executing these commands in directory A:

runghc Setup.lhs configure --user
runghc Setup.lhs build
runghc Setup.lhs register --inplace

Now try to build B by executing these commands in directory B:

runghc Setup.lhs configure --user
runghc Setup.lhs build

You will probably get the following error message:

B.hs:6:9:
    Bad interface file: .../Bug/A/dist/build/Internal.hi-boot
        .../Bug/A/dist/build/Internal.hi-boot:
            openBinaryFile: does not exist (No such file or directory)
    In the type `A'
    In the type signature for `a':
      a :: A

The type A is indirectly imported from module Internal of package A. GHC seems to think that this module was imported with a {-# SOURCE #-} pragma and therefore looks for a .hi-boot file instead of a .hi file. However, it’s the module Internal of package B that was imported with a {-# SOURCE #-} pragma.

Trac metadata
Trac field Value
Version 6.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information