Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ libdatadog is integrated into many runtimes and languages via FFI, and runs in D
- Bubble errors up to the library caller with detail — prefer structured error enums (e.g. `thiserror`) over opaque strings.
- Stay free of global effects unless a feature requires them: no spawning threads, no globals, no reading environment variables behind the caller's back.
- Care about performance, especially memory allocations on hot paths.
- Panics across FFI boundaries are undefined behavior. FFI entry points must catch unwinds (e.g. `std::panic::catch_unwind`) and convert them into error returns rather than letting them propagate into the caller's runtime.
- A panic that reaches an `extern "C"` boundary aborts the host process. FFI entry points must catch unwinds (e.g. `std::panic::catch_unwind`) and convert them into error returns rather than letting them propagate into the caller's runtime. Whether a release artifact gets panic containment is decided by `builder` alone, through its `catch_panic` feature (a default), which propagates to the `catch_panic` feature in `libdd-profiling-ffi/Cargo.toml`. Projects building their own flavor with `builder`'s default features off ask for `catch_panic` explicitly; leaving it out yields abort-on-panic semantics. The FFI examples are what verify containment is on for our own release process.
- The C FFI does **not** offer C ABI backward-compatibility guarantees: callers (Datadog SDKs) pin to specific libdatadog versions, so `#[repr(C)]` layouts, function signatures, and enum variants may change between releases.

### Cryptography
Expand Down
3 changes: 2 additions & 1 deletion builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ default = [
"ddsketch",
"ffe",
"shared-runtime",
"catch_panic",
]
crashtracker = []
profiling = []
Expand All @@ -35,11 +36,11 @@ ddsketch = []
ffe = []
shared-runtime = []
otel-thread-ctx = []
catch_panic = []
regex-lite = ["libdd-common/regex-lite"]

[lib]
bench = false
test = false
doctest = false

[dependencies]
Expand Down
30 changes: 2 additions & 28 deletions builder/src/bin/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use builder::builder::Builder;
use builder::common::Common;
#[cfg(feature = "crashtracker")]
use builder::crashtracker::CrashTracker;
use builder::features::{profiling_features, Selection};
#[cfg(feature = "profiling")]
use builder::profiling::Profiling;
use builder::utils::project_root;
Expand Down Expand Up @@ -54,34 +55,7 @@ pub fn main() {
host.clone()
};

#[allow(clippy::vec_init_then_push)]
let features = {
#[allow(unused_mut)]
let mut f: Vec<String> = vec![];
#[cfg(feature = "telemetry")]
f.push("ddtelemetry-ffi".to_string());
#[cfg(feature = "data-pipeline")]
f.push("data-pipeline-ffi".to_string());
#[cfg(feature = "data-pipeline-compression")]
f.push("data-pipeline-compression".to_string());
#[cfg(feature = "crashtracker")]
f.push("crashtracker-ffi".to_string());
#[cfg(feature = "symbolizer")]
f.push("symbolizer".to_string());
#[cfg(feature = "library-config")]
f.push("datadog-library-config-ffi".to_string());
#[cfg(feature = "log")]
f.push("datadog-log-ffi".to_string());
#[cfg(feature = "ddsketch")]
f.push("ddsketch-ffi".to_string());
#[cfg(feature = "ffe")]
f.push("libdd-ffe-ffi".to_string());
#[cfg(feature = "shared-runtime")]
f.push("shared-runtime".to_string());
#[cfg(feature = "otel-thread-ctx")]
f.push("otel-thread-ctx-ffi".to_string());
f
};
let features = profiling_features(&Selection::from_cargo_features());

let mut builder = Builder::new(
source_path.to_str().unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion builder/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use crate::utils::{file_replace, project_root};
/// Ok(())
/// }
/// }
/// let mut builder = Builder::new("source", "target", "arch", "features", "profile", "version");
/// let mut builder = Builder::new("source", "target", "arch", "profile", "features", "version");
/// let core = Box::new(Core {
/// version: builder.version.clone(),
/// });
Expand Down
Loading
Loading