[GHC] #14923: Recompilation avoidance fails after a LANGUAGE change
GHC
ghc-devs at haskell.org
Thu Mar 15 04:36:09 UTC 2018
#14923: Recompilation avoidance fails after a LANGUAGE change
-------------------------------------+-------------------------------------
Reporter: akio | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.4.1
Keywords: | Operating System: Linux
Architecture: | Type of failure: Compile-time
Unknown/Multiple | performance bug
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
It looks like the recompilation checker can be confused when a LANGUAGE
pragma is added or removed.
The following shell script demonstrates the issue:
{{{
#!/bin/sh
cat >Foo.hs <<END
{-# LANGUAGE UndecidableInstances #-}
module Foo where
END
rm -f Foo.hi Foo.o
ghc -c Foo.hs; ghc --show-iface Foo.hi | grep flag
sed -i 's/^{-#/--&/' Foo.hs # comment out the pragma
ghc -c Foo.hs; ghc --show-iface Foo.hi | grep flag
ghc -c Foo.hs; ghc --show-iface Foo.hi | grep flag
ghc -c Foo.hs; ghc --show-iface Foo.hi | grep flag
}}}
I get this output:
{{{
% ./bug.sh
flag hash: b1ada48735eec2ef16d5070887aa7f10
flag hash: b1ada48735eec2ef16d5070887aa7f10
flag hash: e7b294090e04f1a84f0bfc9b8cc49322
compilation IS NOT required
flag hash: e7b294090e04f1a84f0bfc9b8cc49322
}}}
In the third invocation to GHC, I expect the recompilation checker to
detect that compilation is not required, because nothing has changed since
the second invocation. Also it seems suspicious that the flag hash changes
beteen the second run and the third run.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14923>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list