Skip to content

Commit 6222f70

Browse files
committed
Remove libbacktrace implementation
This commit removes the `backtrace-sys` crate and the libbacktrace implementation of this crate. For quite some time now the `gimli-symbolize` feture has been on-by-default. While `libbacktrace` has been an option all relevant features should have been implemented in `gimli-symbolize` by now. The libbacktrace implementation has always been approached with wariness where it may segfault or cause worse behavior when fed bad debug information. Debug information is possible to change at runtime, so libbacktrace has always been a risk for Rust binaries. Additionally libbacktrace development was very quite for a very long time and our patches upstream were generally met with silence. Development seems to have picked back up upstream but with this crate now switched to gimli I'm not too personally motivated to check to see if all our fixes have landed. In general, though, libbacktrace upstream always worked best with Linux and other platforms were more "best-effort". Additionally gimli now has more features for supporting compressed and split-debuginfo as well. This commit comes about to reduce the maintenance burden on this crate. Recent changes in rust-lang/rust have actually broken libbacktrace testing. This appears fixed with sync'ing to the upstream repository of libbacktrace, but it seems like now's the right time to go ahead and remove the crate.
1 parent fbb9fc1 commit 6222f70

File tree

11 files changed

+7
-769
lines changed

11 files changed

+7
-769
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,39 +52,21 @@ jobs:
5252
shell: bash
5353
if: matrix.rust == 'stable-i686-msvc'
5454

55-
# Force packed debuginfo on macOS because libbacktrace only works with
56-
# packed debuginfo. We specifically test later that both packed and
57-
# unpacked work.
58-
- run: |
59-
echo CARGO_PROFILE_DEV_SPLIT_DEBUGINFO=packed >> $GITHUB_ENV
60-
echo CARGO_PROFILE_TEST_SPLIT_DEBUGINFO=packed >> $GITHUB_ENV
61-
if: matrix.os == 'macos-latest'
62-
6355
- run: cargo build --manifest-path crates/backtrace-sys/Cargo.toml
6456
- run: cargo build
6557
- run: cargo test
66-
- run: cargo test --features "gimli-symbolize"
67-
# run: cargo test --features "libbacktrace"
68-
- run: cargo check --features "libbacktrace gimli-symbolize"
6958
- run: cargo test --features "serialize-rustc"
7059
- run: cargo test --features "serialize-serde"
7160
- run: cargo test --features "verify-winapi"
7261
- run: cargo test --features "cpp_demangle"
7362
- run: cargo test --no-default-features
74-
- run: cargo test --no-default-features --features "libbacktrace"
75-
- run: cargo test --no-default-features --features "gimli-symbolize"
76-
- run: cargo test --no-default-features --features "gimli-symbolize libbacktrace"
77-
- run: cargo test --no-default-features --features "libbacktrace std"
78-
- run: cargo test --no-default-features --features "gimli-symbolize std"
7963
- run: cargo test --no-default-features --features "std"
8064
- run: cargo test --manifest-path crates/cpp_smoke_test/Cargo.toml
8165
- run: cargo test --manifest-path crates/macos_frames_test/Cargo.toml
82-
- run: cargo test --features libbacktrace --manifest-path crates/without_debuginfo/Cargo.toml
8366
- run: cargo test --features gimli-symbolize --manifest-path crates/without_debuginfo/Cargo.toml
84-
- run: cargo test --manifest-path crates/line-tables-only/Cargo.toml --features libbacktrace
8567
- run: cargo test --manifest-path crates/line-tables-only/Cargo.toml --features gimli-symbolize
8668

87-
# Test that if debuginfo is compressed gimli still works
69+
# Test debuginfo compression still works
8870
- run: cargo test
8971
if: contains(matrix.os, 'ubuntu')
9072
env:

Cargo.toml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ exclude = ['crates/without_debuginfo', 'crates/macos_frames_test', 'crates/line-
2222
[dependencies]
2323
cfg-if = "1.0"
2424
rustc-demangle = "0.1.4"
25-
backtrace-sys = { path = "crates/backtrace-sys", version = "0.1.35", optional = true, default_features = false }
2625
libc = { version = "0.2.94", default-features = false }
2726

2827
# Optionally enable the ability to serialize a `Backtrace`, controlled through
@@ -58,26 +57,11 @@ libloading = "0.6"
5857

5958
[features]
6059
# By default libstd support and gimli-symbolize is used to symbolize addresses.
61-
default = ["std", "gimli-symbolize"]
60+
default = ["std"]
6261

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

66-
#=======================================
67-
# Methods of resolving symbols
68-
#
69-
# - gimli-symbolize: use the `gimli-rs/addr2line` crate to symbolicate
70-
# addresses into file, line, and name using DWARF debug information.
71-
# - libbacktrace: this feature activates the `backtrace-sys` dependency,
72-
# building the libbacktrace library found in gcc repos.
73-
#
74-
# Note that MSVC unconditionally uses the dbghelp library to symbolize and won't
75-
# be affected by feature selection here. Also note that it's highly unlikely you
76-
# want to configure this. If you're having trouble getting backtraces it's
77-
# likely best to open an issue.
78-
gimli-symbolize = ["addr2line", "miniz_oxide", "object"]
79-
libbacktrace = ["backtrace-sys/backtrace-sys"]
80-
8165
#=======================================
8266
# Methods of serialization
8367
#
@@ -91,11 +75,13 @@ serialize-serde = ["serde"]
9175
# Only here for backwards compatibility purposes or for internal testing
9276
# purposes. New code should use none of these features.
9377
coresymbolication = []
78+
dbghelp = []
9479
dladdr = []
80+
gimli-symbolize = []
9581
kernel32 = []
96-
unix-backtrace = []
82+
libbacktrace = []
9783
libunwind = []
98-
dbghelp = []
84+
unix-backtrace = []
9985
verify-winapi = [
10086
'winapi/dbghelp',
10187
'winapi/handleapi',
@@ -132,7 +118,7 @@ edition = '2018'
132118

133119
[[test]]
134120
name = "accuracy"
135-
required-features = ["std", "gimli-symbolize"]
121+
required-features = ["std"]
136122
edition = '2018'
137123

138124
[[test]]

crates/backtrace-sys/Cargo.toml

Lines changed: 0 additions & 27 deletions
This file was deleted.

crates/backtrace-sys/LICENSE-APACHE

Lines changed: 0 additions & 1 deletion
This file was deleted.

crates/backtrace-sys/LICENSE-MIT

Lines changed: 0 additions & 1 deletion
This file was deleted.

crates/backtrace-sys/build.rs

Lines changed: 0 additions & 168 deletions
This file was deleted.

crates/backtrace-sys/src/android-api.c

Lines changed: 0 additions & 4 deletions
This file was deleted.

crates/backtrace-sys/src/lib.rs

Lines changed: 0 additions & 58 deletions
This file was deleted.

crates/backtrace-sys/src/libbacktrace

Submodule libbacktrace deleted from 5c88e09

0 commit comments

Comments
 (0)