on master help sign in
static: Use polling fsnotify backend on macOS due to upstream issue
commit71dd69abed8bb2b7a12e301b55e66bbc7e3de05d authorAli Abrar <aliabrar@gmail.com> dateTue 22 Dec 2020, 19:06 (6 years ago) parent5fd9e1d
1 file changed+4−2
lib/command/src/Obelisk/Command/Project.hs+4−2
lib/command/src/Obelisk/Command/Project.hs+4−2
@@ -51,7 +51,8 @@ import System.Directory
5151import System.Environment (lookupEnv)
5252import System.Exit (ExitCode(..))
5353import System.FilePath
54−import System.FSNotify (defaultConfig, eventPath)
54+import System.FSNotify (defaultConfig, eventPath, WatchConfig(..))
55+import qualified System.Info as SysInfo
5556import System.IO.Temp
5657import System.IO.Unsafe (unsafePerformIO)
5758import System.PosixCompat.Files
@@ -405,7 +406,8 @@ watchStaticFilesDerivation root = do
405406 liftIO $ runHeadlessApp $ do
406407 pb <- getPostBuild
407408 checkForChanges <- batchOccurrences 0.25 =<< watchDirectoryTree
408− defaultConfig
409+ -- On macOS, use the polling backend due to https://github.com/luite/hfsevents/issues/13
410+ (defaultConfig { confUsePolling = SysInfo.os == "darwin", confPollInterval = 250000 })
409411 (root <$ pb)
410412 ((/="static.out") . takeFileName . eventPath)
411413 drv <- performEvent $ ffor checkForChanges $ \_ ->