
#12135: Failure to recompile when #include file is created earlier on include path -------------------------------------+------------------------------------- Reporter: NeilMitchell | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * component: Compiler => Driver @@ -4,1 +4,1 @@ - If you create a file {{{Test.hs}}} + If you create a file {{{Main.hs}}} @@ -7,1 +7,1 @@ - #include "a/Test.hs" + #include "Test.h" @@ -17,4 +17,4 @@ - Then run and compile with {{{ghc --make -XCPP -Ib;a Main.hs}}} it compiles - and runs properly, printing 1. Changing {{{a/Test.h}}} to {{{message = - 2}}} then running {{{ghc}}} rebuilds and prints 2. Creating a fresh - {{{b/Test.h}}} with {{{message = 3}}} does not cause {{{ghc}}} to + Then run and compile with {{{ghc --make -XCPP -Ib -Ia Main.hs}}} it + compiles and runs properly, printing 1. Changing {{{a/Test.h}}} to + {{{message = 2}}} then running {{{ghc}}} rebuilds and prints 2. Creating a + fresh {{{b/Test.h}}} with {{{message = 3}}} does not cause {{{ghc}}} to New description: Originally discovered when trying to improve Hadrian, for context see: https://github.com/snowleopard/hadrian/issues/247#issuecomment-222317602 If you create a file {{{Main.hs}}} {{{#!hs #include "Test.h" main = print message }}} And a file {{{a/Test.h}}} {{{#!hs message = 1 }}} Then run and compile with {{{ghc --make -XCPP -Ib -Ia Main.hs}}} it compiles and runs properly, printing 1. Changing {{{a/Test.h}}} to {{{message = 2}}} then running {{{ghc}}} rebuilds and prints 2. Creating a fresh {{{b/Test.h}}} with {{{message = 3}}} does not cause {{{ghc}}} to recompile, and thus incorrectly still prints 2. Touching {{{Main.hs}}} causes recompilation, and then the correct header file is picked up, resulting in 3 being printed. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12135#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler