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

avoid to read_dir syscall for all files #2495

Merged
merged 1 commit into from
Oct 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions crates/turbo-tasks-fs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,14 +1015,18 @@ impl FileSystemPathVc {
let mut symlinks = Vec::new();
for segment in segments {
current = current.join(segment);
while let LinkContent::Link { target, link_type } = &*current.read_link().await? {
symlinks.push(current.resolve().await?);
current = if link_type.contains(LinkType::ABSOLUTE) {
current.root()
while let FileSystemEntryType::Symlink = &*current.get_type().await? {
if let LinkContent::Link { target, link_type } = &*current.read_link().await? {
symlinks.push(current.resolve().await?);
current = if link_type.contains(LinkType::ABSOLUTE) {
current.root()
} else {
current.parent()
}
.join(target);
} else {
current.parent()
break;
}
.join(target);
}
}
if symlinks.is_empty() {
Expand Down