-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix file watching for symlinked workspace on Linux #19159
base: main
Are you sure you want to change the base?
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @tancop on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
65239bd
to
aab3cfc
Compare
@notpeter I rebased and fixed the failing tests, should check for rename events not just delete. Can you run CI again? |
aab3cfc
to
d9ab81d
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
All tests passed, do you think this is ready for merge? |
@tancop sorry for the glacial response here! The change to canonicalize before calling watch makes sense to me; do we also need to canonicalize on every filesystem event? It sounded like from your description on the issue that we were already getting canonical paths in that situation? |
d9ab81d
to
0f09217
Compare
0f09217
to
ccc80f3
Compare
@ConradIrwin I rebased on the fs refactor and skipped canonicalize unless the root path is a symlink or the event path we got from notify doesn't match. Not exactly elegant but it works |
@tancop Thanks! Why is that needed? It sounded like from your earlier notes that we already got canonical paths from the notify events? Can you also help me nail down the reproduction steps please: #17161 (comment) |
@ConradIrwin delete and rename events can return non canonical paths because the file doesn't exist anymore so notify can't canonicalize it internally. Same thing happens when the root directory is a descendant of a symlink for whatever reason, I tried to remove that check but it broke. For the reproduction steps:
|
Closes Symlink as workspace root breaks file watching #17161
Fix file watching for symlinks #17609 only fixed file watching for symlinks inside the workspace, not if the folder itself or one of its parents is a symlink. This PR replaces uses of
read_link
withcanonicalize
that returns the right canonical path in these cases.Release Notes: