forked from getsentry/symbolicator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add native crash reporter (getsentry#795)
feat: Add native crash reporter This adds an optional native crash reporter modeled on `relay-crash`.
- Loading branch information
1 parent
7926bfd
commit b6b7511
Showing
12 changed files
with
324 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "crates/symbolicator-crash/sentry-native"] | ||
path = crates/symbolicator-crash/sentry-native | ||
url = https://github.com/getsentry/sentry-native |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "symbolicator-crash" | ||
authors = ["Sentry <[email protected]>"] | ||
description = "Native crash reporting for Symbolicator" | ||
homepage = "https://getsentry.github.io/symbolicator/" | ||
repository = "https://github.com/getsentry/symbolicator" | ||
version = "0.5.0" | ||
edition = "2018" | ||
build = "build.rs" | ||
license-file = "../LICENSE" | ||
publish = false | ||
|
||
[dependencies] | ||
|
||
[build-dependencies] | ||
bindgen = "0.59.1" | ||
cmake = { version = "0.1.46" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
use std::path::{Path, PathBuf}; | ||
use std::process::Command; | ||
|
||
fn main() { | ||
// sentry-native dependencies | ||
match std::env::var("CARGO_CFG_TARGET_OS").unwrap().as_str() { | ||
"macos" => println!("cargo:rustc-link-lib=dylib=c++"), | ||
"linux" => println!("cargo:rustc-link-lib=dylib=stdc++"), | ||
_ => return, // allow building with --all-features, fail during runtime | ||
} | ||
|
||
println!("cargo:rustc-link-lib=curl"); | ||
|
||
if !Path::new("sentry-native/.git").exists() { | ||
let _ = Command::new("git") | ||
.args(&["submodule", "update", "--init", "--recursive"]) | ||
.status(); | ||
} | ||
|
||
let destination = cmake::Config::new("sentry-native") | ||
// we never need a debug build of sentry-native | ||
.profile("RelWithDebInfo") | ||
// always build breakpad regardless of platform defaults | ||
.define("SENTRY_BACKEND", "breakpad") | ||
// build a static library | ||
.define("BUILD_SHARED_LIBS", "OFF") | ||
// disable additional targets | ||
.define("SENTRY_BUILD_TESTS", "OFF") | ||
.define("SENTRY_BUILD_EXAMPLES", "OFF") | ||
.build(); | ||
|
||
println!( | ||
"cargo:rustc-link-search=native={}", | ||
destination.join("lib").display() | ||
); | ||
println!("cargo:rustc-link-lib=static=breakpad_client"); | ||
println!("cargo:rustc-link-lib=static=sentry"); | ||
|
||
let bindings = bindgen::Builder::default() | ||
.header("sentry-native/include/sentry.h") | ||
.parse_callbacks(Box::new(bindgen::CargoCallbacks)) | ||
.generate() | ||
.expect("Unable to generate bindings"); | ||
|
||
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap()); | ||
bindings | ||
.write_to_file(out_dir.join("bindings.rs")) | ||
.expect("Couldn't write bindings"); | ||
} |
Submodule sentry-native
added at
bd5610
Oops, something went wrong.