Skip to content

Old fsnotify dependency doesn't detect file changes when using Docker for Mac #4506

@qxjit

Description

@qxjit

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 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.

fsnotify-0.2.1.1 event list

fsnotify-0.3.0.1 event list

Steps to reproduce

  1. Run command docker run -it --rm -v $PWD:/work -w /work flipstone/stack:v2-1.9.3 bash
  2. In the dockerized bash shell, run command stack new fsevent-test.
  3. In the dockerized bash shell, run command cd fsevent-test && stack build --file-watch.
  4. 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.

Stack version

$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1

Method of installation

  • Binary package downloaded from https://github.com/commercialhaskell/stack/releases as part of docker image build (Dockerfile)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions