Skip to content

Commit 51992ba

Browse files
committed
materialized: fix backtraces on macOS
Switch over to the new Gimli-based backtrace symbolicator. Gimli is a pure-Rust reimplementation of libbacktrace that will soon be the default backtrace implementation in the Rust standard library [0]. Switching to it now means we can help shake out problems, like [1], before it ships in the standard library, where fixing problems will require a full six week release cycle. This switch has the side effect of fixing backtraces on macOS, which seem to be broken at the moment because the backtrace crate is picking libbacktrace over coresymbolication. There isn't a good way of fixing that because Cargo doesn't support per-platform features [2]; using neither libbacktrace or coresymbolicator is a kind of stupid but effective way of sidestepping the problem. [0]: rust-lang/rust#73441 [1]: rust-lang/backtrace-rs#342 [2]: rust-lang/cargo#1197
1 parent 4d56e12 commit 51992ba

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

Cargo.lock

Lines changed: 16 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ members = [
3434
"test/test-util",
3535
]
3636

37+
[profile.dev.package]
38+
# Compile the backtrace crate and its dependencies with all optimizations, even
39+
# in dev builds, since otherwise backtraces can take 20s+ to symbolize. With
40+
# optimizations enabled, symbolizing a backtrace takes less than 1s.
41+
addr2line = { opt-level = 3 }
42+
backtrace = { opt-level = 3 }
43+
gimli = { opt-level = 3 }
44+
miniz_oxide = { opt-level = 3 }
45+
object = { opt-level = 3 }
46+
3747
[profile.release]
3848
# Emit only the line info tables, not full debug info, in release builds, to
3949
# substantially reduce the size of the debug info. Line info tables are enough

src/materialized/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = "proprietary"
1111

1212
[dependencies]
1313
async-trait = "0.1.35"
14-
backtrace = { version = "0.3.48", default-features = false, features = ["coresymbolication", "libbacktrace"] }
14+
backtrace = { version = "0.3.49" }
1515
comm = { path = "../comm" }
1616
compile-time-run = "0.2.8"
1717
coord = { path = "../coord" }

0 commit comments

Comments
 (0)