[GHC] #14757: ghc recompilation check doesn't take into account headers directly included by CApiFFI

#14757: ghc recompilation check doesn't take into account headers directly included by CApiFFI -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Keywords: capi capiffi | Operating System: Unknown/Multiple cpp | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Continuing from #14756, given the following simple module {{{#!hs {-# LANGUAGE CPP, CApiFFI #-} #include "Bar.hs.inc" module Foo where foreign import capi unsafe "cbits.h foo" c_foo :: Int -> IO () }}} After having compiled `ghc -c Foo.hs` successfully, and second invocation of `ghc -c Foo.hs` - ...will properly recompile when `Bar.hs.inc` changes (or any of its recursive `#include`s!) (good!) - ...will fail to detect when `cbits.h` changes, and thus claim `compilation IS NOT required` (BAD!) Ideally, we should always run CPP for the CApiFFI-included, in order to detect when any recursive `#include`s inside `cbits.h` change, and use a recorded checksum to detect whether recompilation of the C wrapper (and thus re-linking of the haskell module; which currently forces resynthesizing the object files) is necessary. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14757 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC