From 0dde5c02a95fa3dc42e1526a52778f652d642965 Mon Sep 17 00:00:00 2001 From: paullegranddc Date: Fri, 21 Apr 2023 15:04:53 +0200 Subject: [PATCH 1/2] * Add ipc crate to cbindgen config * PlatformHandle is not ABI stable since it contains an Arc cell --- ddtelemetry-ffi/cbindgen.toml | 2 +- ipc/src/platform/unix/platform_handle.rs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ddtelemetry-ffi/cbindgen.toml b/ddtelemetry-ffi/cbindgen.toml index 70f87a8e4..58eaff48b 100644 --- a/ddtelemetry-ffi/cbindgen.toml +++ b/ddtelemetry-ffi/cbindgen.toml @@ -34,4 +34,4 @@ must_use = "DDOG_CHECK_RETURN" [parse] parse_deps = true -include = ["ddcommon", "ddtelemetry", "ddcommon-ffi"] +include = ["ddcommon", "ddtelemetry", "ddcommon-ffi", "datadog-ipc"] diff --git a/ipc/src/platform/unix/platform_handle.rs b/ipc/src/platform/unix/platform_handle.rs index d6199149e..aff9f6d71 100644 --- a/ipc/src/platform/unix/platform_handle.rs +++ b/ipc/src/platform/unix/platform_handle.rs @@ -19,7 +19,6 @@ use crate::handles::TransferHandles; /// PlatformHandle contains a valid reference counted FileDescriptor and associated Type information /// allowing safe transfer and sharing of file handles across processes, and threads #[derive(Serialize, Deserialize, Debug)] -#[repr(C)] pub struct PlatformHandle { fd: RawFd, // Just an fd number to be used as reference e.g. when serializing, not for accessing actual fd #[serde(skip)] From 878a195ee8e3c24c305f0407ffae9a74d86efb9c Mon Sep 17 00:00:00 2001 From: paullegranddc Date: Fri, 21 Apr 2023 15:08:56 +0200 Subject: [PATCH 2/2] * NativeUnixStream is not ABI stable either since it embeds a PlatformHandle --- ddtelemetry-ffi/src/sidecar/unix.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/ddtelemetry-ffi/src/sidecar/unix.rs b/ddtelemetry-ffi/src/sidecar/unix.rs index bed6760a7..5316e5886 100644 --- a/ddtelemetry-ffi/src/sidecar/unix.rs +++ b/ddtelemetry-ffi/src/sidecar/unix.rs @@ -28,7 +28,6 @@ pub struct NativeFile { pub handle: Box>, } -#[repr(C)] pub struct NativeUnixStream { pub handle: PlatformHandle, }