Skip to content
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

Remove libbacktrace implementation #423

Merged
merged 3 commits into from
May 5, 2021
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
25 changes: 5 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,24 @@ jobs:
shell: bash
if: matrix.rust == 'stable-i686-msvc'

# Force packed debuginfo on macOS because libbacktrace only works with
# packed debuginfo. We specifically test later that both packed and
# unpacked work.
- run: |
echo CARGO_PROFILE_DEV_SPLIT_DEBUGINFO=packed >> $GITHUB_ENV
echo CARGO_PROFILE_TEST_SPLIT_DEBUGINFO=packed >> $GITHUB_ENV
if: matrix.os == 'macos-latest'

- run: cargo build --manifest-path crates/backtrace-sys/Cargo.toml
- run: cargo build
- run: cargo test
- run: cargo test --features "gimli-symbolize"
# run: cargo test --features "libbacktrace"
- run: cargo check --features "libbacktrace gimli-symbolize"
- run: cargo test --features "serialize-rustc"
- run: cargo test --features "serialize-serde"
- run: cargo test --features "verify-winapi"
- run: cargo test --features "cpp_demangle"
- run: cargo test --no-default-features
- run: cargo test --no-default-features --features "libbacktrace"
- run: cargo test --no-default-features --features "gimli-symbolize"
- run: cargo test --no-default-features --features "gimli-symbolize libbacktrace"
- run: cargo test --no-default-features --features "libbacktrace std"
- run: cargo test --no-default-features --features "gimli-symbolize std"
- run: cargo test --no-default-features --features "std"
- run: cargo test --manifest-path crates/cpp_smoke_test/Cargo.toml
# This test is specifically about packed debuginfo with `*.dSYM` files
- run: cargo test --manifest-path crates/macos_frames_test/Cargo.toml
- run: cargo test --features libbacktrace --manifest-path crates/without_debuginfo/Cargo.toml
env:
CARGO_PROFILE_DEV_SPLIT_DEBUGINFO: packed
CARGO_PROFILE_TEST_SPLIT_DEBUGINFO: packed
- run: cargo test --features gimli-symbolize --manifest-path crates/without_debuginfo/Cargo.toml
- run: cargo test --manifest-path crates/line-tables-only/Cargo.toml --features libbacktrace
- run: cargo test --manifest-path crates/line-tables-only/Cargo.toml --features gimli-symbolize

# Test that if debuginfo is compressed gimli still works
# Test debuginfo compression still works
- run: cargo test
if: contains(matrix.os, 'ubuntu')
env:
Expand Down
31 changes: 8 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ exclude = ['crates/without_debuginfo', 'crates/macos_frames_test', 'crates/line-
[dependencies]
cfg-if = "1.0"
rustc-demangle = "0.1.4"
backtrace-sys = { path = "crates/backtrace-sys", version = "0.1.35", optional = true, default_features = false }
libc = { version = "0.2.94", default-features = false }

# Optionally enable the ability to serialize a `Backtrace`, controlled through
Expand All @@ -36,11 +35,10 @@ cpp_demangle = { default-features = false, version = "0.3.0", optional = true }

# Optional dependencies enabled through the `gimli-symbolize` feature, do not
# use these features directly.
addr2line = { version = "0.15.1", optional = true, default-features = false }
miniz_oxide = { version = "0.4.0", optional = true, default-features = false }
addr2line = { version = "0.15.1", default-features = false }
miniz_oxide = { version = "0.4.0", default-features = false }
[dependencies.object]
version = "0.24"
optional = true
default-features = false
features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive']

Expand All @@ -58,26 +56,11 @@ libloading = "0.6"

[features]
# By default libstd support and gimli-symbolize is used to symbolize addresses.
default = ["std", "gimli-symbolize"]
default = ["std"]

# Include std support. This enables types like `Backtrace`.
std = []

#=======================================
# Methods of resolving symbols
#
# - gimli-symbolize: use the `gimli-rs/addr2line` crate to symbolicate
# addresses into file, line, and name using DWARF debug information.
# - libbacktrace: this feature activates the `backtrace-sys` dependency,
# building the libbacktrace library found in gcc repos.
#
# Note that MSVC unconditionally uses the dbghelp library to symbolize and won't
# be affected by feature selection here. Also note that it's highly unlikely you
# want to configure this. If you're having trouble getting backtraces it's
# likely best to open an issue.
gimli-symbolize = ["addr2line", "miniz_oxide", "object"]
libbacktrace = ["backtrace-sys/backtrace-sys"]

#=======================================
# Methods of serialization
#
Expand All @@ -91,11 +74,13 @@ serialize-serde = ["serde"]
# Only here for backwards compatibility purposes or for internal testing
# purposes. New code should use none of these features.
coresymbolication = []
dbghelp = []
dladdr = []
gimli-symbolize = []
kernel32 = []
unix-backtrace = []
libbacktrace = []
libunwind = []
dbghelp = []
unix-backtrace = []
verify-winapi = [
'winapi/dbghelp',
'winapi/handleapi',
Expand Down Expand Up @@ -132,7 +117,7 @@ edition = '2018'

[[test]]
name = "accuracy"
required-features = ["std", "gimli-symbolize"]
required-features = ["std"]
edition = '2018'

[[test]]
Expand Down
27 changes: 0 additions & 27 deletions crates/backtrace-sys/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion crates/backtrace-sys/LICENSE-APACHE

This file was deleted.

1 change: 0 additions & 1 deletion crates/backtrace-sys/LICENSE-MIT

This file was deleted.

168 changes: 0 additions & 168 deletions crates/backtrace-sys/build.rs

This file was deleted.

4 changes: 0 additions & 4 deletions crates/backtrace-sys/src/android-api.c

This file was deleted.

58 changes: 0 additions & 58 deletions crates/backtrace-sys/src/lib.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/backtrace-sys/src/libbacktrace
Submodule libbacktrace deleted from 5c88e0
Loading