We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b763b0e commit e7df61aCopy full SHA for e7df61a
1 file changed
src/Stack/FileWatch.hs
@@ -96,9 +96,17 @@ fileWatch inner = withManager $ \manager -> do
96
atomically $ do
97
dirty <- readTVar dirtyVar
98
check dirty
99
- writeTVar dirtyVar False
100
101
eres <- tryAny $ inner setWatched
+
102
+ -- Clear dirtiness flag after the build to avoid an infinite
103
+ -- loop caused by the build itself triggering dirtiness. This
104
+ -- could be viewed as a bug, since files changed during the
105
+ -- build will not trigger an extra rebuild, but overall seems
106
+ -- like better behavior. See
107
+ -- https://github.com/commercialhaskell/stack/issues/822
108
+ atomically $ writeTVar dirtyVar False
109
110
case eres of
111
Left e -> printExceptionStderr e
112
Right () -> putStrLn "Success! Waiting for next file change."
0 commit comments