Skip to content

GHC recompiles unchanged hs-boot files

A.hs:

module A where

import B

f = someError

A.hs-boot:

module A where

B.hs:

module B where

import {-# SOURCE #-} A
$ ghc-7.10.3 --make A.hs
[1 of 3] Compiling A[boot]          ( A.hs-boot, A.o-boot )
[2 of 3] Compiling B                ( B.hs, B.o )
[3 of 3] Compiling A                ( A.hs, A.o )

A.hs:5:5: Not in scope: ‘someError’


$ ghc-7.10.3 --make A.hs
[1 of 3] Compiling A[boot]          ( A.hs-boot, A.o-boot )
[3 of 3] Compiling A                ( A.hs, A.o )

A.hs:5:5: Not in scope: ‘someError’

Why does ghc --make recompile B.hs-boot?

Note that recompilation avoidance does work when using ghc -c:

$ ghc -c A.hs-boot
compilation IS NOT required

(found while trying to reduce the testcase for #11532 (closed), which contains 644 .hs and 642 .hs-boot files)

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