@@ -845,8 +845,10 @@ ensureConfig :: HasEnvConfig env
845
845
ensureConfig newConfigCache pkgDir ExecuteEnv {.. } announce cabal cabalfp task = do
846
846
newCabalMod <- liftIO $ modificationTime <$> getFileStatus (toFilePath cabalfp)
847
847
setupConfigfp <- setupConfigFromDir pkgDir
848
- newSetupConfigMod <- liftIO $ either (const Nothing ) (Just . modificationTime) <$>
849
- tryJust (guard . isDoesNotExistError) (getFileStatus (toFilePath setupConfigfp))
848
+ let getNewSetupConfigMod =
849
+ liftIO $ either (const Nothing ) (Just . modificationTime) <$>
850
+ tryJust (guard . isDoesNotExistError) (getFileStatus (toFilePath setupConfigfp))
851
+ newSetupConfigMod <- getNewSetupConfigMod
850
852
-- See https://github.com/commercialhaskell/stack/issues/3554
851
853
taskAnyMissingHack <- view $ actualCompilerVersionL. to getGhcVersion. to (< mkVersion [8 , 4 ])
852
854
needConfig <-
@@ -905,6 +907,11 @@ ensureConfig newConfigCache pkgDir ExecuteEnv {..} announce cabal cabalfp task =
905
907
TTLocalMutable {} -> writeConfigCache pkgDir newConfigCache
906
908
TTRemotePackage {} -> return ()
907
909
writeCabalMod pkgDir newCabalMod
910
+ -- This file gets updated one more time by the configure step, so get
911
+ -- the most recent value. We could instead change our logic above to
912
+ -- check if our config mod file is newer than the file above, but this
913
+ -- seems reasonable too.
914
+ getNewSetupConfigMod >>= writeSetupConfigMod pkgDir
908
915
909
916
return needConfig
910
917
where
0 commit comments