#5753: ghci doesn't always use compiled modules
---------------------+------------------------------------------------------
Reporter: rl | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.2.1 | Keywords:
Os: Windows | Architecture: Unknown/Multiple
Failure: Other | Testcase:
Blockedby: | Blocking:
Related: |
---------------------+------------------------------------------------------
Here is a small program:
{{{
module T where
foo :: Int -> Int
foo n = n+1
}}}
{{{
module U where
import T
main = print (foo 1)
}}}
Now I do this:
{{{
$ ghc -c T.hs
$ runhaskell -v U.hs
...
[1 of 2] Skipping T ( T.hs, T.o )
...
$ touch T.hs
$ runhaskell -v U.hs
...
[1 of 2] Compiling T ( T.hs, interpreted )
...
$ ghc -c T.hs -fforce-recomp
$ runhaskell -v U.hs
...
[1 of 2] Compiling T ( T.hs, interpreted )
...
}}}
Note that `runhaskell` doesn't use `T.o` even though I recompiled `T`. As
far as I understand, this is because compilation has regenerated `T.o` but
hasn't updated `T.hi` because the interface hasn't changed. So `T.hi` is
older than `T.hs` and `ghci` seems to ignore the compiled version in this
case. I'm not sure why the `.hi` file's timestamped is checked here, it
seems that checking the `.o` file should be sufficient.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5753>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs