Skip to content

Commit

Permalink
fix: update oxc-resolver and fix windows bug (#9754)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasLYang authored Feb 25, 2025
1 parent 453637f commit 3606f1d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 10 deletions.
31 changes: 26 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ notify = "6.1.1"
num_cpus = "1.15.0"
once_cell = "1.17.1"
owo-colors = "3.5.0"
oxc_resolver = { version = "2.1.0" }
oxc_resolver = "4.2.0"
parking_lot = "0.12.1"
path-clean = "1.0.1"
pathdiff = "0.2.1"
Expand Down
18 changes: 15 additions & 3 deletions crates/turbo-trace/src/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub enum TraceError {
#[error("failed to read file: {0}")]
FileNotFound(AbsoluteSystemPathBuf),
#[error(transparent)]
PathEncoding(Arc<PathError>),
PathError(Arc<PathError>),
#[error("tracing a root file `{0}`, no parent found")]
RootFile(AbsoluteSystemPathBuf),
#[error("failed to resolve import to `{import}` in `{file_path}`")]
Expand Down Expand Up @@ -212,7 +212,7 @@ impl Tracer {
match resolved.into_path_buf().try_into().map_err(Arc::new) {
Ok(path) => files.push(path),
Err(err) => {
errors.push(TraceError::PathEncoding(err));
errors.push(TraceError::PathError(err));
continue;
}
}
Expand Down Expand Up @@ -453,7 +453,19 @@ impl Tracer {
return (errors, None);
};

for import in imported_files {
for mut import in imported_files {
if cfg!(windows) {
match import.to_realpath() {
Ok(path) => {
import = path;
}
Err(err) => {
errors.push(TraceError::PathError(Arc::new(err)));
return (errors, None);
}
}
}

if shared_self
.files
.iter()
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/query/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl From<turbo_trace::TraceError> for Diagnostic {
path: Some(file.to_string()),
..Default::default()
},
turbo_trace::TraceError::PathEncoding(_) => Diagnostic {
turbo_trace::TraceError::PathError(_) => Diagnostic {
message,
..Default::default()
},
Expand Down

0 comments on commit 3606f1d

Please sign in to comment.