@@ -208,19 +208,19 @@ make MakeActions{..} ms = do
208208 -- MVars for the module's dependencies.
209209 mexterns <- fmap unzip . sequence <$> mapM (readMVar . fst . fromMaybe (internalError "make: no barrier") . flip lookup barriers) deps
210210
211− outputTimestamp <- getOutputTimestamp moduleName
212− dependencyTimestamp <- maximumMaybe <$> mapM (fmap shouldExist . getOutputTimestamp) deps
213− inputTimestamp <- getInputTimestamp moduleName
214−
215− let shouldRebuild = case (inputTimestamp, dependencyTimestamp, outputTimestamp) of
216− (Right (Just t1), Just t3, Just t2) -> t1 > t2 || t3 > t2
217− (Right (Just t1), Nothing, Just t2) -> t1 > t2
218− (Left RebuildNever, _, Just _) -> False
219− _ -> True
220−
221− let rebuild =
222− case mexterns of
223− Just (_, externs) -> do
211+ case mexterns of
212+ Just (_, externs) -> do
213+ outputTimestamp <- getOutputTimestamp moduleName
214+ dependencyTimestamp <- maximumMaybe <$> mapM (fmap shouldExist . getOutputTimestamp) deps
215+ inputTimestamp <- getInputTimestamp moduleName
216+
217+ let shouldRebuild = case (inputTimestamp, dependencyTimestamp, outputTimestamp) of
218+ (Right (Just t1), Just t3, Just t2) -> t1 > t2 || t3 > t2
219+ (Right (Just t1), Nothing, Just t2) -> t1 > t2
220+ (Left RebuildNever, _, Just _) -> False
221+ _ -> True
222+
223+ let rebuild = do
224224 (exts, warnings) <- listen $ do
225225 progress $ CompilingModule moduleName
226226 let env = foldl' (flip applyExternsFileToEnvironment) initEnvironment externs
@@ -236,15 +236,15 @@ make MakeActions{..} ms = do
236236 evalSupplyT nextVar $ codegen renamed env' $ encode exts
237237 return exts
238238 markComplete (Just (warnings, exts)) Nothing
239− Nothing -> markComplete Nothing Nothing
240−
241− if shouldRebuild
242− then rebuild
243− else do
244− mexts <- decodeExterns . snd <$> readExterns moduleName
245− case mexts of
246− Just exts -> markComplete (Just (mempty, exts)) Nothing
247− Nothing -> rebuild
239+
240+ if shouldRebuild
241+ then rebuild
242+ else do
243+ mexts <- decodeExterns . snd <$> readExterns moduleName
244+ case mexts of
245+ Just exts -> markComplete (Just (mempty, exts)) Nothing
246+ Nothing -> rebuild
247+ Nothing -> markComplete Nothing Nothing
248248 where
249249 markComplete :: Maybe (MultipleErrors, ExternsFile) -> Maybe MultipleErrors -> m ()
250250 markComplete externs errors = do