Skip to content

Commit 46aad4b

Browse files
cataphractclaude
andcommitted
Fix compile_rust.sh copy and Windows build
compile_rust.sh: only copy datadog-ipc-helper when CARGO_TARGET_DIR is absolute. build-sidecar.sh uses a relative 'target' dir and doesn't need the binary placed in modules/; the unconditional cp was failing because cargo's output is relative to the workspace root (one level above components-rs/) while cp was called from inside components-rs/. libdatadog: add IntoRawHandle to spawn_worker Windows imports so that into_raw_handle() is in scope on Windows builds. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 18e4a0c commit 46aad4b

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

compile_rust.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,16 @@ SIDECAR_VERSION=$(cat ../VERSION) RUSTFLAGS="$SIDECAR_RUSTFLAGS" RUSTC_BOOTSTRAP
5353

5454
# Place datadog-ipc-helper next to where ddtrace.so will be installed so that
5555
# find_sidecar_binary() can locate it via dladdr at runtime.
56-
_ipc_profile="${PROFILE:-debug}"
57-
_ipc_src="${CARGO_TARGET_DIR}/${_ipc_profile}/datadog-ipc-helper"
58-
_ipc_dst="$(dirname "${CARGO_TARGET_DIR%/}")/modules/datadog-ipc-helper"
59-
mkdir -p "$(dirname "$_ipc_dst")"
60-
cp "$_ipc_src" "$_ipc_dst"
56+
# Only do this when CARGO_TARGET_DIR is an absolute path (test/cmake builds).
57+
# Distribution builds (build-sidecar.sh) use a relative target dir and don't
58+
# need the binary placed in modules/.
59+
case "$CARGO_TARGET_DIR" in
60+
/*)
61+
_ipc_profile="${PROFILE:-debug}"
62+
_ipc_src="${CARGO_TARGET_DIR}/${_ipc_profile}/datadog-ipc-helper"
63+
_ipc_dst="$(dirname "${CARGO_TARGET_DIR%/}")/modules/datadog-ipc-helper"
64+
mkdir -p "$(dirname "$_ipc_dst")"
65+
cp "$_ipc_src" "$_ipc_dst"
66+
;;
67+
esac
6168

libdatadog

0 commit comments

Comments
 (0)