fsnotify 0.4.3.0 → 0.4.4.0
raw patch · 5 files changed
+29/−26 lines, 5 filesdep ~hinotifyPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hinotify
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- fsnotify.cabal +11/−20
- src/System/FSNotify.hs +4/−4
- test/FSNotify/Test/EventTests.hs +2/−2
- test/FSNotify/Test/Util.hs +7/−0
CHANGELOG.md view
@@ -1,6 +1,11 @@ Changes ======= +Version 0.4.4.0+----------+* Use hinotify and -DHAVE_NATIVE_WATCHER for FreeBSD (#121)+* Start testing FreeBSD in CI (#122)+ Version 0.4.3.0 ---------- * Use polling as a generic fallback and add support for WASM (https://github.com/haskell-fswatch/hfsnotify/pull/110)
fsnotify.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: fsnotify-version: 0.4.3.0+version: 0.4.4.0 synopsis: Cross platform library for file change notification. description: Cross platform library for file creation, modification, and deletion notification. This library builds upon existing libraries for platform-specific Windows, Mac, and Linux filesystem event notification. category: Filesystem@@ -48,13 +48,9 @@ , time >=1.1 , unix-compat >=0.2 default-language: Haskell2010- if os(linux)- cpp-options: -DOS_Linux -DHAVE_NATIVE_WATCHER- if os(windows)- cpp-options: -DOS_Win32 -DHAVE_NATIVE_WATCHER- if os(darwin)- cpp-options: -DOS_Mac -DHAVE_NATIVE_WATCHER- if os(linux)+ if os(linux) || os(windows) || os(darwin) || os(freebsd)+ cpp-options: -DHAVE_NATIVE_WATCHER+ if os(linux) || os(freebsd) other-modules: System.FSNotify.Linux System.FSNotify.Linux.Util@@ -80,6 +76,9 @@ System.FSNotify.OSX build-depends: hfsevents >=0.1.8+ if os(freebsd)+ build-depends:+ hinotify >=0.4.1 executable example main-is: Main.hs@@ -105,12 +104,8 @@ , unix-compat , unliftio default-language: Haskell2010- if os(linux)- cpp-options: -DOS_Linux -DHAVE_NATIVE_WATCHER- if os(windows)- cpp-options: -DOS_Win32 -DHAVE_NATIVE_WATCHER- if os(darwin)- cpp-options: -DOS_Mac -DHAVE_NATIVE_WATCHER+ if os(linux) || os(windows) || os(darwin) || os(freebsd)+ cpp-options: -DHAVE_NATIVE_WATCHER if !arch(wasm32) ghc-options: -threaded @@ -142,12 +137,8 @@ , unix-compat , unliftio >=0.2.20 default-language: Haskell2010- if os(linux)- cpp-options: -DOS_Linux -DHAVE_NATIVE_WATCHER- if os(windows)- cpp-options: -DOS_Win32 -DHAVE_NATIVE_WATCHER- if os(darwin)- cpp-options: -DOS_Mac -DHAVE_NATIVE_WATCHER+ if os(linux) || os(windows) || os(darwin) || os(freebsd)+ cpp-options: -DHAVE_NATIVE_WATCHER if os(windows) build-depends: Win32
src/System/FSNotify.hs view
@@ -87,15 +87,15 @@ import Data.Monoid #endif -#ifdef OS_Linux+#if defined(linux_HOST_OS) || defined(freebsd_HOST_OS) import System.FSNotify.Linux #endif -#ifdef OS_Win32+#ifdef mingw32_HOST_OS import System.FSNotify.Win32 #endif -#ifdef OS_Mac+#ifdef darwin_HOST_OS import System.FSNotify.OSX #endif @@ -156,7 +156,7 @@ -- | Like 'startManager', but configurable. startManagerConf :: WatchConfig -> IO WatchManager startManagerConf conf = do-# ifdef OS_Win32+# ifdef mingw32_HOST_OS -- See https://github.com/haskell-fswatch/hfsnotify/issues/50 unless rtsSupportsBoundThreads $ throwIO $ userError "startManagerConf must be called with -threaded on Windows" # endif
test/FSNotify/Test/EventTests.hs view
@@ -119,7 +119,7 @@ (if isWin then withSingleWriteFile f "foo" else withOpenWritableAndWrite f "foo") $ waitForEvents getEvents $ \events -> if | nested && not recursive -> events `shouldBe` []- | isMac -> case events of+ | isMac || isFreeBSD -> case events of [Modified {..}] | poll && eventPath `equalFilePath` f && eventIsDirectory == IsFile -> return () [ModifiedAttributes {..}] | not poll && eventPath `equalFilePath` f && eventIsDirectory == IsFile -> return () _ -> expectationFailure $ "Got wrong events: " <> show events <> " (wanted file path " <> show f <> ")"@@ -127,7 +127,7 @@ [Modified {..}] | eventPath `equalFilePath` f && eventIsDirectory == IsFile -> return () _ -> expectationFailure $ "Got wrong events: " <> show events <> " (wanted file path " <> show f <> ")" - when isLinux $ unless poll $ do+ when (isLinux || isFreeBSD) $ unless poll $ do let setup f = liftIO $ do h <- openFile f WriteMode hPutStr h "asdf" >> hFlush h
test/FSNotify/Test/Util.hs view
@@ -78,6 +78,13 @@ isLinux = False #endif +isFreeBSD :: Bool+#ifdef freebsd_HOST_OS+isFreeBSD = True+#else+isFreeBSD = False+#endif+ haveNativeWatcher :: Bool #ifdef HAVE_NATIVE_WATCHER haveNativeWatcher = True