diff --git a/Cabal/Distribution/Compat/Time.hs b/Cabal/Distribution/Compat/Time.hs index 2a6a8ea0c41..a3f4895ed6d 100644 --- a/Cabal/Distribution/Compat/Time.hs +++ b/Cabal/Distribution/Compat/Time.hs @@ -16,8 +16,8 @@ import Distribution.Compat.Prelude import System.Directory ( getModificationTime ) -import Distribution.Simple.Utils ( withTempDirectory ) -import Distribution.Verbosity ( silent ) +import Distribution.Simple.Utils ( debug, withTempDirectory ) +import Distribution.Verbosity ( deafening, silent ) import System.FilePath @@ -193,10 +193,11 @@ calibrateMtimeChangeDelay = sampleMtimes :: FilePath -> IO [Int] sampleMtimes fileName = do mtime0 <- sampleMtime 1 fileName + debug deafening $ "mtime0: " ++ show mtime0 -- Some filesystems (e.g. HFS+ on Mac) store mtimes with 1 -- second resolution. Bail out directly instead of spinning in -- that case. - if (mtime0 >= 1000000) || (1000000 - mtime0 <= 10000) + if (mtime0 >= 1000000) || (1000000 - mtime0 <= 100000) then return [mtime0] else do mtimes <- for [2..25] $ \(i::Int) -> sampleMtime i fileName return (mtime0:mtimes)