Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn on incremental memo by default #4876

Merged
8 commits merged into from
Sep 8, 2021
Merged

Turn on incremental memo by default #4876

8 commits merged into from
Sep 8, 2021

Conversation

rgrinberg
Copy link
Member

For some reason this breaks error reporting with RPC (it now reports stale errors). Investigating as to what the cause is.

@rgrinberg rgrinberg requested a review from a user August 26, 2021 21:33
@rgrinberg
Copy link
Member Author

Actually, CI demonstrates that the issue is present only on MacOS. I narrowed it down to the updated source not being copied to _build after running the build again. @aalekseyev anyway to make the test to wait for fsevents to pick up the outdated file before starting the build again?

@aalekseyev
Copy link
Collaborator

aalekseyev commented Aug 27, 2021

@rgrinberg, "waited for inotify sync" is supposed to correspond to exactly that: the idea is to wait until all file notification events up until that point are processed.
This works by modifying a special file on the filesystem (see special_file_for_inotify_sync in dune_file_watcher.ml) and waiting for that file modification to propagate through file notification system. This relies on events being reported in-order, which seems to be the case for inotify. Maybe that doesn't hold for fswatch on a Mac?

My first thought was that maybe the Sync event doesn't happen at all (e.g. we don't watch the special file), but if that was the case then I think you'd just see a deadlock, instead.

@ghost
Copy link

ghost commented Aug 31, 2021

It seems that fsevents supports a "flush" operation that does the same as the inotify sync mechanism: https://developer.apple.com/documentation/coreservices/1445629-fseventstreamflushsync?language=objc

@rgrinberg
Copy link
Member Author

rgrinberg commented Sep 1, 2021 via email

@ghost
Copy link

ghost commented Sep 2, 2021

Indeed. In the long run that seems inevitable if we want proper fine grained file watching. fswatch/inotifywait were an easy way to bootstrap the system but they don't give us much control. For instance, we can't dynamically add watches with fswatch, so we can't watch external files and directories while we can by using the inotify or fsevents API directly.

@ghost
Copy link

ghost commented Sep 6, 2021

@rgrinberg can you disable the offending tests on OSX for now and merge this PR? And while you are at it, delete the environment variable and the old mode entirely.

The new mode is usable enough now and there is going to be a fair amount of polishing to do before it's ready for release. So we might as well make the new mode the new reality ASAP.

And also lazy in cases where it's not needed.

Signed-off-by: Rudi Grinberg <[email protected]>
@rgrinberg rgrinberg mentioned this pull request Sep 7, 2021
we are only going to rely on the incremental mode

Signed-off-by: Rudi Grinberg <[email protected]>
@rgrinberg
Copy link
Member Author

Is there a way to do enabled_if on inline tests? I'm not sure how to disable tests on OSX.

_
Signed-off-by: Jeremie Dimino <[email protected]>
@ghost
Copy link

ghost commented Sep 7, 2021

Putting it on the whole library stanza should work. I'm trying that.

@ghost ghost merged commit fb3c71d into ocaml:main Sep 8, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants