diff --git a/src/crash_handler/lib.rs b/src/crash_handler/lib.rs index e2773ce194d..4ff1536c53a 100644 --- a/src/crash_handler/lib.rs +++ b/src/crash_handler/lib.rs @@ -1766,7 +1766,12 @@ mod draft { .store(handle as *mut core::ffi::c_void, Ordering::Relaxed); } } - #[cfg(any(target_os = "macos", target_os = "linux", target_os = "android", target_os = "freebsd"))] + #[cfg(any( + target_os = "macos", + target_os = "linux", + target_os = "android", + target_os = "freebsd" + ))] { reset_on_posix(); } @@ -2907,7 +2912,12 @@ mod draft { let _ = spawn_result; let _ = url; } - #[cfg(any(target_os = "macos", target_os = "linux", target_os = "android", target_os = "freebsd"))] + #[cfg(any( + target_os = "macos", + target_os = "linux", + target_os = "android", + target_os = "freebsd" + ))] { let mut buf = bun_core::PathBuffer::default(); let mut buf2 = bun_core::PathBuffer::default(); diff --git a/src/errno/lib.rs b/src/errno/lib.rs index abe6ee0ccf7..8142a6c52ea 100644 --- a/src/errno/lib.rs +++ b/src/errno/lib.rs @@ -409,7 +409,12 @@ mod errno_name_tests { assert_eq!(Error::from_errno(0), Error::UNEXPECTED); assert_eq!(Error::from_errno(9999), Error::UNEXPECTED); // errno 11 is platform-specific: EAGAIN on linux/windows, EDEADLK on darwin/bsd. - #[cfg(any(target_os = "linux", target_os = "android", windows, target_family = "wasm"))] + #[cfg(any( + target_os = "linux", + target_os = "android", + windows, + target_family = "wasm" + ))] { assert_eq!(Error::from_errno(11), Error::intern("EAGAIN")); assert_eq!(Error::from_errno(104), Error::intern("ECONNRESET")); @@ -464,7 +469,12 @@ mod errno_name_tests { coreutils_error_map::get(2), Some("No such file or directory") ); - #[cfg(any(target_os = "linux", target_os = "android", windows, target_family = "wasm"))] + #[cfg(any( + target_os = "linux", + target_os = "android", + windows, + target_family = "wasm" + ))] assert_eq!( coreutils_error_map::get(11), Some("Resource temporarily unavailable") diff --git a/src/perf/tracy.rs b/src/perf/tracy.rs index a4d304fd3fa..16ee81aaddd 100644 --- a/src/perf/tracy.rs +++ b/src/perf/tracy.rs @@ -756,7 +756,12 @@ fn dlsym(symbol: &'static core::ffi::CStr) -> Option { ]; #[cfg(windows)] const PATHS_TO_TRY: &[&core::ffi::CStr] = &[c"tracy.dll"]; - #[cfg(not(any(target_os = "macos", target_os = "linux", target_os = "android", windows)))] + #[cfg(not(any( + target_os = "macos", + target_os = "linux", + target_os = "android", + windows + )))] const PATHS_TO_TRY: &[&core::ffi::CStr] = &[]; // TODO(port): RTLD flags — Zig used `@bitCast(@as(i32, -2))` on diff --git a/src/resolver/package_json.rs b/src/resolver/package_json.rs index 63ca7af8dc3..7b2dd28c61a 100644 --- a/src/resolver/package_json.rs +++ b/src/resolver/package_json.rs @@ -2758,9 +2758,17 @@ impl<'a> ESModule<'a> { }, }; } else { + // PORT NOTE: Zig used `.auto` here, carried over as a + // latent Windows bug (#30839): this branch runs when an + // `imports` target is itself a package specifier + // (e.g. `@myproject/resolver`) that we hand back to + // package-resolve. Per the Node.js packages spec these + // are URL-like specifiers and must keep forward slashes; + // `Auto` normalizes them to `\` on Windows and the + // scoped-name match fails, falling through to `main`. let parts2 = [str, subpath]; let result = resolve_path::resolve_path::join_string_buf::< - resolve_path::platform::Auto, + resolve_path::platform::Posix, >( &mut resolve_target_buf2.0, &parts2 ); diff --git a/src/runtime/cli/Arguments.rs b/src/runtime/cli/Arguments.rs index 464ee8767ba..63c1a2520e8 100644 --- a/src/runtime/cli/Arguments.rs +++ b/src/runtime/cli/Arguments.rs @@ -679,7 +679,10 @@ pub const BASE_RUNTIME_TRANSPILER_PARAMS: &[ParamType] = // built with `comptime_table!(.., cold)` and stay in plain `.rodata`, where // `src/startup.order` can still cluster the ones a sampled cold path actually // hits without weighing down the `.rodata.startup` fault-around window. -#[cfg_attr(any(target_os = "linux", target_os = "android"), unsafe(link_section = ".rodata.startup"))] +#[cfg_attr( + any(target_os = "linux", target_os = "android"), + unsafe(link_section = ".rodata.startup") +)] pub static AUTO_TABLE: &clap::ConvertedTable = clap::comptime_table!(AUTO_PARAMS); pub static RUN_TABLE: &clap::ConvertedTable = clap::comptime_table!(RUN_PARAMS, cold); pub static BUILD_TABLE: &clap::ConvertedTable = clap::comptime_table!(BUILD_PARAMS, cold); diff --git a/src/runtime/cli/run_command.rs b/src/runtime/cli/run_command.rs index 03a0613055e..999e7d596a3 100644 --- a/src/runtime/cli/run_command.rs +++ b/src/runtime/cli/run_command.rs @@ -552,7 +552,10 @@ Full documentation is available at https://bun.com/docs/cli/run /// not share `.text` pages with the hot `bun run