Skip to content

don't let rustc-dep-of-std enable backtrace-sys #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exclude = ['crates/without_debuginfo']
[dependencies]
cfg-if = "0.1.10"
rustc-demangle = "0.1.4"
backtrace-sys = { path = "crates/backtrace-sys", version = "0.1.32", optional = true }
backtrace-sys = { path = "crates/backtrace-sys", version = "0.1.32", optional = true, default_features = false }
libc = { version = "0.2.45", default-features = false }
core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }
compiler_builtins = { version = '0.1.2', optional = true }
Expand Down Expand Up @@ -94,7 +94,7 @@ kernel32 = []
# the moment, this is only possible when targetting Linux, since macOS
# splits DWARF out into a separate object file. Enabling this feature
# means one less C dependency.
libbacktrace = ["backtrace-sys"]
libbacktrace = ["backtrace-sys/backtrace-sys"]
dladdr = []
coresymbolication = []
gimli-symbolize = ["addr2line", "findshlibs", "memmap", "goblin"]
Expand Down
4 changes: 4 additions & 0 deletions crates/backtrace-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ compiler_builtins = { version = '0.1.2', optional = true }
cc = "1.0.37"

[features]
default = ["backtrace-sys"]

# Without this feature, this crate does nothing.
backtrace-sys = []
rustc-dep-of-std = ['core', 'compiler_builtins']
3 changes: 2 additions & 1 deletion crates/backtrace-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use std::path::PathBuf;
fn main() {
let target = env::var("TARGET").unwrap();

if target.contains("msvc") || // libbacktrace isn't used on MSVC windows
if !cfg!(feature = "backtrace-sys") || // without this feature, this crate does nothing
target.contains("msvc") || // libbacktrace isn't used on MSVC windows
target.contains("emscripten") || // no way this will ever compile for emscripten
target.contains("cloudabi") ||
target.contains("hermit") ||
Expand Down