Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
1300acfe
Unverified
Commit
1300acfe
authored
Sep 16, 2025
by
Niklas Mischkulnig
Committed by
GitHub
Sep 16, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: rename some fields in fs (#83808)
Apply suggestions from
https://github.com/vercel/next.js/pull/83805
parent
8b17a636
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
lib.rs
turbopack/crates/turbo-tasks-fs/src/lib.rs
+9
-9
node_addon_module.rs
turbopack/crates/turbopack-core/src/node_addon_module.rs
+1
-1
mod.rs
turbopack/crates/turbopack-core/src/resolve/mod.rs
+3
-3
node.rs
turbopack/crates/turbopack-ecmascript/src/references/node.rs
+1
-1
node_native_binding.rs
...opack/crates/turbopack-resolve/src/node_native_binding.rs
+1
-1
No files found.
turbopack/crates/turbo-tasks-fs/src/lib.rs
View file @
1300acfe
...
@@ -1387,7 +1387,7 @@ impl FileSystemPath {
...
@@ -1387,7 +1387,7 @@ impl FileSystemPath {
// is invalid.
// is invalid.
pub
async
fn
realpath
(
&
self
)
->
Result
<
FileSystemPath
>
{
pub
async
fn
realpath
(
&
self
)
->
Result
<
FileSystemPath
>
{
let
result
=
&
(
*
self
.realpath_with_links
()
.await
?
);
let
result
=
&
(
*
self
.realpath_with_links
()
.await
?
);
match
&
result
.path_
or_error
{
match
&
result
.path_
result
{
Ok
(
path
)
=>
Ok
(
path
.clone
()),
Ok
(
path
)
=>
Ok
(
path
.clone
()),
Err
(
error
)
=>
Err
(
anyhow
::
anyhow!
(
error
.as_error_message
(
self
,
result
))),
Err
(
error
)
=>
Err
(
anyhow
::
anyhow!
(
error
.as_error_message
(
self
,
result
))),
}
}
...
@@ -1449,7 +1449,7 @@ impl ValueToString for FileSystemPath {
...
@@ -1449,7 +1449,7 @@ impl ValueToString for FileSystemPath {
#[derive(Clone,
Debug)]
#[derive(Clone,
Debug)]
#[turbo_tasks
::
value(shared)]
#[turbo_tasks
::
value(shared)]
pub
struct
RealPathResult
{
pub
struct
RealPathResult
{
pub
path_
or_error
:
Result
<
FileSystemPath
,
RealPathResultError
>
,
pub
path_
result
:
Result
<
FileSystemPath
,
RealPathResultError
>
,
pub
symlinks
:
Vec
<
FileSystemPath
>
,
pub
symlinks
:
Vec
<
FileSystemPath
>
,
}
}
...
@@ -2121,7 +2121,7 @@ impl DirectoryEntry {
...
@@ -2121,7 +2121,7 @@ impl DirectoryEntry {
pub
async
fn
resolve_symlink
(
self
)
->
Result
<
Self
>
{
pub
async
fn
resolve_symlink
(
self
)
->
Result
<
Self
>
{
if
let
DirectoryEntry
::
Symlink
(
symlink
)
=
&
self
{
if
let
DirectoryEntry
::
Symlink
(
symlink
)
=
&
self
{
let
result
=
&*
symlink
.realpath_with_links
()
.await
?
;
let
result
=
&*
symlink
.realpath_with_links
()
.await
?
;
let
real_path
=
match
&
result
.path_
or_error
{
let
real_path
=
match
&
result
.path_
result
{
Ok
(
path
)
=>
path
,
Ok
(
path
)
=>
path
,
Err
(
error
)
=>
{
Err
(
error
)
=>
{
return
Ok
(
DirectoryEntry
::
Error
(
return
Ok
(
DirectoryEntry
::
Error
(
...
@@ -2136,9 +2136,9 @@ impl DirectoryEntry {
...
@@ -2136,9 +2136,9 @@ impl DirectoryEntry {
FileSystemEntryType
::
NotFound
=>
DirectoryEntry
::
Error
(
FileSystemEntryType
::
NotFound
=>
DirectoryEntry
::
Error
(
format!
(
"Symlink {symlink} points at {real_path} which does not exist"
)
.into
(),
format!
(
"Symlink {symlink} points at {real_path} which does not exist"
)
.into
(),
),
),
// This is caused by eventual consistency
FileSystemEntryType
::
Symlink
=>
bail!
(
FileSystemEntryType
::
Symlink
=>
bail!
(
"Symlink {symlink} points at a symlink but realpath_with_links returned a
\
"Symlink {symlink} points at a symlink but realpath_with_links returned a path"
path, this is caused by eventual consistency."
),
),
_
=>
self
,
_
=>
self
,
})
})
...
@@ -2376,7 +2376,7 @@ async fn realpath_with_links(path: FileSystemPath) -> Result<Vc<RealPathResult>>
...
@@ -2376,7 +2376,7 @@ async fn realpath_with_links(path: FileSystemPath) -> Result<Vc<RealPathResult>>
if
current_path
.is_root
()
{
if
current_path
.is_root
()
{
// fast path
// fast path
return
Ok
(
RealPathResult
{
return
Ok
(
RealPathResult
{
path_
or_error
:
Ok
(
current_path
),
path_
result
:
Ok
(
current_path
),
symlinks
:
symlinks
.into_iter
()
.collect
(),
symlinks
:
symlinks
.into_iter
()
.collect
(),
}
}
.cell
());
.cell
());
...
@@ -2395,7 +2395,7 @@ async fn realpath_with_links(path: FileSystemPath) -> Result<Vc<RealPathResult>>
...
@@ -2395,7 +2395,7 @@ async fn realpath_with_links(path: FileSystemPath) -> Result<Vc<RealPathResult>>
.rsplit_once
(
'/'
)
.rsplit_once
(
'/'
)
.map_or
(
current_path
.path
.as_str
(),
|(
_
,
name
)|
name
);
.map_or
(
current_path
.path
.as_str
(),
|(
_
,
name
)|
name
);
symlinks
.extend
(
parent_result
.symlinks
);
symlinks
.extend
(
parent_result
.symlinks
);
let
parent_path
=
match
parent_result
.path_
or_error
{
let
parent_path
=
match
parent_result
.path_
result
{
Ok
(
path
)
=>
{
Ok
(
path
)
=>
{
if
path
!=
parent
{
if
path
!=
parent
{
current_path
=
path
.join
(
basename
)
?
;
current_path
=
path
.join
(
basename
)
?
;
...
@@ -2415,7 +2415,7 @@ async fn realpath_with_links(path: FileSystemPath) -> Result<Vc<RealPathResult>>
...
@@ -2415,7 +2415,7 @@ async fn realpath_with_links(path: FileSystemPath) -> Result<Vc<RealPathResult>>
FileSystemEntryType
::
Symlink
FileSystemEntryType
::
Symlink
)
{
)
{
return
Ok
(
RealPathResult
{
return
Ok
(
RealPathResult
{
path_
or_error
:
Ok
(
current_path
),
path_
result
:
Ok
(
current_path
),
symlinks
:
symlinks
.into_iter
()
.collect
(),
// convert set to vec
symlinks
:
symlinks
.into_iter
()
.collect
(),
// convert set to vec
}
}
.cell
());
.cell
());
...
@@ -2450,7 +2450,7 @@ async fn realpath_with_links(path: FileSystemPath) -> Result<Vc<RealPathResult>>
...
@@ -2450,7 +2450,7 @@ async fn realpath_with_links(path: FileSystemPath) -> Result<Vc<RealPathResult>>
// Returning the followed symlinks is still important, even if there is an error! Otherwise
// Returning the followed symlinks is still important, even if there is an error! Otherwise
// we may never notice if the symlink loop is fixed.
// we may never notice if the symlink loop is fixed.
Ok
(
RealPathResult
{
Ok
(
RealPathResult
{
path_
or_error
:
Err
(
error
),
path_
result
:
Err
(
error
),
symlinks
:
symlinks
.into_iter
()
.collect
(),
symlinks
:
symlinks
.into_iter
()
.collect
(),
}
}
.cell
())
.cell
())
...
...
turbopack/crates/turbopack-core/src/node_addon_module.rs
View file @
1300acfe
...
@@ -121,7 +121,7 @@ async fn dir_references(package_dir: FileSystemPath) -> Result<Vc<ModuleReferenc
...
@@ -121,7 +121,7 @@ async fn dir_references(package_dir: FileSystemPath) -> Result<Vc<ModuleReferenc
PatternMatch
::
File
(
_
,
file
)
=>
{
PatternMatch
::
File
(
_
,
file
)
=>
{
let
realpath
=
file
.realpath_with_links
()
.await
?
;
let
realpath
=
file
.realpath_with_links
()
.await
?
;
results
.extend
(
realpath
.symlinks
.iter
()
.cloned
());
results
.extend
(
realpath
.symlinks
.iter
()
.cloned
());
match
&
realpath
.path_
or_error
{
match
&
realpath
.path_
result
{
Ok
(
path
)
=>
{
Ok
(
path
)
=>
{
results
.insert
(
path
.clone
());
results
.insert
(
path
.clone
());
}
}
...
...
turbopack/crates/turbopack-core/src/resolve/mod.rs
View file @
1300acfe
...
@@ -1185,7 +1185,7 @@ async fn realpath(
...
@@ -1185,7 +1185,7 @@ async fn realpath(
.try_join
()
.try_join
()
.await
?
,
.await
?
,
);
);
match
&
result
.path_
or_error
{
match
&
result
.path_
result
{
Ok
(
path
)
=>
Ok
(
path
.clone
()),
Ok
(
path
)
=>
Ok
(
path
.clone
()),
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
fs_path
,
&
result
)),
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
fs_path
,
&
result
)),
}
}
...
@@ -1520,7 +1520,7 @@ pub async fn resolve_raw(
...
@@ -1520,7 +1520,7 @@ pub async fn resolve_raw(
)
->
Result
<
Vc
<
ResolveResult
>>
{
)
->
Result
<
Vc
<
ResolveResult
>>
{
async
fn
to_result
(
request
:
RcStr
,
path
:
FileSystemPath
)
->
Result
<
Vc
<
ResolveResult
>>
{
async
fn
to_result
(
request
:
RcStr
,
path
:
FileSystemPath
)
->
Result
<
Vc
<
ResolveResult
>>
{
let
result
=
&*
path
.realpath_with_links
()
.await
?
;
let
result
=
&*
path
.realpath_with_links
()
.await
?
;
let
path
=
match
&
result
.path_
or_error
{
let
path
=
match
&
result
.path_
result
{
Ok
(
path
)
=>
path
,
Ok
(
path
)
=>
path
,
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
&
path
,
result
)),
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
&
path
,
result
)),
};
};
...
@@ -2873,7 +2873,7 @@ async fn resolved(
...
@@ -2873,7 +2873,7 @@ async fn resolved(
fragment
:
RcStr
,
fragment
:
RcStr
,
)
->
Result
<
Vc
<
ResolveResult
>>
{
)
->
Result
<
Vc
<
ResolveResult
>>
{
let
result
=
&*
fs_path
.realpath_with_links
()
.await
?
;
let
result
=
&*
fs_path
.realpath_with_links
()
.await
?
;
let
path
=
match
&
result
.path_
or_error
{
let
path
=
match
&
result
.path_
result
{
Ok
(
path
)
=>
path
,
Ok
(
path
)
=>
path
,
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
&
fs_path
,
result
)),
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
&
fs_path
,
result
)),
};
};
...
...
turbopack/crates/turbopack-ecmascript/src/references/node.rs
View file @
1300acfe
...
@@ -124,7 +124,7 @@ async fn resolve_reference_from_dir(
...
@@ -124,7 +124,7 @@ async fn resolve_reference_from_dir(
FileSource
::
new
(
symlink
.clone
())
.to_resolved
()
.await
?
,
FileSource
::
new
(
symlink
.clone
())
.to_resolved
()
.await
?
,
));
));
}
}
let
path
:
FileSystemPath
=
match
&
realpath
.path_
or_error
{
let
path
:
FileSystemPath
=
match
&
realpath
.path_
result
{
Ok
(
path
)
=>
path
.clone
(),
Ok
(
path
)
=>
path
.clone
(),
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
file
,
&
realpath
)),
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
file
,
&
realpath
)),
};
};
...
...
turbopack/crates/turbopack-resolve/src/node_native_binding.rs
View file @
1300acfe
...
@@ -185,7 +185,7 @@ pub async fn resolve_node_pre_gyp_files(
...
@@ -185,7 +185,7 @@ pub async fn resolve_node_pre_gyp_files(
}
}
sources
.insert
(
sources
.insert
(
format!
(
"deps/lib/{key}"
)
.into
(),
format!
(
"deps/lib/{key}"
)
.into
(),
Vc
::
upcast
(
FileSource
::
new
(
match
&
realpath_with_links
.path_
or_error
{
Vc
::
upcast
(
FileSource
::
new
(
match
&
realpath_with_links
.path_
result
{
Ok
(
path
)
=>
path
.clone
(),
Ok
(
path
)
=>
path
.clone
(),
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
dylib
,
&
realpath_with_links
)),
Err
(
e
)
=>
bail!
(
e
.as_error_message
(
dylib
,
&
realpath_with_links
)),
})),
})),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment