From 8bb67c74a6c7a473ed60cacb69043de7a3032e5b Mon Sep 17 00:00:00 2001 From: klensy Date: Wed, 5 Jul 2023 14:20:37 +0300 Subject: [PATCH 1/3] for windows-msvc targets, dont use miniz_oxide, addr2line, object, libc --- Cargo.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 45b6f13b..4541e60b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ exclude = [ [dependencies] cfg-if = "1.0" rustc-demangle = "0.1.4" -libc = { version = "0.2.146", default-features = false } # Optionally enable the ability to serialize a `Backtrace`, controlled through # the `serialize-*` features below. @@ -38,10 +37,12 @@ rustc-serialize = { version = "0.3", optional = true } # Optionally demangle C++ frames' symbols in backtraces. cpp_demangle = { default-features = false, version = "0.4.0", optional = true, features = ["alloc"] } -addr2line = { version = "0.21.0", default-features = false } +[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies] miniz_oxide = { version = "0.7.0", default-features = false } +addr2line = { version = "0.21.0", default-features = false } +libc = { version = "0.2.146", default-features = false } -[dependencies.object] +[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies.object] version = "0.32.0" default-features = false features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive'] From b6d24cdeffd590c54b19ac678ec7679ee6960a18 Mon Sep 17 00:00:00 2001 From: klensy Date: Thu, 6 Jul 2023 15:55:06 +0300 Subject: [PATCH 2/3] gate gimli usage on windows with gnu --- src/symbolize/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/symbolize/mod.rs b/src/symbolize/mod.rs index dbc34652..a7c19950 100644 --- a/src/symbolize/mod.rs +++ b/src/symbolize/mod.rs @@ -471,7 +471,7 @@ cfg_if::cfg_if! { mod dbghelp; use dbghelp as imp; } else if #[cfg(all( - any(unix, windows), + any(unix, all(windows, target_env = "gnu")), not(target_vendor = "uwp"), not(target_os = "emscripten"), any(not(backtrace_in_libstd), feature = "backtrace"), From 56c215e92a8de2346084ed6415d3cc7937ce1b78 Mon Sep 17 00:00:00 2001 From: klensy Date: Sat, 8 Jul 2023 14:04:43 +0300 Subject: [PATCH 3/3] sync as-if-std crate --- crates/as-if-std/Cargo.toml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/as-if-std/Cargo.toml b/crates/as-if-std/Cargo.toml index bbb76f72..bcbcfe15 100644 --- a/crates/as-if-std/Cargo.toml +++ b/crates/as-if-std/Cargo.toml @@ -15,10 +15,12 @@ bench = false cfg-if = "1.0" rustc-demangle = "0.1.21" libc = { version = "0.2.146", default-features = false } -addr2line = { version = "0.21.0", default-features = false, optional = true } -miniz_oxide = { version = "0.7", default-features = false } -[dependencies.object] +[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies] +miniz_oxide = { version = "0.7.0", optional = true, default-features = false } +addr2line = { version = "0.21.0", optional = true, default-features = false } + +[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies.object] version = "0.32.0" default-features = false optional = true @@ -30,4 +32,4 @@ cc = "1.0.67" [features] default = ['backtrace'] -backtrace = ['addr2line', 'object'] +backtrace = ['addr2line', 'miniz_oxide', 'object']