You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stack fails to respond to file modification events on OSX when run inside docker. I believe this is simply due to being built against fsnotify-0.2.1.1 rather than fsnotify-0.3.0.1. fsnotify-0.3.0.1 included changes to the Linux file listener which listen for Attrib and Modify events instead of CloseWrite. The Docker for Mac osxfs file sharing emits Modify events on file changes, but does not emit CloseWrite.
Run command docker run -it --rm -v $PWD:/work -w /work flipstone/stack:v2-1.9.3 bash
In the dockerized bash shell, run command stack new fsevent-test.
In the dockerized bash shell, run command cd fsevent-test && stack build --file-watch.
Edit fsevent-test/src/Lib.hs
(In vim, you will need to ensure backupcopy is set to yes. Both the no and auto settings result in files being created/deleted in the directory and triggering extra filesystem events, masking the problem)
Expected
The stack build --file-watch command should recompile when the file is edited.
Actual
The stack build --file-watch command does not recompile when the file is edited.
While Docker for Mac isn't officially supported for Stack's Docker integration (lots of little ways in which it differs from native Linux docker), we do like it to work as well as possible. Please feel free to make a PR that upgrades the fsnotify dependency in snapshot.yaml (no need to to add a lower bound to package.yaml since we use the snapshots as the source of truth for dependency versions). snapshot-lts-12.yaml and snapshot-nightly.yaml are based on newer Stackage snapshots that already have fsnotify-0.3.0.1, so no need to change those.
qxjit
added a commit
to qxjit/stack
that referenced
this issue
Jan 16, 2019
lts-11.22 includes fsnotify-0.2.1.1, which listens to Modify events on
Linux rather than CloseWrite events. For many applications the
difference is neglible because writing a file will result in both
events, but if you run stack inside of docker on Mac this breaks
the --file-watch option because the file sharing integration only
emits Modify events, never CloseWrite events.
fsnotify-0.3.0.1 changed to listen to Modify events rather than
CloseWrite events. Switching to the new version fixes the issue.
General summary/comments (optional)
stack
fails to respond to file modification events on OSX when run inside docker. I believe this is simply due to being built againstfsnotify-0.2.1.1
rather thanfsnotify-0.3.0.1
.fsnotify-0.3.0.1
included changes to the Linux file listener which listen for Attrib and Modify events instead of CloseWrite. The Docker for Mac osxfs file sharing emits Modify events on file changes, but does not emit CloseWrite.fsnotify-0.2.1.1 event list
fsnotify-0.3.0.1 event list
Steps to reproduce
docker run -it --rm -v $PWD:/work -w /work flipstone/stack:v2-1.9.3 bash
stack new fsevent-test
.cd fsevent-test && stack build --file-watch
.fsevent-test/src/Lib.hs
(In vim, you will need to ensure
backupcopy
is set toyes
. Both theno
andauto
settings result in files being created/deleted in the directory and triggering extra filesystem events, masking the problem)Expected
The
stack build --file-watch
command should recompile when the file is edited.Actual
The
stack build --file-watch
command does not recompile when the file is edited.Stack version
Method of installation
https://github.com/commercialhaskell/stack/releases
as part of docker image build (Dockerfile)The text was updated successfully, but these errors were encountered: