Skip to content

Add scripts/build-for-system-tests.sh for local artifact builds#3703

Draft
bm1549 wants to merge 1 commit intomasterfrom
brian.marks/build-for-system-tests
Draft

Add scripts/build-for-system-tests.sh for local artifact builds#3703
bm1549 wants to merge 1 commit intomasterfrom
brian.marks/build-for-system-tests

Conversation

@bm1549
Copy link

@bm1549 bm1549 commented Mar 13, 2026

Description

Adds scripts/build-for-system-tests.sh, a convenience script for building
dd-trace-php tracer artifacts locally for use with system-tests parametric
testing.

Motivation: Running parametric system-tests against a local branch
requires a dd-library-php-<VERSION>-<arch>-linux-gnu.tar.gz bundle and
datadog-setup.php in the system-tests binaries/ directory. Building these
manually from source is error-prone and poorly documented. This script
automates the entire process. It is especially useful on ARM Mac (Apple
Silicon)
where the standard CI pipeline is not easily accessible and
cross-compilation is otherwise required.

What the script does:

  1. Builds ddtrace.so for PHP 8.2 NTS inside the official
    datadog/dd-trace-ci:php-8.2_buster Docker container (ensuring a correct
    Linux binary regardless of the host OS/arch).
  2. Packages the compiled extension and the src/ directory into the
    dd-library-php/trace/ext/<api>/ddtrace.so bundle structure that
    datadog-setup.php and system-tests expect. Profiling and AppSec
    extensions are intentionally omitted (not needed for parametric tests).
  3. Writes the output to
    build/packages/dd-library-php-<VERSION>-<arch>-linux-gnu.tar.gz.
  4. Optionally copies the tar.gz and datadog-setup.php to a specified
    system-tests binaries/ path via --copy-to <path>.

Usage:

# Build only
./scripts/build-for-system-tests.sh

# Build and copy directly into system-tests
./scripts/build-for-system-tests.sh --copy-to /path/to/system-tests/binaries

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

Adds a convenience script that builds the ddtrace.so extension inside the
official CI Docker container and packages it into the dd-library-php tar.gz
bundle format expected by system-tests parametric testing. Particularly
useful on ARM Mac (Apple Silicon) where the standard CI pipeline is not
readily available.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bm1549 bm1549 added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant