dune
dune copied to clipboard
Adds native polling mode support on Windows
Adds support for polling mode on Windows using a new internal library winwatch
, which takes inspiration for its structure from fsevents
. winwatch
uses the Windows ReadDirectoryChangesW API to watch for file changes and an I/O Completion Port to report notifications in a callback. dune_file_watcher
now uses winwatch
instead of fswatch
on native Windows, and notifications received in dune_file_watcher
are filtered for relevance before they are passed to scheduler.thread_safe_send_emit_events_job
.
One additional change was made for compatibility on Windows:
The rpc server typically uses Unix.pipe
in non-blocking mode, but non-blocking mode is not supported on Windows. The proposed solution instead uses a blocking pipe that times out every 0.1 second and reblocks.
Potential areas for improvement:
The proposed solution does not prevent the same path from being watched multiple times. A potential solution would be a trie that stores paths, like Watch_trie
used by for fsevents
.
Signed-off-by: Uma Kothuri [email protected]
Just to add a little background information: @yams-yams worked on this project as part of an internship at LexiFi, and we have already discussed the general appraoch internally. I am planning to do a review of the PR, but of course additional reviewers are welcome!
The DCO check is failing because your git "Author" name (git config user.name
) must match your Signed-Off-by
line, ie it must be Uma Kothuri
. To change it:
-
git config user.name "Uma Kothuri"
; -
git commit --reset-author --amend
(to update the existing commit at the top of the branch with the new name).
@nojb could you move the RPC changes to a separate PR?
Thanks for the review @rgrinberg. I am in the process of rebasing it (I started a few days ago, but didn't get enough time to finish). Will amend according to your suggestions.
Superceded by #7010