Skip to content

Commit 73f5254

Browse files
Use libdatadog for dotnet (#8186)
## Summary of changes Migrate native dependency from DataDog/libdatadog to DataDog/libdatadog-dotnet v1.3.5. ## Reason for change libdatadog-dotnet is a .NET-specific distribution of libdatadog with a minimal feature preset tailored to the needs of the .NET tracer (`profiling`, `crashtracker`, `symbolizer`, `library-config`), resulting in smaller binaries and a more focused build. It drops the FFI modules the tracer doesn't use (`data-pipeline`, `log`, `telemetry`, `ddsketch`, `ffe`). ## Implementation details - Updated build/cmake/FindLibdatadog.cmake: version, download URLs, and SHA256 hashes for all 6 Linux/macOS platform variants - Updated build/vcpkg_local_ports/libdatadog/portfile.cmake: download URL and SHA512 hashes for both Windows variants (x64, x86) - Updated build/vcpkg_local_ports/libdatadog/vcpkg.json: version string to 1.3.5 All download URLs changed from github.com/DataDog/libdatadog to github.com/DataDog/libdatadog-dotnet. ## Test coverage No test changes — this is a dependency version/source update. Existing CI builds and native profiler tests validate the binary compatibility. The v1.3.5 artifacts were additionally verified against official libdatadog v32.0.0 across all 8 platforms: identical package layout and headers, and the exported symbol set is a strict subset (only the intentionally-dropped feature symbols differ — no profiling/crashtracker/library-config/common symbol is missing). ## Other details <!-- Fixes #{issue} --> <!-- ⚠️ Note: Where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. MergeQueue is NOT enabled in this repository. If you have write access to the repo, the PR has 1-2 approvals (see above), and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #apm-dotnet channel in Slack. --> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6e0f7d7 commit 73f5254

5 files changed

Lines changed: 55 additions & 30 deletions

File tree

.claude/skills/bump-libdatadog/SKILL.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,25 @@ description: >-
99

1010
## Overview
1111

12-
libdatadog is consumed as prebuilt native binaries from GitHub releases. There are **two independent version pins** that may need updating:
12+
The native library is consumed as prebuilt binaries from GitHub releases of
13+
[**`DataDog/libdatadog-dotnet`**](https://github.com/DataDog/libdatadog-dotnet) — the .NET-specific
14+
distribution of libdatadog (a minimal feature preset: `profiling`, `crashtracker`, `symbolizer`,
15+
`library-config`). This is **not** upstream `DataDog/libdatadog`.
16+
17+
> **Version scheme:** the pinned version is libdatadog-dotnet's **own** release version (e.g. `v1.3.5`),
18+
> which is distinct from the upstream libdatadog version it is built from (tracked by `LIBDATADOG_VERSION`
19+
> in that repo — e.g. libdatadog-dotnet `v1.3.5` is built from upstream libdatadog `v32.0.0`). Pin the
20+
> **libdatadog-dotnet** version here, not the upstream one.
21+
22+
There are **two version pins** to update, both from the same libdatadog-dotnet release:
1323

1424
| Platform | File | Hash type | Version format |
1525
|----------|------|-----------|----------------|
1626
| Linux/macOS | `build/cmake/FindLibdatadog.cmake` | SHA-256 | `v<MAJOR>.<MINOR>.<PATCH>` |
1727
| Windows | `build/vcpkg_local_ports/libdatadog/vcpkg.json` + `portfile.cmake` | SHA-512 | `<MAJOR>.<MINOR>.<PATCH>` (no `v` prefix) |
1828

19-
These versions can differ (Windows may lag behind Linux/macOS). Confirm with the user which platforms to update.
29+
A libdatadog-dotnet release builds all 8 platform artifacts together, so the two pins should normally
30+
move to the **same** version in lockstep. Confirm with the user if they intend otherwise.
2031

2132
## Files to Modify
2233

@@ -55,21 +66,21 @@ Artifact filenames:
5566

5667
Ask the user for the target version, or check the latest release:
5768
```
58-
https://github.com/DataDog/libdatadog/releases
69+
https://github.com/DataDog/libdatadog-dotnet/releases
5970
```
6071

6172
### Step 2: Get hashes from the release page
6273

6374
SHA-256 and SHA-512 checksums are published directly in the GitHub release notes. Either:
6475

65-
1. Visit `https://github.com/DataDog/libdatadog/releases/tag/v<VERSION>` and copy from the checksums sections, or
76+
1. Visit `https://github.com/DataDog/libdatadog-dotnet/releases/tag/v<VERSION>` and copy from the checksums sections, or
6677
2. Run the helper script which fetches them via the GitHub API:
6778

6879
```bash
6980
bash .claude/skills/bump-libdatadog/scripts/fetch-release-hashes.sh <VERSION>
7081
```
7182

72-
Where `<VERSION>` is without the `v` prefix (e.g. `33.0.0`).
83+
Where `<VERSION>` is without the `v` prefix (e.g. `1.3.5`).
7384

7485
The release notes contain:
7586
- **SHA256 checksums** section → for `FindLibdatadog.cmake` (6 Linux/macOS artifacts)
@@ -110,10 +121,16 @@ These don't contain version strings but may need refreshing after a bump if the
110121

111122
CI will fail if the symbol list changes — re-run the Alpine symbol validation step and accept the new snapshot.
112123

124+
Because libdatadog-dotnet ships a reduced feature set (no `data-pipeline`, `log`, `telemetry`,
125+
`ddsketch`, or `ffe`), its exported symbols are a strict subset of upstream libdatadog — so these
126+
snapshots reflect that smaller set. The glibc cap in `Build.Profiler.Steps.cs`
127+
(`libdatadog_profiling` ≤ 2.15 on x64, ≤ 2.17 on arm64) still applies and is unchanged by the source
128+
switch — libdatadog-dotnet x64 builds are capped at GLIBC 2.15, same as upstream.
129+
113130
## Optional Updates (doc-comment SHAs)
114131

115-
Several files under `tracer/src/Datadog.Trace/LibDatadog/` have XML doc comments linking to a specific libdatadog git SHA (e.g. `60583218a8de6768f67d04fcd5bc6443f67f516b`). These are informational only and can be updated for traceability:
116-
- `VecU8.cs`, `ByteSlice.cs`, `CharSlice.cs`, `Error.cs`
132+
Several files under `tracer/src/Datadog.Trace/LibDatadog/` have XML doc comments linking to a specific upstream libdatadog git SHA (e.g. `60583218a8de6768f67d04fcd5bc6443f67f516b`). These are informational only and can be updated for traceability (use the upstream SHA the libdatadog-dotnet release was built from):
133+
- `VecU8.cs`, `CharSlice.cs`, `Error.cs`
117134
- `ServiceDiscovery/ResultTag.cs`, `ServiceDiscovery/TracerMemfdHandleResult.cs`
118135

119136
## Related Files (no changes needed, but useful context)
@@ -127,7 +144,7 @@ Several files under `tracer/src/Datadog.Trace/LibDatadog/` have XML doc comments
127144

128145
## Important Notes
129146

130-
- The CMake file uses **SHA-256** hashes; the vcpkg portfile uses **SHA-512** hashes. Both are published in the GitHub release notes.
131-
- The CMake version has a `v` prefix (`v32.0.0`); vcpkg does not (`30.0.0`).
147+
- The CMake file uses **SHA-256** hashes; the vcpkg portfile uses **SHA-512** hashes. Both are published in the libdatadog-dotnet GitHub release notes (under `## Checksums`).
148+
- The CMake version has a `v` prefix (`v1.3.5`); vcpkg does not (`1.3.5`).
132149
- If a release doesn't have all platform artifacts, the bump may need to wait or be partial.
133150
- After bumping, CI will validate the hashes on all platforms. Hash mismatches cause clear build failures.

.claude/skills/bump-libdatadog/scripts/fetch-release-hashes.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# Fetches SHA-256 and SHA-512 checksums from a libdatadog GitHub release page.
4+
# Fetches SHA-256 and SHA-512 checksums from a libdatadog-dotnet GitHub release.
55
# Usage: ./fetch-release-hashes.sh <VERSION>
6-
# Example: ./fetch-release-hashes.sh 33.0.0
6+
# Example: ./fetch-release-hashes.sh 1.3.5
77
#
88
# The version should NOT include the 'v' prefix.
99
# Checksums are published in the release notes — no need to download artifacts.
10+
#
11+
# NOTE: dd-trace-dotnet consumes the .NET-specific distribution
12+
# DataDog/libdatadog-dotnet, NOT upstream DataDog/libdatadog. The release
13+
# version here (e.g. 1.3.5) is libdatadog-dotnet's own version, which is
14+
# distinct from the upstream libdatadog version it is built from.
1015

11-
VERSION="${1:?Usage: $0 <VERSION> (e.g. 33.0.0)}"
12-
RELEASE_URL="https://api.github.com/repos/DataDog/libdatadog/releases/tags/v${VERSION}"
16+
VERSION="${1:?Usage: $0 <VERSION> (e.g. 1.3.5)}"
17+
RELEASE_URL="https://api.github.com/repos/DataDog/libdatadog-dotnet/releases/tags/v${VERSION}"
1318

1419
echo "============================================"
15-
echo "libdatadog v${VERSION} — Fetching checksums"
20+
echo "libdatadog-dotnet v${VERSION} — Fetching checksums"
1621
echo "============================================"
1722
echo ""
1823

1924
BODY=$(curl -fsSL "$RELEASE_URL" | jq -r '.body')
2025

26+
# The release body lists both SHA256 and SHA512 checksums. Rather than depend on
27+
# the exact section headings, split by hash length: SHA-256 is 64 hex chars,
28+
# SHA-512 is 128. This is robust to release-note formatting changes.
2129
echo ">>> SHA-256 checksums (for build/cmake/FindLibdatadog.cmake) <<<"
2230
echo ""
23-
echo "$BODY" | sed -n '/^## SHA256 checksums/,/^## /{/^```$/d;/^## /d;/^$/d;p}'
31+
echo "$BODY" | grep -E '^[0-9a-f]{64} libdatadog-' || echo "(none found — check release notes format)"
2432
echo ""
2533

2634
echo ">>> SHA-512 checksums (for build/vcpkg_local_ports/libdatadog/portfile.cmake) <<<"
2735
echo ""
28-
echo "$BODY" | sed -n '/^## SHA512 checksums/,/^---/{/^```$/d;/^---/d;/^## /d;/^$/d;p}'
36+
echo "$BODY" | grep -E '^[0-9a-f]{128} libdatadog-' || echo "(none found — check release notes format)"
2937
echo ""
3038

3139
echo "============================================"

build/cmake/FindLibdatadog.cmake

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ endif()
44

55
include(FetchContent)
66

7-
set(LIBDATADOG_VERSION "v32.0.0" CACHE STRING "libdatadog version")
7+
set(LIBDATADOG_VERSION "v1.3.5" CACHE STRING "libdatadog version")
88

99
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
1010
# For Darwin, we'll download both architectures and combine them
11-
set(SHA256_LIBDATADOG_ARM64 "3f87294f613290c4946899f02a3944f75d6b6077f156d105bb1a90bbbfeffa9d" CACHE STRING "libdatadog arm64 sha256")
12-
set(SHA256_LIBDATADOG_X86_64 "55cd1ccf175aff19380a60b96ff2ce55ff6fb5ceabf15d81de595e9b0c7a9425" CACHE STRING "libdatadog x86_64 sha256")
11+
set(SHA256_LIBDATADOG_ARM64 "fee0ed78f0314beb8cecbca1bdfb2d8725d4464dfdfe3a40bad2b4c68ad6f0a7" CACHE STRING "libdatadog arm64 sha256")
12+
set(SHA256_LIBDATADOG_X86_64 "66723a9ea8ced3e55c4220a97c6db97693c69b68704b6c85c742d99283cb6650" CACHE STRING "libdatadog x86_64 sha256")
1313
set(FILE_TO_DOWNLOAD_ARM64 libdatadog-aarch64-apple-darwin.tar.gz)
1414
set(FILE_TO_DOWNLOAD_X86_64 libdatadog-x86_64-apple-darwin.tar.gz)
1515

1616
# Download ARM64 version
1717
FetchContent_Declare(libdatadog-install-arm64
18-
URL https://github.com/DataDog/libdatadog/releases/download/${LIBDATADOG_VERSION}/${FILE_TO_DOWNLOAD_ARM64}
18+
URL https://github.com/DataDog/libdatadog-dotnet/releases/download/${LIBDATADOG_VERSION}/${FILE_TO_DOWNLOAD_ARM64}
1919
URL_HASH SHA256=${SHA256_LIBDATADOG_ARM64}
2020
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/libdatadog-install-arm64
2121
)
@@ -25,7 +25,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
2525

2626
# Download x86_64 version
2727
FetchContent_Declare(libdatadog-install-x86_64
28-
URL https://github.com/DataDog/libdatadog/releases/download/${LIBDATADOG_VERSION}/${FILE_TO_DOWNLOAD_X86_64}
28+
URL https://github.com/DataDog/libdatadog-dotnet/releases/download/${LIBDATADOG_VERSION}/${FILE_TO_DOWNLOAD_X86_64}
2929
URL_HASH SHA256=${SHA256_LIBDATADOG_X86_64}
3030
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/libdatadog-install-x86_64
3131
)
@@ -62,24 +62,24 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
6262
else()
6363
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
6464
if(DEFINED ENV{IsAlpine} AND "$ENV{IsAlpine}" MATCHES "true")
65-
set(SHA256_LIBDATADOG "0b9ff32bde3d7f49b2882dd9d1f61d3a1a3b13382e83578b06ec19e38b7a6de0" CACHE STRING "libdatadog sha256")
65+
set(SHA256_LIBDATADOG "670236a83e56f45a1b01589656d71d2981bb284dd29f6c62c52cafe6c4733adf" CACHE STRING "libdatadog sha256")
6666
set(FILE_TO_DOWNLOAD libdatadog-aarch64-alpine-linux-musl.tar.gz)
6767
else()
68-
set(SHA256_LIBDATADOG "9b7a0551ff9161983635d5890558d3e5ad4eaa9910f92fa850872c9e80d84a8f" CACHE STRING "libdatadog sha256")
68+
set(SHA256_LIBDATADOG "2f0b603751b0633c0c012dcfb04361ac1e338c495098d846e35eaa41d823dc5a" CACHE STRING "libdatadog sha256")
6969
set(FILE_TO_DOWNLOAD libdatadog-aarch64-unknown-linux-gnu.tar.gz)
7070
endif()
7171
else()
7272
if(DEFINED ENV{IsAlpine} AND "$ENV{IsAlpine}" MATCHES "true")
73-
set(SHA256_LIBDATADOG "297125a1632a975147951d17735574975e9a6c0904454eb71d24142f2616ab30" CACHE STRING "libdatadog sha256")
73+
set(SHA256_LIBDATADOG "0937a1fdcc34b309386be8d05eef8faed0e0b3f5fb71549d4b7d2c55de17d6ec" CACHE STRING "libdatadog sha256")
7474
set(FILE_TO_DOWNLOAD libdatadog-${CMAKE_SYSTEM_PROCESSOR}-alpine-linux-musl.tar.gz)
7575
else()
76-
set(SHA256_LIBDATADOG "83a347fd2050cc485a9b3112707867085d27522efe5051fb3a2fb1fef18d5fd3" CACHE STRING "libdatadog sha256")
76+
set(SHA256_LIBDATADOG "7e8d9639f3b82ae31deadce2b3ce0a080eff5c4d0b1660f49a7d84b0243d3456" CACHE STRING "libdatadog sha256")
7777
set(FILE_TO_DOWNLOAD libdatadog-${CMAKE_SYSTEM_PROCESSOR}-unknown-linux-gnu.tar.gz)
7878
endif()
7979
endif()
8080

8181
FetchContent_Declare(libdatadog-install
82-
URL https://github.com/DataDog/libdatadog/releases/download/${LIBDATADOG_VERSION}/${FILE_TO_DOWNLOAD}
82+
URL https://github.com/DataDog/libdatadog-dotnet/releases/download/${LIBDATADOG_VERSION}/${FILE_TO_DOWNLOAD}
8383
URL_HASH SHA256=${SHA256_LIBDATADOG}
8484
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/libdatadog-install
8585
)

build/vcpkg_local_ports/libdatadog/portfile.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ set(LIBDATADOG_VERSION ${VERSION})
33
if(TARGET_TRIPLET STREQUAL "x64-windows" OR
44
TARGET_TRIPLET STREQUAL "x64-windows-static")
55
set(PLATFORM "x64")
6-
set(LIBDATADOG_HASH "ac9020f33f227544f0e66ab40ab854104d7c27459ca02c5e9afb566fc0721e63f36c61f1e9de8f0ba203898b5e75e58b3f3a200e17e23341c41ba6e8744e5c25")
6+
set(LIBDATADOG_HASH "3d469fe5cb8b58d9acc7af1ecb378300191cccf3260c60ec35b3fbcf58f2746dda579bbe20500f389ac26496a8b4fa54036850bfb40a3acdeba6153f593cbf37")
77
elseif(TARGET_TRIPLET STREQUAL "x86-windows" OR
88
TARGET_TRIPLET STREQUAL "x86-windows-static")
99
set(PLATFORM "x86")
10-
set(LIBDATADOG_HASH "f8853437a2e70f003bab4abede8bed5ac0c1e98134b59d7af7f7ef8e466fccb9e070be887fc915850765fc0a1868bed748b6610fbd52791bf06ddf008d0a898c")
10+
set(LIBDATADOG_HASH "eb867dd50d6d9080d73840c12bf9791efa8e1b5999fc117525b8adf0b629d50b55719cc07693a98986a1506321612288e996bf9d5272d53545f9750fecb6c02d")
1111
else()
1212
message(FATAL_ERROR "Unsupported triplet: ${TARGET_TRIPLET}")
1313
endif()
1414

1515
# Define the version and download URL for the prebuilt binaries
1616
set(LIBDATADOG_FILENAME "libdatadog-${PLATFORM}-windows")
1717
set(LIBDATADOG_ARTIFACT "${LIBDATADOG_FILENAME}.zip")
18-
set(LIBDATADOG_URL "https://github.com/DataDog/libdatadog/releases/download/v${LIBDATADOG_VERSION}/${LIBDATADOG_ARTIFACT}")
18+
set(LIBDATADOG_URL "https://github.com/DataDog/libdatadog-dotnet/releases/download/v${LIBDATADOG_VERSION}/${LIBDATADOG_ARTIFACT}")
1919

2020
# Download and extract the prebuilt binaries
2121
vcpkg_download_distfile(ARCHIVE
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "libdatadog",
3-
"version-string": "32.0.0",
3+
"version-string": "1.3.5",
44
"description": "Package providing libdatadog prebuilt binaries for Windows only.",
55
"dependencies": []
66
}

0 commit comments

Comments
 (0)