diff --git a/Cargo.lock b/Cargo.lock index fb16c0e1f59cf..2eedf71bc10b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3729,16 +3729,17 @@ dependencies = [ [[package]] name = "oxc_resolver" -version = "2.1.1" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da33ec82d0f4770f4b5c120d6a1d8e45de2d99ae2672a7ee6bd29092ada945f2" +checksum = "b1c4d9cffbd24c3a874bd44cce4384cb73bf732c4fe4aa99c4406b2e0c4027bb" dependencies = [ "cfg-if", - "dashmap 6.1.0", "indexmap 2.2.6", "json-strip-comments", "once_cell", + "papaya", "rustc-hash 2.0.0", + "seize", "serde", "serde_json", "simdutf8", @@ -3746,6 +3747,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "papaya" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aab21828b6b5952fdadd6c377728ffae53ec3a21b2febc47319ab65741f7e2fd" +dependencies = [ + "equivalent", + "seize", +] + [[package]] name = "parking" version = "2.0.0" @@ -4764,6 +4775,16 @@ dependencies = [ "libc", ] +[[package]] +name = "seize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4b8d813387d566f627f3ea1b914c068aac94c40ae27ec43f5f33bde65abefe7" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "semver" version = "0.9.0" @@ -6213,7 +6234,7 @@ dependencies = [ "futures", "globwalk", "miette", - "oxc_resolver 2.1.1", + "oxc_resolver 4.2.0", "swc_common", "swc_ecma_ast", "swc_ecma_parser", @@ -6529,7 +6550,7 @@ dependencies = [ "notify", "num_cpus", "owo-colors 3.5.0", - "oxc_resolver 2.1.1", + "oxc_resolver 4.2.0", "path-clean", "petgraph", "pidlock", diff --git a/Cargo.toml b/Cargo.toml index 0d4af5ddad8b8..a1faad4ca4c6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/crates/turbo-trace/src/tracer.rs b/crates/turbo-trace/src/tracer.rs index 5052ed7f926ed..06699349e2ac3 100644 --- a/crates/turbo-trace/src/tracer.rs +++ b/crates/turbo-trace/src/tracer.rs @@ -48,7 +48,7 @@ pub enum TraceError { #[error("failed to read file: {0}")] FileNotFound(AbsoluteSystemPathBuf), #[error(transparent)] - PathEncoding(Arc), + PathError(Arc), #[error("tracing a root file `{0}`, no parent found")] RootFile(AbsoluteSystemPathBuf), #[error("failed to resolve import to `{import}` in `{file_path}`")] @@ -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; } } @@ -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() diff --git a/crates/turborepo-lib/src/query/file.rs b/crates/turborepo-lib/src/query/file.rs index 49251173b6078..7be10fba8389e 100644 --- a/crates/turborepo-lib/src/query/file.rs +++ b/crates/turborepo-lib/src/query/file.rs @@ -81,7 +81,7 @@ impl From for Diagnostic { path: Some(file.to_string()), ..Default::default() }, - turbo_trace::TraceError::PathEncoding(_) => Diagnostic { + turbo_trace::TraceError::PathError(_) => Diagnostic { message, ..Default::default() },