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
I'm using Vagrant (a wrapper for virtual machines) for my projects which means each project lives inside a virtual machine. The source code is on my host machine and a mount is created inside the vm to have the code available there too.
Running lein doo node test once inside the vm works as expected and running lein doo node test works as well (the correct tests are executed and the watcher is started), but file changes are never picked up.
Watching for file changes is always a problem with mounted folders. For figwheel, I have to use the :hawk-options {:watcher :polling} setting, otherwise it doesn't pick up any changes either. lein-test-refresh works out of the box.
The text was updated successfully, but these errors were encountered:
Doo uses ClojureScript's built-in watching functionality, which is implemented using java.nio.file.WatchService (the same as Figwheel's watch default settings). WatchService looks at the file system events, but they do not get forwarded from the host to the Vagrant guest, which causes the problems. To fix this, I see a couple of possible approaches:
convince ClojureScript to add support for alternative ways of watching,
re-implement watching in Doo (maybe using hawk to make it configurable the same way as Figwheel),
somehow piggyback on Figwheel's watcher or on cljsbuild's auto mode?
(For the record: lein-test-refresh uses clojure.tools.namespace's change tracking.)
As a workaround, you might want to check out some of the Vagrant plugins for forwarding file system events: vagrant-notify-forwarder, vagrant-fsnotify. Haven't tried any of them myself, though.
Thanks for the detailed analysis, miikka. I am using a Vagrant plugin right now and it works well. As you pointed out, this is only a workaround because most of the notifier plugins to not work on all platforms, are error-prone and it's an additional setup step which might get lost.
I appreciate your list of possible approaches and would consider working towards the one you think would be most feasible.
I'm using Vagrant (a wrapper for virtual machines) for my projects which means each project lives inside a virtual machine. The source code is on my host machine and a mount is created inside the vm to have the code available there too.
Running
lein doo node test once
inside the vm works as expected and runninglein doo node test
works as well (the correct tests are executed and the watcher is started), but file changes are never picked up.Watching for file changes is always a problem with mounted folders. For figwheel, I have to use the
:hawk-options {:watcher :polling}
setting, otherwise it doesn't pick up any changes either. lein-test-refresh works out of the box.The text was updated successfully, but these errors were encountered: