Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e503b4b
build: update Rust MSRV to 1.87
morrisonlevi May 22, 2026
e7581a2
ci: add otel exporter for better diagnostics when things go wrong
morrisonlevi May 22, 2026
5d23d5a
ci: limit build parallelism
morrisonlevi May 22, 2026
3bcc9c9
bump PHP versions and reduce image size
morrisonlevi May 26, 2026
0a6fcaf
Start using bookworm-8 images in CI
morrisonlevi May 27, 2026
807b8f6
docs: explain minimal rust install
morrisonlevi May 27, 2026
079e4d2
Merge remote-tracking branch 'origin/master' into levi/msrv-1.87
morrisonlevi May 27, 2026
fcd0320
ci(appsec): adopt bookworm-8
morrisonlevi May 27, 2026
f07940a
ci: use versioned images for shared-ext too
morrisonlevi May 27, 2026
8ed72a0
ci(appsec): clang 17 to clang 20
morrisonlevi May 27, 2026
434d550
ci(appsec): bump Rust to 1.87
morrisonlevi May 27, 2026
2e7b9d2
bump PHP and Rust for Windows too
morrisonlevi May 27, 2026
6db6faa
fix llvm version mismatch and fix cache key
realFlowControl May 28, 2026
3b2f483
ci: attempt to build Windows images in CI
morrisonlevi May 28, 2026
04ac8af
ci: copy bits of windows_git_setup
morrisonlevi May 28, 2026
f3e85d6
ci: windows buildx didn't support --no-cache
morrisonlevi May 28, 2026
846c5f0
ci: windows didn't even have buildx, way to bury the lede
morrisonlevi May 28, 2026
2f18686
ci: avoid docker compose for windows
morrisonlevi May 28, 2026
e06a566
appsec: backport fmt lib changes for libddwaf
morrisonlevi May 28, 2026
34e219f
ci: verify the compiler shell after install
morrisonlevi May 28, 2026
af9852b
ci: windows more verification in tool images
morrisonlevi May 28, 2026
a24cf8c
ci: rename windows build jobs
morrisonlevi May 28, 2026
20ad988
add missing docker arg
morrisonlevi May 28, 2026
2193635
wip windows
morrisonlevi May 28, 2026
080fff2
upd appsec tag mappings; work around problem due to gradle upgrade
cataphract May 28, 2026
74600d5
wip windows
morrisonlevi May 28, 2026
84caf7c
try to fix vc14
morrisonlevi May 29, 2026
0c19dda
try to fix vc14 tmp folder
morrisonlevi May 29, 2026
725b1ac
sleep for a bit before deleting installer to avoid it being locked still
morrisonlevi May 29, 2026
e7bdebb
simplify vc14 install
morrisonlevi May 29, 2026
d9552a4
adjust vc14 configure args
morrisonlevi May 29, 2026
8880905
oops, full was too much
morrisonlevi May 29, 2026
38fb860
revert base images, vc images were replaced
morrisonlevi May 29, 2026
3537e5d
revert tool images down to just MSRV bump
morrisonlevi May 29, 2026
9e99cc1
patch PHP sdk script
morrisonlevi May 29, 2026
2644abe
drop vc14, PHP 7.0/7.1, and fix php-8.0.30.tar.gz hash
morrisonlevi May 29, 2026
a447f8f
drop the user-agent, it's causing rejections
morrisonlevi May 29, 2026
de8ffe4
move bookworm next to 9
morrisonlevi May 29, 2026
2674fa2
Merge branch 'master' into levi/msrv-1.87
morrisonlevi May 29, 2026
30a0eb8
appsec: bump spdlog's fmt lib too
morrisonlevi May 29, 2026
751af9e
style(appsec): format with clang-format 20
morrisonlevi May 29, 2026
f31d128
fix(appsec): include order for nonnull
morrisonlevi May 29, 2026
0385edb
style(appsec): fix tidy lints, batch 1
morrisonlevi May 29, 2026
d83f701
style(appsec): fix tidy lints, batch 2
morrisonlevi May 29, 2026
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
6 changes: 3 additions & 3 deletions .github/workflows/prof_asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
CARGO_TARGET_DIR: /tmp/build-cargo
RUST_TOOLCHAIN: nightly-2025-06-13
container:
image: datadog/dd-trace-ci:php-${{matrix.php-version}}_bookworm-7
image: datadog/dd-trace-ci:php-${{matrix.php-version}}_bookworm-8
# https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
options: --user root

Expand Down Expand Up @@ -54,10 +54,10 @@ jobs:
set -eux
switch-php ${{ matrix.php-build }}
cd profiling
export CC=clang-19
export CC=clang-20
export CFLAGS='-fsanitize=address -fno-omit-frame-pointer'
export LDFLAGS='-fsanitize=address -shared-libasan'
export RUSTC_LINKER=lld-17
export RUSTC_LINKER=lld-20
triplet=$(uname -m)-unknown-linux-gnu
RUSTFLAGS='-Zsanitizer=address' cargo +${RUST_TOOLCHAIN} build -Zbuild-std=std,panic_abort --target $triplet --profile profiler-release
cp -v "$CARGO_TARGET_DIR/$triplet/profiler-release/libdatadog_php_profiling.so" "$(php-config --extension-dir)/datadog-profiling.so"
Expand Down
30 changes: 23 additions & 7 deletions .github/workflows/prof_correctness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ permissions:
jobs:
prof-correctness:
runs-on: ubuntu-24.04
env:
LLVM_VERSION: "20"
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -46,20 +48,34 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.php-version }}-${{ matrix.phpts }}
key: ${{ runner.os }}-cargo-llvm-${{ env.LLVM_VERSION }}-${{ hashFiles('**/Cargo.lock', 'profiling/rust-toolchain.toml') }}-${{ matrix.php-version }}-${{ matrix.phpts }}

- name: Build profiler
run: |
codename="$(lsb_release -cs)"
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-19 main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${LLVM_VERSION} main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get install -y clang-19 lld-19
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100
sudo update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-19 100
llvm18_packages="$(dpkg-query -W -f='${binary:Package}\n' \
'*clang*18*' '*llvm*18*' '*lld*18*' '*libomp*18*' \
'*libc++*18*' '*libc++abi*18*' '*mlir*18*' '*flang*18*' \
'*bolt*18*' '*polly*18*' 2>/dev/null || true)"
if [ -n "$llvm18_packages" ]; then
sudo apt-get purge -y $llvm18_packages
sudo apt-get autoremove -y
fi
sudo apt-get install -y clang-${LLVM_VERSION} lld-${LLVM_VERSION} llvm-${LLVM_VERSION}-dev libclang-${LLVM_VERSION}-dev libclang-rt-${LLVM_VERSION}-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${LLVM_VERSION} 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${LLVM_VERSION} 100
sudo update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-${LLVM_VERSION} 100
export CC=clang-${LLVM_VERSION}
export CXX=clang++-${LLVM_VERSION}
export LLVM_CONFIG_PATH=/usr/bin/llvm-config-${LLVM_VERSION}
export LIBCLANG_PATH=/usr/lib/llvm-${LLVM_VERSION}/lib
export LD_LIBRARY_PATH="${LIBCLANG_PATH}:${LD_LIBRARY_PATH:-}"
clang --version
ld.lld --version
"$LLVM_CONFIG_PATH" --version
cd profiling
version_number=$(awk -F' = ' '$1 == "channel" { gsub(/"/, "", $2); print $2 }' rust-toolchain.toml)
curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal -y --default-toolchain "$version_number"
Expand All @@ -74,7 +90,7 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.php-version }}-${{ matrix.phpts }}
key: ${{ runner.os }}-cargo-llvm-${{ env.LLVM_VERSION }}-${{ hashFiles('**/Cargo.lock', 'profiling/rust-toolchain.toml') }}-${{ matrix.php-version }}-${{ matrix.phpts }}

- name: Run no profile test
run: |
Expand Down
10 changes: 0 additions & 10 deletions .gitlab/build-profiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ if [ -d '/opt/rh/devtoolset-7' ] ; then
set -eo pipefail
fi

# With clang 20, bindgen fails on aarch64:
# /usr/lib/llvm20/lib/clang/20/include/arm_vector_types.h:20:9: error: unknown type name '__mfp8'
# /usr/lib/llvm20/lib/clang/20/include/arm_vector_types.h:93:24: error: Neon vector size must be 64 or 128 bits
# /usr/lib/llvm20/lib/clang/20/include/arm_vector_types.h:94:24: error: Neon vector size must be 64 or 128 bits
# /usr/lib/llvm20/lib/clang/20/include/arm_neon.h:6374:25: error: incompatible constant for this __builtin_neon function
# etc.
if [ -f /sbin/apk ] && [ $(uname -m) = "aarch64" ]; then
ln -sf ../lib/llvm19/bin/clang /usr/bin/clang
fi

# On CentOS 7 aarch64, clang's resource dir isn't on the default include path,
# causing bindgen to fail with "stddef.h not found".
if [ -d '/opt/rh/devtoolset-7' ] && [ "$(uname -m)" = "aarch64" ]; then
Expand Down
206 changes: 198 additions & 8 deletions .gitlab/ci-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ CentOS:
tags: ["arch:amd64"]
timeout: 4h
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:29.4.0-noble
variables:
DDCI_CONFIGURE_OTEL_EXPORTER: "true"
parallel:
matrix:
- PHP_VERSION:
Expand All @@ -30,8 +32,6 @@ CentOS:
- php-7.4
- php-7.3
- php-7.2
- php-7.1
- php-7.0
script:
- cd dockerfiles/ci/centos/7
- echo "$CI_REGISTRY_TOKEN" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
Expand All @@ -46,6 +46,8 @@ Alpine:
tags: ["arch:amd64"]
timeout: 4h
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:29.4.0-noble
variables:
DDCI_CONFIGURE_OTEL_EXPORTER: "true"
parallel:
matrix:
- PHP_VERSION:
Expand All @@ -59,8 +61,6 @@ Alpine:
- 7.4-alpine
- 7.3-alpine
- 7.2-alpine
- 7.1-alpine
- 7.0-alpine
script:
- cd dockerfiles/ci/alpine_compile_extension
- echo "$CI_REGISTRY_TOKEN" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
Expand All @@ -75,10 +75,13 @@ Bookworm:
tags: ["arch:amd64"]
timeout: 4h
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:29.4.0-noble
variables:
DDCI_CONFIGURE_OTEL_EXPORTER: "true"
parallel:
matrix:
- PHP_VERSION:
- base
- PHP_VERSION:
- php-8.5
- php-8.4
- php-8.3
Expand All @@ -90,8 +93,7 @@ Bookworm:
- php-7.4-shared-ext
- php-7.3
- php-7.2
- php-7.1
- php-7.0
MAKE_JOBS: ["2"]
script:
- cd dockerfiles/ci/bookworm
- echo "$CI_REGISTRY_TOKEN" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
Expand Down Expand Up @@ -121,9 +123,197 @@ Buster:
- php-7.4-shared-ext
- php-7.3
- php-7.2
- php-7.1
- php-7.0
script:
- cd dockerfiles/ci/buster
- echo "$CI_REGISTRY_TOKEN" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
- docker buildx bake --no-cache --pull --push $PHP_VERSION

.windows_image_build:
stage: ci-build
rules:
- when: manual
allow_failure: true
needs: []
tags: ["windows-v2:2019"]
timeout: 6h
variables:
DDCI_CONFIGURE_OTEL_EXPORTER: "true"
GIT_STRATEGY: none
script: |
# Kill leftover containers; a previous run may still hold php_ddtrace.dll open.
$containers = docker ps -aq 2>$null
if ($containers) { docker rm -f $containers 2>$null }

# Use cmd.exe rd from the parent dir: handles junctions/symlinks that PS5.1 Remove-Item cannot.
Write-Host "Performing workspace cleanup..."
$workspace = $PWD.Path
Push-Location ..
cmd /c "rd /s /q ""$workspace"""
if (-not (Test-Path $workspace)) {
New-Item -ItemType Directory -Path $workspace -Force | Out-Null
}
Pop-Location
$remaining = Get-ChildItem -Path . -Force -ErrorAction SilentlyContinue
if ($remaining) { Write-Host "WARNING: could not remove: $($remaining.Name -join ', ')" }
Write-Host "Cleanup complete."

# PS 5.1 ignores $PSNativeCommandUseErrorActionPreference; use $LASTEXITCODE checks instead.
$ErrorActionPreference = 'Stop'

# Manual git clone with proper config.
Write-Host "Cloning repository..."
git config --global core.longpaths true
git config --global core.symlinks true
git clone --branch $env:CI_COMMIT_REF_NAME $env:CI_REPOSITORY_URL .
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: git clone failed. Remaining workspace contents:"
Get-ChildItem -Force | Select-Object Name
exit $LASTEXITCODE
}
git checkout $env:CI_COMMIT_SHA
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

# Initialize submodules.
Write-Host "Initializing submodules..."
git submodule update --init --recursive
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host "Git setup complete."

cd dockerfiles\ci\windows

$env:DOCKER_CONFIG = Join-Path $env:CI_PROJECT_DIR ".docker"
New-Item -ItemType Directory -Force -Path $env:DOCKER_CONFIG | Out-Null
Set-Content -Encoding ascii -Path (Join-Path $env:DOCKER_CONFIG "config.json") -Value '{"auths":{}}'

$env:CI_REGISTRY_TOKEN | docker login -u "$env:CI_REGISTRY_USER" --password-stdin "$env:CI_REGISTRY"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

docker version
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

$targets = @{
"vc14" = @{
Image = "datadog/dd-trace-ci:windows-vc14"
Dockerfile = "basetools.Dockerfile"
BuildArgs = @("vsVersion=vc14", "sdkVersion=2.1.10")
}
"vc15" = @{
Image = "datadog/dd-trace-ci:windows-vc15"
Dockerfile = "basetools.Dockerfile"
BuildArgs = @("vsVersion=vc15", "sdkVersion=2.2.0")
}
"vs16" = @{
Image = "datadog/dd-trace-ci:windows-vs16"
Dockerfile = "basetools.Dockerfile"
BuildArgs = @("vsVersion=vs16", "sdkVersion=2.2.0")
}
"vs17" = @{
Image = "datadog/dd-trace-ci:windows-vs17"
Dockerfile = "basetools.Dockerfile"
BuildArgs = @("vsVersion=vs17", "sdkVersion=2.3.0")
}
"php-8.5" = @{
Image = "datadog/dd-trace-ci:php-8.5_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=8.5.6", "vsVersion=vs17", "phpTarGzUrl=https://www.php.net/distributions/php-8.5.6.tar.gz", "phpSha256Hash=169aaa21c2834b38df8e39169f43bc5bea8d4059a816cfbc59be08fc2bae60cd")
}
"php-8.4" = @{
Image = "datadog/dd-trace-ci:php-8.4_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=8.4.21", "vsVersion=vs17", "phpTarGzUrl=https://www.php.net/distributions/php-8.4.21.tar.gz", "phpSha256Hash=db96ee0a8e5ee7b73a4913a2aeddc162ba2ef16cd34b9347b5b9a6150e1f8e48")
}
"php-8.3" = @{
Image = "datadog/dd-trace-ci:php-8.3_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=8.3.31", "vsVersion=vs16", "phpTarGzUrl=https://www.php.net/distributions/php-8.3.31.tar.gz", "phpSha256Hash=4e7baaf0a690e954a20e7ced3dd633ce8cb8094e2b6b612a55e703ecbbdcbf4f")
}
"php-8.2" = @{
Image = "datadog/dd-trace-ci:php-8.2_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=8.2.31", "vsVersion=vs16", "phpTarGzUrl=https://www.php.net/distributions/php-8.2.31.tar.gz", "phpSha256Hash=083c2f61cc5f527eb293c4c468a91af46a9678785957e023b2796a9db290d870")
}
"php-8.1" = @{
Image = "datadog/dd-trace-ci:php-8.1_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=8.1.32", "vsVersion=vs16", "phpTarGzUrl=https://www.php.net/distributions/php-8.1.32.tar.gz", "phpSha256Hash=4846836d1de27dbd28e89180f073531087029a77e98e8e019b7b2eddbdb1baff")
}
"php-8.0" = @{
Image = "datadog/dd-trace-ci:php-8.0_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=8.0.30", "vsVersion=vs16", "phpTarGzUrl=https://www.php.net/distributions/php-8.0.30.tar.gz", "phpSha256Hash=449d2048fcb20a314d8c218097c6d1047a9f1c5bb72aa54d5d3eba0a27a4c80c")
}
"php-7.4" = @{
Image = "datadog/dd-trace-ci:php-7.4_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=7.4.33", "vsVersion=vc15", "phpTarGzUrl=https://www.php.net/distributions/php-7.4.33.tar.gz", "phpSha256Hash=5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e")
}
"php-7.3" = @{
Image = "datadog/dd-trace-ci:php-7.3_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=7.3.33", "vsVersion=vc15", "phpTarGzUrl=https://www.php.net/distributions/php-7.3.33.tar.gz", "phpSha256Hash=9a369c32c6f52036b0a890f290327f148a1904ee66aa56e2c9a7546da6525ec8")
}
"php-7.2" = @{
Image = "datadog/dd-trace-ci:php-7.2_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=7.2.34", "vsVersion=vc15", "phpTarGzUrl=https://www.php.net/distributions/php-7.2.34.tar.gz", "phpSha256Hash=8b2777c741e83f188d3ca6d8e98ece7264acafee86787298fae57e05d0dddc78")
}
"php-7.1" = @{
Image = "datadog/dd-trace-ci:php-7.1_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=7.1.33", "vsVersion=vc14", "phpTarGzUrl=https://www.php.net/distributions/php-7.1.33.tar.gz", "phpSha256Hash=0055f368ffefe51d5a4483755bd17475e88e74302c08b727952831c5b2682ea2")
}
"php-7.0" = @{
Image = "datadog/dd-trace-ci:php-7.0_windows"
Dockerfile = "Dockerfile"
BuildArgs = @("phpVersion=7.0.33", "vsVersion=vc14", "phpTarGzUrl=https://www.php.net/distributions/php-7.0.33.tar.gz", "phpSha256Hash=d71a6ecb6b13dc53fed7532a7f8f949c4044806f067502f8fb6f9facbb40452a")
}
}

foreach ($target in ($env:WINDOWS_IMAGE_TARGETS -split ' ')) {
if ([string]::IsNullOrWhiteSpace($target)) { continue }
if (-not $targets.ContainsKey($target)) {
Write-Host "ERROR: unknown Windows CI image target $target."
exit 1
}

$config = $targets[$target]
$image = $config["Image"]
$dockerfile = $config["Dockerfile"]
$buildCommand = @("build", "--pull", "--no-cache", "-t", "$image", "-f", "$dockerfile")
foreach ($buildArg in $config["BuildArgs"]) {
$buildCommand += @("--build-arg", "$buildArg")
}
$buildCommand += "."

Write-Host "Building Windows CI image target $target..."
docker @buildCommand
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

Write-Host "Pushing Windows CI image target $target..."
docker push "$image"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}

"Windows 1: Tool Images":
extends: .windows_image_build
parallel:
matrix:
- WINDOWS_IMAGE_TARGETS:
- "vc15"
- "vs16"
- "vs17"

"Windows 2: PHP Images":
extends: .windows_image_build
parallel:
matrix:
- WINDOWS_IMAGE_TARGETS:
- "php-8.5"
- "php-8.4"
- "php-8.3"
- "php-8.2"
- "php-8.1"
- "php-8.0"
- "php-7.4"
- "php-7.3"
- "php-7.2"
Loading
Loading