Skip to content

Commit 4f925f8

Browse files
authored
Fix crate as an optional dep of libstd (#433)
This was broken in a previous refactoring by accident, and this restores support.
1 parent 7f6f462 commit 4f925f8

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ jobs:
106106
- run: ./ci/debuglink-docker.sh
107107
if: contains(matrix.os, 'ubuntu')
108108

109-
# Test that including as a submodule will still work
109+
# Test that including as a submodule will still work, both with and without
110+
# the `backtrace` feature enabled.
110111
- run: cargo build --manifest-path crates/as-if-std/Cargo.toml
112+
- run: cargo build --manifest-path crates/as-if-std/Cargo.toml --no-default-features
111113

112114
windows_arm64:
113115
name: Windows AArch64

crates/as-if-std/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ bench = false
1515
cfg-if = "1.0"
1616
rustc-demangle = "0.1.4"
1717
libc = { version = "0.2.45", default-features = false }
18-
addr2line = { version = "0.15.1", default-features = false }
18+
addr2line = { version = "0.16.0", default-features = false, optional = true }
1919
miniz_oxide = { version = "0.4.0", default-features = false }
2020

2121
[dependencies.object]
22-
version = "0.25"
22+
version = "0.26"
2323
default-features = false
24+
optional = true
2425
features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive']
2526

2627
[features]
27-
default = ['gimli-symbolize']
28-
gimli-symbolize = []
28+
default = ['backtrace']
29+
backtrace = ['addr2line', 'object']

src/symbolize/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ cfg_if::cfg_if! {
474474
any(unix, windows),
475475
not(target_vendor = "uwp"),
476476
not(target_os = "emscripten"),
477+
any(not(backtrace_in_libstd), feature = "backtrace"),
477478
))] {
478479
mod gimli;
479480
use gimli as imp;

0 commit comments

Comments
 (0)