From 66a0920418c9592df1e950aebb261d5d0f9f68b1 Mon Sep 17 00:00:00 2001 From: Levi Morrison Date: Fri, 4 Sep 2026 16:28:05 -0600 Subject: [PATCH] fix(php): profiling marker checks --- utils/build/docker/php/common/install_ddtrace.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/build/docker/php/common/install_ddtrace.sh b/utils/build/docker/php/common/install_ddtrace.sh index a05b7411263..bc35eafb709 100755 --- a/utils/build/docker/php/common/install_ddtrace.sh +++ b/utils/build/docker/php/common/install_ddtrace.sh @@ -76,9 +76,14 @@ if [ "$(printf '%s\n' "7.1" "$PHP_VERSION" | sort -V | head -n1)" = "7.1" ]; the # Only enable profiling if the bundle actually contains a profiling extension. # When installing from a local package that was built without profiling support, # passing --enable-profiling causes datadog-setup.php to exit with an error. + # Older packages ship a separate "datadog-profiling[.-]*" binary; newer combined + # (tracer+profiling in one ddtrace.so) packages instead ship a per-API-version + # marker file named ".ddtrace[-zts|-debug].profiling" (see datadog-setup.php's + # $shouldInstallProfiling). Check for either so this works regardless of which + # package format is being installed. PKG_HAS_PROFILING=0 if [ -n "${PKG:-}" ]; then - if tar -tzf "$PKG" 2>/dev/null | grep -q "datadog-profiling"; then + if tar -tzf "$PKG" 2>/dev/null | grep -q -e "datadog-profiling" -e '\.ddtrace\(-zts\|-debug\)\?\.profiling$'; then PKG_HAS_PROFILING=1 fi else