Opened 22 months ago

Last modified 22 months ago

#11556 new bug

GHC recompiles unchanged hs-boot files

Reported by: thomie Owned by:
Priority: normal Milestone:
Component: Driver Version: 7.10.3
Keywords: Cc: ezyang
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: driver/recomp002/recomp002
Blocked By: Blocking:
Related Tickets: #11013, #10333 Differential Rev(s):
Wiki Page:

Description

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, which contains 644 .hs and 642 .hs-boot files)

Change History (2)

comment:1 Changed 22 months ago by thomie

Test Case: driver/recomp002/recomp002

Please tell me this is indeed a bug.

For a testsuite testcase, append the following two lines to testsuite/tests/driver/recomp002/Makefile.

	touch W.hs
	'$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) --make Q.hs

Only W.hs should get recompiled, not W.hs-boot.

comment:2 Changed 22 months ago by ezyang

The underlying cause of this issue is, I believe, the same as #10333 (https://ghc.haskell.org/trac/ghc/ticket/10333#comment:2). Since A.hi is not successfully compiled, we will always consider A.hi-boot as unstable (and we'll report that it is modified).

Note: See TracTickets for help on using tickets.