From 7ce6b4fcefec5cf56e422a3072ef148424bd586b Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Fri, 1 May 2020 19:53:43 +0200 Subject: Add call to addDependentFile to track TH dependencies Cabal still doesn't really know about these depencies and will only start GHC if it needs to rebuild for other reasons. However! Since all the files we pull in are source files for the library anyways it all works out. --- src/CabalHelper/Compiletime/Data.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/CabalHelper/Compiletime/Data.hs') diff --git a/src/CabalHelper/Compiletime/Data.hs b/src/CabalHelper/Compiletime/Data.hs index 9586c77..8b47997 100644 --- a/src/CabalHelper/Compiletime/Data.hs +++ b/src/CabalHelper/Compiletime/Data.hs @@ -10,7 +10,6 @@ -- http://www.apache.org/licenses/LICENSE-2.0 {-# LANGUAGE TemplateHaskell, ScopedTypeVariables, CPP #-} -{-# OPTIONS_GHC -fforce-recomp #-} {-| Module : CabalHelper.Compiletime.Data @@ -30,6 +29,7 @@ import qualified Data.ByteString.UTF8 as UTF8 import qualified Data.ByteString.Lazy as LBS import qualified Data.ByteString.Lazy.UTF8 as LUTF8 import Language.Haskell.TH +import Language.Haskell.TH.Syntax (addDependentFile) import System.Directory import System.FilePath import System.IO.Temp @@ -86,7 +86,9 @@ runtimeSources = $( , ("Shared/InterfaceTypes.hs") ] in do - contents <- mapM (\lf -> runIO (LBS.readFile lf)) $ map snd files + contents <- forM (map snd files) $ \lf -> do + addDependentFile lf + runIO (LBS.readFile lf) let hashes = map (bytestringDigest . sha256) contents let top_hash = showDigest $ sha256 $ LBS.concat hashes -- cgit v1.2.3