-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[crashtracker] Move FFI to its own crate (#551)
- Loading branch information
Showing
32 changed files
with
384 additions
and
283 deletions.
There are no files selected for viewing
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
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,33 @@ | ||
# Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
[package] | ||
name = "datadog-crashtracker-ffi" | ||
edition.workspace = true | ||
version.workspace = true | ||
rust-version.workspace = true | ||
license.workspace = true | ||
|
||
[lib] | ||
bench = false | ||
|
||
[features] | ||
default = ["cbindgen", "collector", "demangler", "receiver"] | ||
cbindgen = ["build_common/cbindgen"] | ||
# Enables the in-process collection of crash-info | ||
collector = [] | ||
demangler = ["dep:symbolic-demangle", "dep:symbolic-common"] | ||
# Enables the use of this library to receiver crash-info from a suitable collector | ||
receiver = [] | ||
|
||
[build-dependencies] | ||
build_common = { path = "../build-common" } | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
datadog-crashtracker = { path = "../crashtracker" } | ||
ddcommon = { path = "../ddcommon" } | ||
ddcommon-ffi = { path = "../ddcommon-ffi", default-features = false } | ||
hyper = {version = "0.14", default-features = false} | ||
symbolic-demangle = { version = "12.8.0", default-features = false, features = ["rust", "cpp", "msvc"], optional = true } | ||
symbolic-common = { version = "12.8.0", default-features = false, optional = true } |
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,10 @@ | ||
// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
extern crate build_common; | ||
|
||
use build_common::generate_and_configure_header; | ||
|
||
fn main() { | ||
let header_name = "crashtracker.h"; | ||
generate_and_configure_header(header_name); | ||
} |
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,51 @@ | ||
# Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
language = "C" | ||
cpp_compat = true | ||
tab_width = 2 | ||
header = """// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
""" | ||
include_guard = "DDOG_CRASHTRACKER_H" | ||
style = "both" | ||
pragma_once = true | ||
|
||
no_includes = true | ||
sys_includes = ["stdbool.h", "stddef.h", "stdint.h"] | ||
includes = ["common.h"] | ||
|
||
[export] | ||
prefix = "ddog_crasht_" | ||
renaming_overrides_prefixing = true | ||
|
||
[export.rename] | ||
"ByteSlice" = "ddog_ByteSlice" | ||
"CancellationToken" = "ddog_CancellationToken" | ||
"CharSlice" = "ddog_CharSlice" | ||
"Endpoint" = "ddog_Endpoint" | ||
"Error" = "ddog_Error" | ||
"HttpStatus" = "ddog_HttpStatus" | ||
"Option_U32" = "ddog_Option_U32" | ||
"Slice_CChar" = "ddog_Slice_CChar" | ||
"Slice_I64" = "ddog_Slice_I64" | ||
"Slice_U8" = "ddog_Slice_U8" | ||
"Tag" = "ddog_Tag" | ||
"Timespec" = "ddog_Timespec" | ||
"Vec_Tag" = "ddog_Vec_Tag" | ||
"Vec_U8" = "ddog_Vec_U8" | ||
|
||
[export.mangle] | ||
rename_types = "PascalCase" | ||
|
||
[enum] | ||
prefix_with_name = true | ||
rename_variants = "ScreamingSnakeCase" | ||
|
||
[fn] | ||
must_use = "DDOG_CHECK_RETURN" | ||
|
||
[parse] | ||
parse_deps = true | ||
include = ["ddcommon", "ddcommon-ffi", "datadog-crashtracker", "ux"] | ||
|
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
Oops, something went wrong.