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: VFS should not walk circular symlinks #17093

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Apr 17, 2024

As of #6246, rust-analyzer follows symlinks. This can introduce an infinite loop if symlinks point to parent directories.

Considering that #6246 was added in 2020 without many bug reports, this is clearly a rare occurrence. However, I am observing rust-analyzer hang on projects that have symlinks of the form:

test/a_symlink -> ../../

Ignore symlinks that only point to the parent directories, as this is more robust but still allows typical symlink usage patterns.

@Wilfred Wilfred marked this pull request as ready for review April 17, 2024 18:29
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 17, 2024
As of rust-lang#6246, rust-analyzer follows symlinks. This can introduce an
infinite loop if symlinks point to parent directories.

Considering that rust-lang#6246 was added in 2020 without many bug reports,
this is clearly a rare occurrence. However, I am observing
rust-analyzer hang on projects that have symlinks of the form:

```
test/a_symlink -> ../../
```

Ignore symlinks that only point to the parent directories, as this is
more robust but still allows typical symlink usage patterns.
@Veykril
Copy link
Member

Veykril commented Apr 18, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 18, 2024

📌 Commit bd133ee has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Apr 18, 2024

⌛ Testing commit bd133ee with merge 062e1b9...

@bors
Copy link
Collaborator

bors commented Apr 18, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 062e1b9 to master...

@bors bors merged commit 062e1b9 into rust-lang:master Apr 18, 2024
11 checks passed
@Wilfred Wilfred deleted the vfs_ignore_symlink_cycles branch May 1, 2024 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants