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

Fix file watching for symlinked workspace on Linux #19159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tancop
Copy link

@tancop tancop commented Oct 13, 2024

Release Notes:

  • Fixed file watching for symlinked workspaces on linux

Copy link

cla-bot bot commented Oct 13, 2024

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

@tancop
Copy link
Author

tancop commented Oct 13, 2024

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Oct 13, 2024
Copy link

cla-bot bot commented Oct 13, 2024

The cla-bot has been summoned, and re-checked this pull request!

@tancop tancop force-pushed the fix-symlink-watching branch 3 times, most recently from 65239bd to aab3cfc Compare October 15, 2024 08:27
@tancop
Copy link
Author

tancop commented Oct 15, 2024

@notpeter I rebased and fixed the failing tests, should check for rename events not just delete. Can you run CI again?

@tancop
Copy link
Author

tancop commented Oct 17, 2024

@ConradIrwin

@notpeter

This comment was marked as off-topic.

@tancop
Copy link
Author

tancop commented Oct 22, 2024

All tests passed, do you think this is ready for merge?

@tancop
Copy link
Author

tancop commented Nov 2, 2024

@maxdeviant

@ConradIrwin
Copy link
Member

@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?

@tancop
Copy link
Author

tancop commented Nov 12, 2024

@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

@ConradIrwin
Copy link
Member

@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)

@tancop
Copy link
Author

tancop commented Nov 13, 2024

@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:

  • Create a directory
  • Create a symlink to that directory
  • Open the symlink in Zed
  • Create a file in the original directory outside of Zed (touch, vscode, file manager)
  • Zed doesn't detect the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symlink as workspace root breaks file watching
4 participants