Workaround for compatibility with older fsnotify

This commit is contained in:
Michael Snoyman 2016-11-23 15:59:58 +02:00
parent 6048a2c9bf
commit ab4d6540ca

View File

@ -22,6 +22,7 @@ import Data.FileEmbed (embedFile)
import qualified Data.Map as Map import qualified Data.Map as Map
import Data.Streaming.Network (bindPortTCP, import Data.Streaming.Network (bindPortTCP,
bindRandomPortTCP) bindRandomPortTCP)
import Data.String (fromString)
import Data.Time (getCurrentTime) import Data.Time (getCurrentTime)
import qualified Distribution.Package as D import qualified Distribution.Package as D
import qualified Distribution.PackageDescription as D import qualified Distribution.PackageDescription as D
@ -313,8 +314,10 @@ devel opts passThroughArgs = do
-- Start watching the signal file, and set changedVar to -- Start watching the signal file, and set changedVar to
-- True each time it's changed. -- True each time it's changed.
void $ watchDir manager void $ watchDir manager
(takeDirectory develSignalFile') -- Using fromString to work with older versions of fsnotify
(\e -> eventPath e == develSignalFile') -- that use system-filepath
(fromString (takeDirectory develSignalFile'))
(\e -> eventPath e == fromString develSignalFile')
(const $ atomically $ writeTVar changedVar True) (const $ atomically $ writeTVar changedVar True)
-- Alright, watching is set up, let the build thread know -- Alright, watching is set up, let the build thread know