Skip to content

Commit

Permalink
Fix crate as an optional dep of libstd (#433)
Browse files Browse the repository at this point in the history
This was broken in a previous refactoring by accident, and this restores
support.
  • Loading branch information
alexcrichton authored Aug 19, 2021
1 parent 7f6f462 commit 4f925f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ jobs:
- run: ./ci/debuglink-docker.sh
if: contains(matrix.os, 'ubuntu')

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

windows_arm64:
name: Windows AArch64
Expand Down
9 changes: 5 additions & 4 deletions crates/as-if-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ bench = false
cfg-if = "1.0"
rustc-demangle = "0.1.4"
libc = { version = "0.2.45", default-features = false }
addr2line = { version = "0.15.1", default-features = false }
addr2line = { version = "0.16.0", default-features = false, optional = true }
miniz_oxide = { version = "0.4.0", default-features = false }

[dependencies.object]
version = "0.25"
version = "0.26"
default-features = false
optional = true
features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive']

[features]
default = ['gimli-symbolize']
gimli-symbolize = []
default = ['backtrace']
backtrace = ['addr2line', 'object']
1 change: 1 addition & 0 deletions src/symbolize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ cfg_if::cfg_if! {
any(unix, windows),
not(target_vendor = "uwp"),
not(target_os = "emscripten"),
any(not(backtrace_in_libstd), feature = "backtrace"),
))] {
mod gimli;
use gimli as imp;
Expand Down

0 comments on commit 4f925f8

Please sign in to comment.