EmbarkStudios / sentry-contrib-rust

Integrates crashdump reporting with Sentry
Apache License 2.0
18 stars 5 forks source link

Replace breakpad-sys with Rust #4

Open Jake-Shadle opened 3 years ago

Jake-Shadle commented 3 years ago

The original motivation for this repo/crate(s) was to replace our dependency on the significantly heavier combination of sentry-native and sentry-contrib-native with a smaller and simpler way to capture and report native crashes, which it does well as we have been using it for almost half a year now with no issues.

However, any C++ is too much C++, especially when it gets in the way of our development, namely in the case of wanting to compile with musl libc so that can have small static binaries for services running in docker containers that support crash reporting still, but is screwed up due to Breakpad's use of C++.

A significant amount of the Breakpad code is just the usual C++ shenanigans of having custom string functions and guid creation and blah blah, stuff that we don't need in Rust or have excellent crates for, as well as a lot of code dedicated for platforms that we will never care about (wtf still runs Solaris!?) leaving the actual code that needs to be ported to Rust to be quite small, at least relative to the total amount of source in Breakpad.

Jake-Shadle commented 2 years ago

Linking https://github.com/getsentry/symbolic/issues/375 as this issue also includes minidump generation on the platforms we (currently) care about.

Jake-Shadle commented 2 years ago

Now that https://github.com/EmbarkStudios/crash-handling exists we can create a pure Rust implementation to integrate crash handling with Sentry and completely get rid of the C++ mess in Breakpad.

Jake-Shadle commented 1 year ago

In addition, we ideally would just have our own simpler implementation of the sentry sdk that is capable of sending over data to the crash handler process so that things like tags, breadcrumbs, etc are automatically added to crash events, as, unfortunately, this is not really doable with the official sentry sdk itself in a good way.