diff --git a/.github/workflows/prof_asan.yml b/.github/workflows/prof_asan.yml index 018215b8c3e..6baa3d6b7ef 100644 --- a/.github/workflows/prof_asan.yml +++ b/.github/workflows/prof_asan.yml @@ -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 @@ -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" diff --git a/.github/workflows/prof_correctness.yml b/.github/workflows/prof_correctness.yml index f61a708b58e..d30c483c90d 100644 --- a/.github/workflows/prof_correctness.yml +++ b/.github/workflows/prof_correctness.yml @@ -11,6 +11,8 @@ permissions: jobs: prof-correctness: runs-on: ubuntu-24.04 + env: + LLVM_VERSION: "20" strategy: fail-fast: false matrix: @@ -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" @@ -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: | diff --git a/.gitlab/build-profiler.sh b/.gitlab/build-profiler.sh index b1b8e6712de..7e5e4d71cf6 100755 --- a/.gitlab/build-profiler.sh +++ b/.gitlab/build-profiler.sh @@ -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 diff --git a/.gitlab/ci-images.yml b/.gitlab/ci-images.yml index 1852f6fa5d8..c2b725f7d44 100644 --- a/.gitlab/ci-images.yml +++ b/.gitlab/ci-images.yml @@ -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: @@ -46,6 +48,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: @@ -75,10 +79,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 @@ -92,38 +99,116 @@ Bookworm: - 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" - docker buildx bake --no-cache --pull --push $PHP_VERSION -Buster: +.windows_image_build: stage: ci-build rules: - when: manual allow_failure: true needs: [] - tags: ["arch:amd64"] - timeout: 4h - image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:29.4.0-noble + 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." + + # Download docker-compose to the workspace. + Write-Host "Downloading docker-compose..." + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + $dockerCompose = "$PWD\docker-compose.exe" + Start-BitsTransfer -Source "https://github.com/docker/compose/releases/download/v2.36.0/docker-compose-windows-x86_64.exe" -Destination $dockerCompose + + 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 } + + & $dockerCompose version + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + + foreach ($target in ($env:WINDOWS_IMAGE_TARGETS -split ' ')) { + if ([string]::IsNullOrWhiteSpace($target)) { continue } + + Write-Host "Building Windows CI image target $target..." + & $dockerCompose build --pull --no-cache $target + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + + Write-Host "Pushing Windows CI image target $target..." + & $dockerCompose push $target + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + } + +"Windows 1: Tool Images": + extends: .windows_image_build parallel: matrix: - - PHP_VERSION: - - base - - php-8.5 - - php-8.4 - - php-8.3 - - php-8.2 - - php-8.1 - - php-8.0 - - php-8.0-shared-ext - - php-7.4 - - 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_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" diff --git a/.gitlab/generate-appsec.php b/.gitlab/generate-appsec.php index 3f3aff72e33..06c65cc1166 100644 --- a/.gitlab/generate-appsec.php +++ b/.gitlab/generate-appsec.php @@ -53,7 +53,7 @@ before_script: - git config --global --add safe.directory "$(pwd)/appsec/third_party/libddwaf" - - sudo apt install -y clang-tidy-17 libc++-17-dev libc++abi-17-dev + - sudo apt install -y clang-tidy-20 libc++-20-dev libc++abi-20-dev - mkdir -p appsec/build boost-cache boost-cache cache: - key: "appsec boost cache" @@ -71,7 +71,7 @@ "test appsec extension": stage: test extends: .appsec_test - image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-6 + image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-8 variables: KUBERNETES_CPU_REQUEST: 3 KUBERNETES_CPU_LIMIT: 3 @@ -393,7 +393,7 @@ "appsec code coverage": stage: test extends: .appsec_test - image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.3_bookworm-6 + image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.3_bookworm-8 variables: KUBERNETES_CPU_REQUEST: 3 KUBERNETES_MEMORY_REQUEST: 3Gi @@ -408,7 +408,7 @@ sudo cp -v vault /usr/local/bin cd - sudo sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g; s|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list - sudo apt-get update && sudo apt-get install -y jq gcovr llvm-17 clang-17 + sudo apt-get update && sudo apt-get install -y jq gcovr llvm-20 clang-20 echo "Installing codecov" @@ -428,7 +428,7 @@ - | cmake .. -DCMAKE_BUILD_TYPE=Debug -DDD_APPSEC_ENABLE_COVERAGE=ON \ -DDD_APPSEC_TESTING=ON -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ - -DCMAKE_C_COMPILER=/usr/bin/clang-17 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-17 \ + -DCMAKE_C_COMPILER=/usr/bin/clang-20 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-20 \ -DCMAKE_CXX_LINK_FLAGS="-stdlib=libc++" \ -DBOOST_CACHE_PREFIX="$CI_PROJECT_DIR/boost-cache" - | @@ -442,8 +442,8 @@ ./appsec/build/tests/helper/ddappsec_helper_test - | cd /tmp/cov-ext - llvm-profdata-17 merge -sparse *.profraw -o default.profdata - llvm-cov-17 export "$CI_PROJECT_DIR"/appsec/build/ddappsec.so \ + llvm-profdata-20 merge -sparse *.profraw -o default.profdata + llvm-cov-20 export "$CI_PROJECT_DIR"/appsec/build/ddappsec.so \ -format=lcov -instr-profile=default.profdata \ > "$CI_PROJECT_DIR"/appsec/build/coverage-ext.lcov echo "Uploading extension coverage to codecov" @@ -451,8 +451,8 @@ codecov -t "$CODECOV_TOKEN" -n appsec-extension -v -f appsec/build/coverage-ext.lcov - | cd /tmp/cov-helper - llvm-profdata-17 merge -sparse *.profraw -o default.profdata - llvm-cov-17 export "$CI_PROJECT_DIR"/appsec/build/tests/helper/ddappsec_helper_test \ + llvm-profdata-20 merge -sparse *.profraw -o default.profdata + llvm-cov-20 export "$CI_PROJECT_DIR"/appsec/build/tests/helper/ddappsec_helper_test \ -format=lcov -instr-profile=default.profdata \ > "$CI_PROJECT_DIR/appsec/build/coverage-helper.lcov" echo "Uploading helper coverage to codecov" @@ -515,29 +515,29 @@ "appsec lint": stage: test extends: .appsec_test - image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.3_bookworm-6 + image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.3_bookworm-8 variables: KUBERNETES_CPU_REQUEST: 3 KUBERNETES_MEMORY_REQUEST: 9Gi KUBERNETES_MEMORY_LIMIT: 10Gi ARCH: amd64 script: - - sudo apt install -y clang-format-17 + - sudo apt install -y clang-format-20 - cd appsec/build - | cmake .. -DCMAKE_BUILD_TYPE=Debug -DDD_APPSEC_ENABLE_COVERAGE=OFF \ -DDD_APPSEC_TESTING=OFF -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_CXX_LINK_FLAGS="-stdlib=libc++" \ -DBOOST_CACHE_PREFIX="$CI_PROJECT_DIR/boost-cache" \ - -DCLANG_TIDY=/usr/bin/run-clang-tidy-17 \ - -DCLANG_FORMAT=/usr/bin/clang-format-17 + -DCLANG_TIDY=/usr/bin/run-clang-tidy-20 \ + -DCLANG_FORMAT=/usr/bin/clang-format-20 - make -j 4 extension ddappsec-helper - make format tidy "test appsec helper asan": stage: test extends: .appsec_test - image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-6 + image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-8 variables: KUBERNETES_CPU_REQUEST: 3 KUBERNETES_MEMORY_REQUEST: 3Gi @@ -555,7 +555,7 @@ -DASAN_BUILD" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address -fsanitize=leak" \ -DCMAKE_MODULE_LINKER_FLAGS="-fsanitize=address -fsanitize=leak" \ -DBOOST_CACHE_PREFIX="$CI_PROJECT_DIR/boost-cache" \ - -DCLANG_TIDY=/usr/bin/run-clang-tidy-17 + -DCLANG_TIDY=/usr/bin/run-clang-tidy-20 - make -j 4 ddappsec_helper_test - cd ../..; ./appsec/build/tests/helper/ddappsec_helper_test @@ -563,7 +563,7 @@ #"fuzz appsec helper": # stage: test # extends: .appsec_test -# image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-6 +# image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-8 # variables: # KUBERNETES_CPU_REQUEST: 3 # KUBERNETES_MEMORY_REQUEST: 5Gi @@ -581,7 +581,7 @@ # - cd - # # - cd appsec/build -# - cmake .. -DCMAKE_BUILD_TYPE=Debug -DDD_APPSEC_BUILD_EXTENSION=OFF -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_CXX_LINK_FLAGS="-stdlib=libc++" -DFUZZER_ARCHIVE_PATH=$fuzzer -DBOOST_CACHE_PREFIX=/boost-cache -DCLANG_TIDY=/usr/bin/run-clang-tidy-17 +# - cmake .. -DCMAKE_BUILD_TYPE=Debug -DDD_APPSEC_BUILD_EXTENSION=OFF -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_CXX_LINK_FLAGS="-stdlib=libc++" -DFUZZER_ARCHIVE_PATH=$fuzzer -DBOOST_CACHE_PREFIX=/boost-cache -DCLANG_TIDY=/usr/bin/run-clang-tidy-20 # - make -j 4 ddappsec_helper_fuzzer corpus_generator # - cd .. # - mkdir -p tests/fuzzer/{corpus,results,logs} @@ -602,9 +602,9 @@ # - LLVM_PROFILE_FILE=body.profraw ./build/tests/fuzzer/ddappsec_helper_fuzzer --log_level=off --fuzz-mode=body -max_total_time=60 -rss_limit_mb=4096 -artifact_prefix=tests/fuzzer/results/ tests/fuzzer/corpus/ # # - '# Generate coverage' -# - llvm-profdata-17 merge -sparse *.profraw -o default.profdata -# - llvm-cov-17 show build/tests/fuzzer/ddappsec_helper_fuzzer -instr-profile=default.profdata -ignore-filename-regex="(tests|third_party|build)" -format=html > fuzzer-coverage.html -# - llvm-cov-17 report -instr-profile default.profdata build/tests/fuzzer/ddappsec_helper_fuzzer -ignore-filename-regex="(tests|third_party|build)" -show-region-summary=false +# - llvm-profdata-20 merge -sparse *.profraw -o default.profdata +# - llvm-cov-20 show build/tests/fuzzer/ddappsec_helper_fuzzer -instr-profile=default.profdata -ignore-filename-regex="(tests|third_party|build)" -format=html > fuzzer-coverage.html +# - llvm-cov-20 report -instr-profile default.profdata build/tests/fuzzer/ddappsec_helper_fuzzer -ignore-filename-regex="(tests|third_party|build)" -show-region-summary=false # artifacts: # paths: # - appsec/fuzzer-coverage.html diff --git a/.gitlab/generate-common.php b/.gitlab/generate-common.php index 5a2db4773c0..76ee812f208 100644 --- a/.gitlab/generate-common.php +++ b/.gitlab/generate-common.php @@ -115,7 +115,7 @@ function windows_git_setup_with_packages() { $step = <<&1) + - (cd libdatadog; git fetch --depth=1 origin "$_libdatadog_sha" 2>/dev/null || git fetch --depth=1 origin "$_libdatadog_sha" 2>&1) - (cd libdatadog; git checkout FETCH_HEAD) STEP; diff --git a/.gitlab/generate-package.php b/.gitlab/generate-package.php index 8c68e9f2765..8fe2c722839 100644 --- a/.gitlab/generate-package.php +++ b/.gitlab/generate-package.php @@ -48,13 +48,13 @@ $asan_build_platforms = [ [ "triplet" => "x86_64-unknown-linux-gnu", - "image_template" => "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-%s_bookworm-7", + "image_template" => "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-%s_bookworm-8", "arch" => "amd64", "host_os" => "linux-gnu", ], [ "triplet" => "aarch64-unknown-linux-gnu", - "image_template" => "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-%s_bookworm-7", + "image_template" => "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-%s_bookworm-8", "arch" => "arm64", "host_os" => "linux-gnu", ] @@ -321,7 +321,7 @@ "pecl build": stage: tracing - image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-7.4_bookworm-7" + image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-7.4_bookworm-8" tags: [ "arch:amd64" ] needs: [ "prepare code" ] script: @@ -371,7 +371,7 @@ "aggregate tracing extension: []": stage: tracing - image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-7.4_bookworm-7" + image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-7.4_bookworm-8" tags: [ "arch:amd64" ] script: ls ./ variables: @@ -1154,7 +1154,7 @@ "pecl tests": stage: verify - image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_VERSION}_bookworm-7" + image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_VERSION}_bookworm-8" tags: [ "arch:amd64" ] services: - !reference [.services, request-replayer] @@ -1187,7 +1187,7 @@ "min install tests": stage: verify - image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.0-shared-ext + image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.0-shared-ext-8 tags: [ "arch:amd64" ] variables: MAX_TEST_PARALLELISM: 8 @@ -1370,7 +1370,7 @@ variables: VALGRIND: false ARCH: "" - CONTAINER_SUFFIX: bookworm-7 + CONTAINER_SUFFIX: bookworm-8 needs: - job: "package loader: []" artifacts: true diff --git a/.gitlab/generate-profiler.php b/.gitlab/generate-profiler.php index 728ba8621d0..2268cd44c44 100644 --- a/.gitlab/generate-profiler.php +++ b/.gitlab/generate-profiler.php @@ -43,7 +43,6 @@ IMAGE_SUFFIX: _centos-7 script: - if [ -d '/opt/rh/devtoolset-7' ]; then set +eo pipefail; source scl_source enable devtoolset-7; set -eo pipefail; fi - - if [ -f /sbin/apk ] && [ $(uname -m) = "aarch64" ]; then ln -sf ../lib/llvm19/bin/clang /usr/bin/clang; fi - if [ -d '/opt/rh/devtoolset-7' ] && [ "$(uname -m)" = "aarch64" ]; then export BINDGEN_EXTRA_CLANG_ARGS="-I$(clang --print-resource-dir)/include"; fi - cd profiling @@ -84,7 +83,7 @@ "clippy NTS": stage: test tags: [ "arch:amd64" ] - image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-7 + image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-8 variables: KUBERNETES_CPU_REQUEST: 5 KUBERNETES_MEMORY_REQUEST: 3Gi @@ -103,7 +102,7 @@ "Cargo test": stage: test tags: [ "arch:amd64" ] - image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.5_bookworm-7 + image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.5_bookworm-8 variables: KUBERNETES_CPU_REQUEST: 5 KUBERNETES_MEMORY_REQUEST: 3Gi diff --git a/.gitlab/generate-shared.php b/.gitlab/generate-shared.php index eb200835a9e..d3f5f0a4f0f 100644 --- a/.gitlab/generate-shared.php +++ b/.gitlab/generate-shared.php @@ -21,7 +21,7 @@ - IMAGE: - "datadog/dd-trace-ci:centos-7" - "datadog/dd-trace-ci:php-compile-extension-alpine" - - "datadog/dd-trace-ci:bookworm-7" + - "datadog/dd-trace-ci:bookworm-8" script: - if [ -f "/opt/libuv/lib/pkgconfig/libuv.pc" ]; then export PKG_CONFIG_PATH="/opt/libuv/lib/pkgconfig:$PKG_CONFIG_PATH"; fi - if [ -d "/opt/catch2" ]; then export CMAKE_PREFIX_PATH=/opt/catch2; fi @@ -45,7 +45,7 @@ "C components UBSAN": tags: [ "arch:amd64" ] stage: test - image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-7" + image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-8" needs: [] script: - if [ -f "/opt/libuv/lib/pkgconfig/libuv.pc" ]; then export PKG_CONFIG_PATH="/opt/libuv/lib/pkgconfig:$PKG_CONFIG_PATH"; fi @@ -69,7 +69,7 @@ "Build & Test Tea": tags: [ "arch:amd64" ] stage: build - image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-7" + image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-8" parallel: matrix: - PHP_MAJOR_MINOR: *no_asan_minor_major_targets @@ -98,7 +98,7 @@ .tea_test: tags: [ "arch:amd64" ] stage: test - image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-7" + image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-8" interruptible: true rules: - if: $CI_COMMIT_BRANCH == "master" @@ -122,7 +122,7 @@ needs: [] variables: PHP_MAJOR_MINOR: "" - image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-7" + image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-8" script: - | if ! command -v cc >/dev/null 2>&1 && ! command -v clang >/dev/null 2>&1 && ! command -v gcc >/dev/null 2>&1; then @@ -185,7 +185,7 @@ ?> "ZAI Shared Tests: []": extends: .tea_test - image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php--shared-ext" + image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php--shared-ext-8" needs: - job: "Build & Test Tea" parallel: diff --git a/.gitlab/generate-tracer.php b/.gitlab/generate-tracer.php index eed16d70e36..3c9a3ac6d42 100644 --- a/.gitlab/generate-tracer.php +++ b/.gitlab/generate-tracer.php @@ -67,7 +67,7 @@ function before_script_steps($with_docker_auth = false) { "compile extension: debug": stage: compile tags: [ "arch:${ARCH}" ] - image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-7 + image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-8 parallel: matrix: - PHP_MAJOR_MINOR: *all_minor_major_targets @@ -186,7 +186,7 @@ function before_script_steps($with_docker_auth = false) { .base_test: stage: test tags: [ "arch:${ARCH}" ] - image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-7 + image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-8 timeout: 60m interruptible: true rules: diff --git a/Cargo.lock b/Cargo.lock index 7a0fe64ab9e..aea48f91363 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2870,7 +2870,7 @@ dependencies = [ [[package]] name = "libdd-data-pipeline" -version = "4.0.0" +version = "5.0.0" dependencies = [ "anyhow", "arc-swap", @@ -2934,7 +2934,7 @@ dependencies = [ [[package]] name = "libdd-library-config" -version = "1.1.0" +version = "2.0.0" dependencies = [ "anyhow", "libc 0.2.177", @@ -3127,7 +3127,7 @@ dependencies = [ [[package]] name = "libdd-trace-obfuscation" -version = "3.0.0" +version = "3.1.0" dependencies = [ "anyhow", "criterion", @@ -3158,7 +3158,7 @@ dependencies = [ [[package]] name = "libdd-trace-stats" -version = "3.0.0" +version = "4.0.0" dependencies = [ "anyhow", "arc-swap", @@ -3185,7 +3185,7 @@ dependencies = [ [[package]] name = "libdd-trace-utils" -version = "4.0.0" +version = "5.0.0" dependencies = [ "anyhow", "base64 0.22.1", diff --git a/Cargo.toml b/Cargo.toml index 5fda3a7ac57..bf4ff93f4bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["components-rs", "components-rs/php_sidecar_mockgen", "profiling"] resolver = "2" [workspace.package] -rust-version = "1.84.1" +rust-version = "1.87.0" edition = "2021" # Irrelevant version and license. These do NOT apply here, they just are here to make cargo build pass. version = "0.0.1" @@ -46,4 +46,4 @@ hyper-util = { version = "0.1.10", features = [ ] } [workspace.lints] -# empty for compat with libdatadog \ No newline at end of file +# empty for compat with libdatadog diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 549ba4d486f..3b73cfbacaf 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -1,5 +1,4 @@ Component,Origin,License,Copyright -file,Dockerfile_buster,MIT,"Docker, Inc." file,docker-php-ext-configure,MIT,"Docker, Inc." file,docker-php-ext-enable,MIT,"Docker, Inc." file,docker-php-ext-install,MIT,"Docker, Inc." diff --git a/README.md b/README.md index 8864bb16a7a..c69807c1548 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Visit the [PHP tracer documentation](https://docs.datadoghq.com/tracing/language #### Installation from PECL (datadog_trace) or from source -Compilation of the tracer and the profiler requires cargo to be installed. Ensure that cargo is minimum version 1.84.1, otherwise follow the [official instructions for installing cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html). +Compilation of the tracer and the profiler requires cargo to be installed. Ensure that cargo is minimum version 1.87.0, otherwise follow the [official instructions for installing cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html). ### Advanced configuration diff --git a/appsec/src/extension/attributes.h b/appsec/src/extension/attributes.h index b25505ebf58..cb6b086e1d7 100644 --- a/appsec/src/extension/attributes.h +++ b/appsec/src/extension/attributes.h @@ -1,32 +1,36 @@ // Unless explicitly stated otherwise all files in this repository are // dual-licensed under the Apache-2.0 License or BSD-3-Clause License. // -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2021 Datadog, Inc. +// This product includes software developed at Datadog +// (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #ifndef DD_ATTRIBUTES_H #define DD_ATTRIBUTES_H +// PHP 8.4+ uses __has_attribute(nonnull) in zend_portability.h. This header +// defines nonnull below, so Zend must see that check before our shorthand exists. +#include + #ifndef __has_feature -# define __has_feature(x) 0 +# define __has_feature(x) 0 #endif #if !__has_feature(nullability) -# ifndef _Nullable -# define _Nullable -# endif -# ifndef _Nonnull -# define _Nonnull -# endif -# ifndef _Null_unspecified -# define _Null_unspecified -# endif +# ifndef _Nullable +# define _Nullable +# endif +# ifndef _Nonnull +# define _Nonnull +# endif +# ifndef _Null_unspecified +# define _Null_unspecified +# endif #endif #if defined(__has_attribute) && __has_attribute(format) -#define ATTR_FORMAT(fmt_idx, first_arg_idx) \ - __attribute__((format(printf, fmt_idx, first_arg_idx))) +# define ATTR_FORMAT(fmt_idx, first_arg_idx) \ + __attribute__((format(printf, fmt_idx, first_arg_idx))) #elif -#define ATTR_FORMAT(fmt_idx, first_arg_idx) +# define ATTR_FORMAT(fmt_idx, first_arg_idx) #endif // see also zend_always_inline @@ -69,9 +73,9 @@ #endif #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define may_alias __attribute((__may_alias__)) +# define may_alias __attribute((__may_alias__)) #else -# define may_alias +# define may_alias #endif #define nonnull _Nonnull @@ -79,13 +83,13 @@ #define unspecnull _Null_unspecified #ifdef __cplusplus -#define EXTERN_C extern "C" -#define EXTERN_C_BEGIN extern "C" { -#define EXTERN_C_END } +# define EXTERN_C extern "C" +# define EXTERN_C_BEGIN extern "C" { +# define EXTERN_C_END } #else -#define EXTERN_C -#define EXTERN_C_BEGIN -#define EXTERN_C_END +# define EXTERN_C +# define EXTERN_C_BEGIN +# define EXTERN_C_END #endif #define PACKED __attribute__((__packed__)) diff --git a/appsec/src/extension/commands/client_init.h b/appsec/src/extension/commands/client_init.h index ad4170cf108..9c59963f01f 100644 --- a/appsec/src/extension/commands/client_init.h +++ b/appsec/src/extension/commands/client_init.h @@ -1,11 +1,11 @@ // Unless explicitly stated otherwise all files in this repository are // dual-licensed under the Apache-2.0 License or BSD-3-Clause License. // -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2021 Datadog, Inc. +// This product includes software developed at Datadog +// (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once -#include "../network.h" #include "../commands_ctx.h" +#include "../network.h" dd_result dd_client_init(dd_conn *nonnull conn, struct req_info *nonnull ctx); diff --git a/appsec/src/extension/commands/config_sync.h b/appsec/src/extension/commands/config_sync.h index d921538254c..5676edf9d80 100644 --- a/appsec/src/extension/commands/config_sync.h +++ b/appsec/src/extension/commands/config_sync.h @@ -5,8 +5,8 @@ // (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once -#include "../network.h" #include "../ddtrace.h" +#include "../network.h" struct config_sync_data { char *nullable rem_cfg_path; diff --git a/appsec/src/extension/commands/request_exec.c b/appsec/src/extension/commands/request_exec.c index 51d72d87cf6..aa781d23158 100644 --- a/appsec/src/extension/commands/request_exec.c +++ b/appsec/src/extension/commands/request_exec.c @@ -62,7 +62,7 @@ static dd_result _pack_command(mpack_writer_t *nonnull w, void *nonnull _ctx) bool has_rule_variant = ctx->rule_variant != NULL && ZSTR_LEN(ctx->rule_variant) > 0; size_t num_map_elems = (ctx->rasp_rule != NULL) + has_rule_variant + - (ctx->subctx_id != NULL) * 2; + ((ctx->subctx_id != NULL) * 2); mpack_start_map(w, num_map_elems); if (dd_mpack_limits_reached(&limits)) { diff --git a/appsec/src/extension/commands/request_init.h b/appsec/src/extension/commands/request_init.h index 17600709068..7c16b9416fa 100644 --- a/appsec/src/extension/commands/request_init.h +++ b/appsec/src/extension/commands/request_init.h @@ -1,12 +1,12 @@ // Unless explicitly stated otherwise all files in this repository are // dual-licensed under the Apache-2.0 License or BSD-3-Clause License. // -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2021 Datadog, Inc. +// This product includes software developed at Datadog +// (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once -#include "../network.h" #include "../commands_ctx.h" +#include "../network.h" struct req_info_init { struct req_info req_info; diff --git a/appsec/src/extension/commands/request_shutdown.c b/appsec/src/extension/commands/request_shutdown.c index 722e50dd764..dc845e665c6 100644 --- a/appsec/src/extension/commands/request_shutdown.c +++ b/appsec/src/extension/commands/request_shutdown.c @@ -130,7 +130,7 @@ static void _pack_headers_no_cookies_llist( zend_llist_position pos; for (sapi_header_struct *header = zend_llist_get_first_ex(hl, &pos); header; - header = zend_llist_get_next_ex(hl, &pos)) { + header = zend_llist_get_next_ex(hl, &pos)) { const char *pcol = memchr(header->header, ':', header->header_len); if (!pcol) { continue; @@ -172,7 +172,7 @@ static void _pack_headers_no_cookies_llist( mpack_start_array(w, zend_llist_count(coll)); zend_llist_position p; for (struct _header_val *hv = zend_llist_get_first_ex(coll, &p); hv; - hv = zend_llist_get_next_ex(coll, &p)) { + hv = zend_llist_get_next_ex(coll, &p)) { dd_mpack_write_nullable_str_lim( w, hv->val, hv->len, DD_MPACK_DEF_STRING_LIMIT); } @@ -189,7 +189,7 @@ static const char *nullable _header_content_type_llist( { zend_llist_position pos; for (sapi_header_struct *header = zend_llist_get_first_ex(hl, &pos); header; - header = zend_llist_get_next_ex(hl, &pos)) { + header = zend_llist_get_next_ex(hl, &pos)) { if (header->header_len >= LSTRLEN("content-type") && strncasecmp(header->header, LSTRARG("content-type")) == 0) { const char *pcol = memchr(header->header, ':', header->header_len); diff --git a/appsec/src/extension/commands/request_shutdown.h b/appsec/src/extension/commands/request_shutdown.h index e421b0a54ec..c67a22a1869 100644 --- a/appsec/src/extension/commands/request_shutdown.h +++ b/appsec/src/extension/commands/request_shutdown.h @@ -1,13 +1,13 @@ // Unless explicitly stated otherwise all files in this repository are // dual-licensed under the Apache-2.0 License or BSD-3-Clause License. // -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2021 Datadog, Inc. +// This product includes software developed at Datadog +// (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once -#include "../network.h" #include "../attributes.h" #include "../commands_ctx.h" +#include "../network.h" #include struct req_shutdown_info { diff --git a/appsec/src/extension/commands_ctx.h b/appsec/src/extension/commands_ctx.h index 2aa1754797b..7f7e40df8e9 100644 --- a/appsec/src/extension/commands_ctx.h +++ b/appsec/src/extension/commands_ctx.h @@ -1,8 +1,8 @@ #pragma once -#include #include "attributes.h" #include "request_abort.h" +#include struct req_info { const char *nullable command_name; // for logging diff --git a/appsec/src/extension/commands_helpers.c b/appsec/src/extension/commands_helpers.c index f589b94d0b5..00a3f69cf77 100644 --- a/appsec/src/extension/commands_helpers.c +++ b/appsec/src/extension/commands_helpers.c @@ -293,7 +293,7 @@ static inline ATTR_WARN_UNUSED mpack_error_t _imsg_destroy( static void _imsg_cleanup(dd_imsg *nullable *imsg) { - dd_imsg **imsg_c = (dd_imsg * nullable * nonnull) imsg; + dd_imsg **imsg_c = imsg; if (*imsg_c) { UNUSED(_imsg_destroy(*imsg_c)); } @@ -504,12 +504,14 @@ static void dd_command_process_settings(mpack_node_t root); * 4: [metrics: map] * ) */ -#define RESP_INDEX_ACTION_PARAMS 0 -#define RESP_INDEX_APPSEC_SPAN_DATA 1 -#define RESP_INDEX_FORCE_KEEP 2 -#define RESP_INDEX_SETTINGS 3 -#define RESP_INDEX_SPAN_META 4 -#define RESP_INDEX_SPAN_METRICS 5 +enum { + RESP_INDEX_ACTION_PARAMS = 0, + RESP_INDEX_APPSEC_SPAN_DATA = 1, + RESP_INDEX_FORCE_KEEP = 2, + RESP_INDEX_SETTINGS = 3, + RESP_INDEX_SPAN_META = 4, + RESP_INDEX_SPAN_METRICS = 5, +}; dd_result dd_command_proc_resp_verd_span_data( mpack_node_t root, void *unspecnull _ctx) @@ -811,7 +813,7 @@ static void _dump_out_msg(dd_log_level_t lvl, zend_llist *iovecs) zend_llist_position pos; int i = 1; for (struct iovec *iov = zend_llist_get_first_ex(iovecs, &pos); iov; - iov = zend_llist_get_next_ex(iovecs, &pos), i++) { + iov = zend_llist_get_next_ex(iovecs, &pos), i++) { zend_string *zstr = php_base64_encode(iov->iov_base, iov->iov_len); if (ZSTR_LEN(zstr) > INT_MAX) { return; diff --git a/appsec/src/extension/commands_helpers.h b/appsec/src/extension/commands_helpers.h index 459fa0ac1d8..45321bb0aa3 100644 --- a/appsec/src/extension/commands_helpers.h +++ b/appsec/src/extension/commands_helpers.h @@ -5,8 +5,8 @@ // (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once -#include "commands_ctx.h" #include "attributes.h" +#include "commands_ctx.h" #include "dddefs.h" #include "network.h" #include diff --git a/appsec/src/extension/compatibility.h b/appsec/src/extension/compatibility.h index b9e9ad79547..cb7e0386c2d 100644 --- a/appsec/src/extension/compatibility.h +++ b/appsec/src/extension/compatibility.h @@ -4,8 +4,13 @@ #include #if PHP_VERSION_ID < 80400 -#undef ZEND_RAW_FENTRY -#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags, ...) { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags }, +# undef ZEND_RAW_FENTRY +# define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags, ...) \ + {zend_name, name, arg_info, \ + (uint32_t)((sizeof(arg_info) / \ + sizeof(struct _zend_internal_arg_info)) - \ + 1), \ + flags}, #endif -#endif // DD_COMPATIBILITY_H +#endif // DD_COMPATIBILITY_H diff --git a/appsec/src/extension/configuration.c b/appsec/src/extension/configuration.c index 4763df33589..74562d7aed5 100644 --- a/appsec/src/extension/configuration.c +++ b/appsec/src/extension/configuration.c @@ -175,7 +175,7 @@ static void _register_testing_objects(void); bool dd_config_minit(int module_number) { if (!zai_config_minit(config_entries, - (sizeof config_entries / sizeof *config_entries), + (sizeof(config_entries) / sizeof(*config_entries)), dd_ini_env_to_ini_name, module_number)) { mlog(dd_log_fatal, "Unable to load configuration."); return false; @@ -210,7 +210,7 @@ static PHP_FUNCTION(datadog_appsec_testing_zai_config_get_value) RETURN_FALSE; } - unsigned entries = sizeof config_entries / sizeof *config_entries; + unsigned entries = sizeof(config_entries) / sizeof(*config_entries); for (unsigned i = 0; i < entries; i++) { if (strcmp(ZSTR_VAL(key), config_entries[i].name.ptr) == 0) { RETURN_ZVAL(zai_config_get_value(config_entries[i].id), @@ -228,7 +228,7 @@ static PHP_FUNCTION(datadog_appsec_testing_zai_config_get_global_value) RETURN_FALSE; } - unsigned entries = sizeof config_entries / sizeof *config_entries; + unsigned entries = sizeof(config_entries) / sizeof(*config_entries); for (unsigned i = 0; i < entries; i++) { if (strcmp(ZSTR_VAL(key), config_entries[i].name.ptr) == 0) { zval *value = &zai_config_memoized_entries[config_entries[i].id] diff --git a/appsec/src/extension/ddappsec.c b/appsec/src/extension/ddappsec.c index e839b60dd95..d8106a82e02 100644 --- a/appsec/src/extension/ddappsec.c +++ b/appsec/src/extension/ddappsec.c @@ -131,7 +131,7 @@ static void ddappsec_sort_modules(void *base, size_t count, size_t siz, // Reorder ddappsec to ensure it's always after ddtrace for (Bucket *module = base, *end = module + count, *ddappsec_module = NULL; - module < end; ++module) { + module < end; ++module) { zend_module_entry *m = (zend_module_entry *)Z_PTR(module->val); if (m->name == ddappsec_module_entry.name) { ddappsec_module = module; diff --git a/appsec/src/extension/ddappsec_arginfo.h b/appsec/src/extension/ddappsec_arginfo.h index c642dc2ed3d..ac489c4a3e3 100644 --- a/appsec/src/extension/ddappsec_arginfo.h +++ b/appsec/src/extension/ddappsec_arginfo.h @@ -1,20 +1,23 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: 12b545740a93f0ea5f4ecfdfc3a95fb144161bd2 */ -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_is_enabled, 0, 0, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_is_enabled, 0, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_push_addresses, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, addresses, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rasp_rule, IS_STRING, 0, "\'\'") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rule_variant, IS_STRING, 0, "\'\'") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_push_addresses, 0, 1, _IS_BOOL, 0) +ZEND_ARG_TYPE_INFO(0, addresses, IS_ARRAY, 0) +ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rasp_rule, IS_STRING, 0, "\'\'") +ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, rule_variant, IS_STRING, 0, "\'\'") ZEND_END_ARG_INFO() ZEND_FUNCTION(datadog_appsec_is_enabled); ZEND_FUNCTION(datadog_appsec_push_addresses); -static const zend_function_entry ext_functions[] = { - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", "is_enabled"), zif_datadog_appsec_is_enabled, arginfo_datadog_appsec_is_enabled, 0, NULL, NULL) - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", "push_addresses"), zif_datadog_appsec_push_addresses, arginfo_datadog_appsec_push_addresses, 0, NULL, NULL) - ZEND_FE_END -}; +static const zend_function_entry ext_functions[] = {ZEND_RAW_FENTRY( + ZEND_NS_NAME("datadog\\appsec", "is_enabled"), + zif_datadog_appsec_is_enabled, arginfo_datadog_appsec_is_enabled, 0, NULL, + NULL) ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", "push_addresses"), + zif_datadog_appsec_push_addresses, arginfo_datadog_appsec_push_addresses, 0, + NULL, NULL) ZEND_FE_END}; diff --git a/appsec/src/extension/dddefs.h b/appsec/src/extension/dddefs.h index da9c57c9ccb..0df47469161 100644 --- a/appsec/src/extension/dddefs.h +++ b/appsec/src/extension/dddefs.h @@ -15,9 +15,9 @@ typedef enum { dd_should_block, // caller should abort the request dd_should_redirect, // caller should redirect the request dd_should_record, - dd_error, // misc error - dd_try_later, // non-fatal error, try again - dd_helper_error // helper failed to process message (non-fatal) + dd_error, // misc error + dd_try_later, // non-fatal error, try again + dd_helper_error // helper failed to process message (non-fatal) } dd_result; const char *nonnull dd_result_to_string(dd_result result); diff --git a/appsec/src/extension/ddtrace.h b/appsec/src/extension/ddtrace.h index 4b845bf0432..2d1bd7154cb 100644 --- a/appsec/src/extension/ddtrace.h +++ b/appsec/src/extension/ddtrace.h @@ -5,9 +5,9 @@ // (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once +#include "attributes.h" #include #include -#include "attributes.h" static const int PRIORITY_SAMPLING_AUTO_KEEP = 1; static const int PRIORITY_SAMPLING_AUTO_REJECT = 0; @@ -123,5 +123,5 @@ typedef enum { extern void (*nullable ddtrace_metric_register_buffer)( zend_string *nonnull name, ddtrace_metric_type type, ddtrace_metric_ns ns); -extern bool (*nullable ddtrace_metric_add_point)(zend_string *nonnull name, - double value, zend_string *nonnull tags); +extern bool (*nullable ddtrace_metric_add_point)( + zend_string *nonnull name, double value, zend_string *nonnull tags); diff --git a/appsec/src/extension/duration_acc.h b/appsec/src/extension/duration_acc.h index 7301ca39cfe..a3621cbee3f 100644 --- a/appsec/src/extension/duration_acc.h +++ b/appsec/src/extension/duration_acc.h @@ -1,9 +1,7 @@ #pragma once -// php_compat.h must precede attributes.h: attributes.h defines `nonnull` as _Nonnull -// (empty on GCC), which breaks PHP 8.4+'s __has_attribute(nonnull) in zend_portability.h. -#include "php_compat.h" // NOLINT(llvm-include-order) #include "attributes.h" +#include "php_compat.h" #include static inline struct timespec dd_monotime_start(void) @@ -16,7 +14,8 @@ static inline struct timespec dd_monotime_start(void) void dd_duration_startup(void); void dd_duration_shutdown(void); void dd_duration_reset_globals(void); // call on rinit/user req begin -void dd_duration_flush_metrics(zend_object *nonnull span); // call on rshutdown/user req shutdown +void dd_duration_flush_metrics( + zend_object *nonnull span); // call on rshutdown/user req shutdown // RASP round-trip time void dd_duration_rasp_ext_account(const struct timespec *nonnull start); diff --git a/appsec/src/extension/entity_body.c b/appsec/src/extension/entity_body.c index 4c27daf809f..19cd2430798 100644 --- a/appsec/src/extension/entity_body.c +++ b/appsec/src/extension/entity_body.c @@ -192,7 +192,7 @@ static bool _assume_utf8(const char *ct, size_t ct_len) return true; } for (const char *end = ct + ct_len, *c = psemi + 1; - c < end - LSTRLEN("charset=utf-8") + 1; c++) { + c < end - LSTRLEN("charset=utf-8") + 1; c++) { if (tolower(*c) == 'c' && tolower(*(c + 1)) == 'h' && tolower(*(c + 2)) == 'a' && tolower(*(c + 3)) == 'r' && tolower(*(c + 4)) == 's' && tolower(*(c + 5)) == 'e' && // NOLINT @@ -214,7 +214,7 @@ static bool _assume_utf8(const char *ct, size_t ct_len) return true; } -#define MAX_XML_DEPTH 30 +enum { MAX_XML_DEPTH = 30 }; static zval _convert_xml(const char *nonnull entity, size_t entity_len, const char *nonnull content_type, size_t content_type_len) { @@ -244,7 +244,7 @@ PHP_FUNCTION(datadog_appsec_convert_xml) PHP_FUNCTION(datadog_appsec_convert_json) { zend_string *entity; -#define MAX_DEPTH_DEFAULT 30 + enum { MAX_DEPTH_DEFAULT = 30 }; zend_long max_depth = MAX_DEPTH_DEFAULT; ZEND_PARSE_PARAMETERS_START(1, 2) // NOLINT Z_PARAM_STR(entity) diff --git a/appsec/src/extension/entity_body.h b/appsec/src/extension/entity_body.h index a6eb0454a58..556cd023c7e 100644 --- a/appsec/src/extension/entity_body.h +++ b/appsec/src/extension/entity_body.h @@ -1,12 +1,12 @@ // Unless explicitly stated otherwise all files in this repository are // dual-licensed under the Apache-2.0 License or BSD-3-Clause License. // -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2021 Datadog, Inc. +// This product includes software developed at Datadog +// (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once -#include #include "attributes.h" +#include #include void dd_entity_body_startup(void); diff --git a/appsec/src/extension/entity_body_arginfo.h b/appsec/src/extension/entity_body_arginfo.h index 9288eaae281..c7a80db468e 100644 --- a/appsec/src/extension/entity_body_arginfo.h +++ b/appsec/src/extension/entity_body_arginfo.h @@ -1,23 +1,23 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: dfa1f0081bab0c798625353df5966ae21e7c4b89 */ -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_convert_xml, 0, 2, IS_ARRAY, 1) - ZEND_ARG_TYPE_INFO(0, xml, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, contentType, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_convert_xml, 0, 2, IS_ARRAY, 1) +ZEND_ARG_TYPE_INFO(0, xml, IS_STRING, 0) +ZEND_ARG_TYPE_INFO(0, contentType, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_convert_json, 0, 1, IS_MIXED, 1) - ZEND_ARG_TYPE_INFO(0, json, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxDepth, IS_LONG, 0, "30") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_convert_json, 0, 1, IS_MIXED, 1) +ZEND_ARG_TYPE_INFO(0, json, IS_STRING, 0) +ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, maxDepth, IS_LONG, 0, "30") ZEND_END_ARG_INFO() - ZEND_FUNCTION(datadog_appsec_convert_xml); ZEND_FUNCTION(datadog_appsec_convert_json); - static const zend_function_entry ext_functions[] = { - ZEND_NS_FALIAS("datadog\\appsec", convert_xml, datadog_appsec_convert_xml, arginfo_datadog_appsec_convert_xml) - ZEND_NS_FALIAS("datadog\\appsec", convert_json, datadog_appsec_convert_json, arginfo_datadog_appsec_convert_json) - ZEND_FE_END -}; + ZEND_NS_FALIAS("datadog\\appsec", convert_xml, datadog_appsec_convert_xml, + arginfo_datadog_appsec_convert_xml) ZEND_NS_FALIAS("datadog\\appsec", + convert_json, datadog_appsec_convert_json, + arginfo_datadog_appsec_convert_json) ZEND_FE_END}; diff --git a/appsec/src/extension/json_truncated_parser.h b/appsec/src/extension/json_truncated_parser.h index 379c8cb98a7..31df9472fb8 100644 --- a/appsec/src/extension/json_truncated_parser.h +++ b/appsec/src/extension/json_truncated_parser.h @@ -21,7 +21,8 @@ extern "C" { * @param max_depth Maximum recursion depth for nested structures * @return zval containing parsed data, or NULL zval on failure */ -zval dd_parse_json_truncated(const char* json_data, size_t json_len, int max_depth); +zval dd_parse_json_truncated( + const char *json_data, size_t json_len, int max_depth); #ifdef __cplusplus } diff --git a/appsec/src/extension/logging.c b/appsec/src/extension/logging.c index 7094cfc3923..9f0327066b3 100644 --- a/appsec/src/extension/logging.c +++ b/appsec/src/extension/logging.c @@ -217,7 +217,7 @@ static int _dd_log_level_from_str(const char *nullable log_level) goto err; } - size_t len = strlen((const char *)log_level); + size_t len = strlen(log_level); if (dd_string_equals_lc(log_level, len, ZEND_STRL("off"))) { return dd_log_off; } @@ -415,7 +415,10 @@ static void _format_time( char *buf, size_t buf_size, struct timespec *time, int precision) { struct tm tm = {0}; - gmtime_r(&time->tv_sec, &tm); + if (gmtime_r(&time->tv_sec, &tm) == NULL) { + *buf = '\0'; + return; + } size_t len = strftime(buf, buf_size, "%FT%T", &tm); size_t left_size = buf_size - len; if (UNEXPECTED(left_size > buf_size)) { diff --git a/appsec/src/extension/logging.h b/appsec/src/extension/logging.h index 738722c8589..456619d3a73 100644 --- a/appsec/src/extension/logging.h +++ b/appsec/src/extension/logging.h @@ -5,10 +5,10 @@ // (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once +#include "attributes.h" #include "configuration.h" #include "php_helpers.h" #include -#include "attributes.h" /* log levels - the first argument to the mlog helper * The lower the number, the higher the priority */ @@ -35,8 +35,9 @@ static inline dd_log_level_t dd_log_level(void) if (!_dd_log_config_ready) { return dd_log_warning; } - return (dd_log_level_t)(runtime_config_first_init ? get_DD_APPSEC_LOG_LEVEL() - : get_global_DD_APPSEC_LOG_LEVEL()); + return (dd_log_level_t)(runtime_config_first_init + ? get_DD_APPSEC_LOG_LEVEL() + : get_global_DD_APPSEC_LOG_LEVEL()); } void dd_log_startup_before_cfg(void); diff --git a/appsec/src/extension/msgpack_helpers.c b/appsec/src/extension/msgpack_helpers.c index c1a541af4f6..dbc287e6b7a 100644 --- a/appsec/src/extension/msgpack_helpers.c +++ b/appsec/src/extension/msgpack_helpers.c @@ -19,7 +19,7 @@ #endif static const size_t MAX_DEPTH_READING = 32; -#define MAX_RECURSION_DEPTH 50 // arbitrary limit to prevent stack overflow +enum { MAX_RECURSION_DEPTH = 50 }; // arbitrary limit to prevent stack overflow static THREAD_LOCAL_ON_ZTS bool data_truncated_ = false; diff --git a/appsec/src/extension/msgpack_helpers.h b/appsec/src/extension/msgpack_helpers.h index 9cb227b1756..f14fd6d1a53 100644 --- a/appsec/src/extension/msgpack_helpers.h +++ b/appsec/src/extension/msgpack_helpers.h @@ -6,8 +6,8 @@ #ifndef DD_MSGPACK_HELPERS_H #define DD_MSGPACK_HELPERS_H -#include "string_helpers.h" #include "attributes.h" +#include "string_helpers.h" #include #include @@ -36,7 +36,7 @@ static inline bool dd_mpack_limits_reached(dd_mpack_limits *nonnull limits) memcmp(mpack_node_str(node), "" lstr, LSTRLEN(lstr)) == 0) #define dd_mpack_node_str_eq(node, str, len) \ - (mpack_node_strlen(node) == (len) && \ + (mpack_node_strlen(node) == (len) && \ memcmp(mpack_node_str(node), str, len) == 0) #define dd_mpack_write_lstr(w, str) mpack_write_str(w, str, LSTRLEN(str)) @@ -45,8 +45,8 @@ static inline bool dd_mpack_limits_reached(dd_mpack_limits *nonnull limits) void dd_mpack_write_nullable_cstr( mpack_writer_t *nonnull w, const char *nullable cstr); -void dd_mpack_write_nullable_cstr_lim(mpack_writer_t *nonnull w, - const char *nullable cstr, size_t max_len); +void dd_mpack_write_nullable_cstr_lim( + mpack_writer_t *nonnull w, const char *nullable cstr, size_t max_len); void dd_mpack_write_nullable_str( mpack_writer_t *nonnull w, const char *nullable str, size_t len); void dd_mpack_write_nullable_str_lim(mpack_writer_t *nonnull w, @@ -54,8 +54,8 @@ void dd_mpack_write_nullable_str_lim(mpack_writer_t *nonnull w, void dd_mpack_write_zstr( mpack_writer_t *nonnull w, const zend_string *nonnull zstr); -void dd_mpack_write_zstr_lim(mpack_writer_t *nonnull w, - const zend_string *nonnull zstr, size_t max_len); +void dd_mpack_write_zstr_lim( + mpack_writer_t *nonnull w, const zend_string *nonnull zstr, size_t max_len); void dd_mpack_write_nullable_zstr( mpack_writer_t *nonnull w, const zend_string *nullable zstr); void dd_mpack_write_nullable_zstr_lim(mpack_writer_t *nonnull w, diff --git a/appsec/src/extension/network.c b/appsec/src/extension/network.c index 641853c6c1f..76b157b8624 100644 --- a/appsec/src/extension/network.c +++ b/appsec/src/extension/network.c @@ -187,7 +187,7 @@ static size_t _iovecs_total_size(zend_llist *nonnull iovecs) zend_llist_position pos; size_t total = 0; for (struct iovec *iov = zend_llist_get_first_ex(iovecs, &pos); iov; - iov = zend_llist_get_next_ex(iovecs, &pos)) { + iov = zend_llist_get_next_ex(iovecs, &pos)) { total += iov->iov_len; } return total; @@ -212,7 +212,7 @@ dd_result dd_conn_sendv(dd_conn *nonnull conn, zend_llist *nonnull iovecs) zend_llist_position pos; size_t i = 1; for (struct iovec *iov = zend_llist_get_first_ex(iovecs, &pos); iov; - iov = zend_llist_get_next_ex(iovecs, &pos), i++) { + iov = zend_llist_get_next_ex(iovecs, &pos), i++) { iovs[i] = *iov; } @@ -456,9 +456,11 @@ dd_result dd_conn_set_timeout( return dd_success; } -#define ONE_E3 1000 -#define ONE_E6 1000000 -#define ONE_E9 1000000000 +enum { + ONE_E3 = 1000, + ONE_E6 = 1000000, + ONE_E9 = 1000000000, +}; static void _timespec_add_ms(struct timespec *ts, long num_ms) { long seconds = num_ms / ONE_E3; diff --git a/appsec/src/extension/php_compat.h b/appsec/src/extension/php_compat.h index 4bbea5d4aab..7da9d496ab2 100644 --- a/appsec/src/extension/php_compat.h +++ b/appsec/src/extension/php_compat.h @@ -1,8 +1,8 @@ // Unless explicitly stated otherwise all files in this repository are // dual-licensed under the Apache-2.0 License or BSD-3-Clause License. // -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2021 Datadog, Inc. +// This product includes software developed at Datadog +// (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once #include @@ -16,9 +16,9 @@ # define HT_IS_PACKED(ht) 0 # define HT_IS_WITHOUT_HOLES(ht) 0 -#define MAY_BE_NULL 0 -#define MAY_BE_STRING 0 -#define MAY_BE_ARRAY 0 +# define MAY_BE_NULL 0 +# define MAY_BE_STRING 0 +# define MAY_BE_ARRAY 0 # include void zend_print_zval_r_to_buf_compat(smart_str *buf, zval *expr, int indent); @@ -35,19 +35,24 @@ static inline zend_string *zend_print_zval_r_to_str(zval *expr, int indent) # undef ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX # undef ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO -# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ - static const zend_internal_arg_info name[] = { \ - { (const char*)(zend_uintptr_t)(required_num_args), NULL, type, return_reference, allow_null, 0 }, +# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( \ + name, return_reference, required_num_args, type, allow_null) \ + static const zend_internal_arg_info name[] = { \ + {(const char *)(zend_uintptr_t)(required_num_args), NULL, type, \ + return_reference, allow_null, 0}, -# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(name, type, allow_null) \ - ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, 0, -1, type, allow_null) +# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO(name, type, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, 0, -1, type, allow_null) -# define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ - static const zend_internal_arg_info name[] = { \ - { (const char*)(zend_uintptr_t)(required_num_args), #class_name, IS_OBJECT, return_reference, allow_null, 0 }, +# define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX( \ + name, return_reference, required_num_args, class_name, allow_null) \ + static const zend_internal_arg_info name[] = { \ + {(const char *)(zend_uintptr_t)(required_num_args), #class_name, \ + IS_OBJECT, return_reference, allow_null, 0}, -# define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO(name, class_name, allow_null) \ - ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, 0, -1, class_name, allow_null) +# define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO(name, class_name, allow_null) \ + ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX( \ + name, 0, -1, class_name, allow_null) // persistent must be true iif we're on the startup phase static zend_always_inline zend_string *zend_string_init_interned( @@ -92,7 +97,8 @@ static zend_always_inline void _gc_try_delref(zend_refcounted_h *_rc) zend_bool zend_ini_parse_bool(zend_string *str); # define zend_string_efree zend_string_free -static inline HashTable *zend_new_array(uint32_t nSize) { +static inline HashTable *zend_new_array(uint32_t nSize) +{ HashTable *ht = (HashTable *)emalloc(sizeof(HashTable)); zend_hash_init(ht, nSize, dummy, ZVAL_PTR_DTOR, 0); return ht; @@ -107,13 +113,16 @@ zend_bool try_convert_to_string(zval *op); #if PHP_VERSION_ID < 80000 /* ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE was added in PHP 8.0 */ -#define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) ZEND_ARG_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, default_value) -#define ZEND_ARG_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, default_value) ZEND_ARG_INFO(pass_by_ref, name) -#ifndef ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE -# define ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, type_hint, allow_null, default_value) \ - ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) -#endif -#define IS_MIXED 0 +# define ZEND_ARG_TYPE_MASK(pass_by_ref, name, type_mask, default_value) \ + ZEND_ARG_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, default_value) +# define ZEND_ARG_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, default_value) \ + ZEND_ARG_INFO(pass_by_ref, name) +# ifndef ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE +# define ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE( \ + pass_by_ref, name, type_hint, allow_null, default_value) \ + ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) +# endif +# define IS_MIXED 0 #endif #if PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 80000 @@ -123,7 +132,7 @@ static zend_always_inline void _gc_try_addref(zend_refcounted_h *rc) rc->refcount++; } } -#define GC_TRY_ADDREF(p) _gc_try_addref(&(p)->gc) +# define GC_TRY_ADDREF(p) _gc_try_addref(&(p)->gc) #endif #if PHP_VERSION_ID >= 70300 && PHP_VERSION_ID < 80100 static zend_always_inline void _gc_try_delref(zend_refcounted_h *rc) @@ -132,7 +141,7 @@ static zend_always_inline void _gc_try_delref(zend_refcounted_h *rc) rc->refcount--; } } -#define GC_TRY_DELREF(p) _gc_try_delref(&(p)->gc) +# define GC_TRY_DELREF(p) _gc_try_delref(&(p)->gc) #endif #if PHP_VERSION_ID < 80100 diff --git a/appsec/src/extension/php_helpers.h b/appsec/src/extension/php_helpers.h index 4489abd9879..d8f8e61ca38 100644 --- a/appsec/src/extension/php_helpers.h +++ b/appsec/src/extension/php_helpers.h @@ -5,8 +5,8 @@ // (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once -#include #include "attributes.h" +#include #ifdef ZTS # define THREAD_LOCAL_ON_ZTS __thread diff --git a/appsec/src/extension/php_objects.c b/appsec/src/extension/php_objects.c index 60b45070b1f..5bc9c90cc35 100644 --- a/appsec/src/extension/php_objects.c +++ b/appsec/src/extension/php_objects.c @@ -30,7 +30,7 @@ dd_result dd_phpobj_reg_funcs(const zend_function_entry *entries) if (res == FAILURE) { return dd_error; } - zend_llist_add_element(&_function_entry_arrays, &entries); + zend_llist_add_element(&_function_entry_arrays, (void *)&entries); return dd_success; } diff --git a/appsec/src/extension/request_abort.c b/appsec/src/extension/request_abort.c index 3424c89c229..978cc124e54 100644 --- a/appsec/src/extension/request_abort.c +++ b/appsec/src/extension/request_abort.c @@ -94,6 +94,15 @@ static void _emit_error(const char *format, ...); static zend_string *nonnull _get_json_blocking_template(void); static zend_string *nonnull _get_html_blocking_template(void); +static zend_string *nonnull _get_empty_blocking_template(void) +{ + if (zend_empty_string != NULL) { + return zend_empty_string; + } + + return zend_string_init("", 0, 0); +} + static inline bool _is_valid_redirect_code(int code) { return code >= 300 && code < 400; // NOLINT @@ -540,7 +549,8 @@ static void _force_destroy_output_handlers(void) if (OG(handlers).elements) { php_output_handler **handler; - while ((handler = zend_stack_top(&OG(handlers)))) { + while ( + (handler = (php_output_handler **)zend_stack_top(&OG(handlers)))) { php_output_handler_free(handler); zend_stack_del_top(&OG(handlers)); } @@ -667,9 +677,9 @@ static void _run_rshutdowns(void) mlog_g(dd_log_debug, "Running remaining extensions' RSHUTDOWN"); for (zend_hash_internal_pointer_end_ex(&module_registry, &pos); - (module = zend_hash_get_current_data_ptr_ex(&module_registry, &pos)) != - NULL; - zend_hash_move_backwards_ex(&module_registry, &pos)) { + (module = zend_hash_get_current_data_ptr_ex(&module_registry, &pos)) != + NULL; + zend_hash_move_backwards_ex(&module_registry, &pos)) { if (!found_ddappsec && strcmp("ddappsec", module->name) == 0) { found_ddappsec = true; continue; @@ -809,7 +819,7 @@ static zend_string *nonnull _get_json_blocking_template(void) // * if the template file is not found, return an empty template // * if the template file is empty, return the default if (!body_error_json) { - return zend_empty_string; + return _get_empty_blocking_template(); } if (ZSTR_LEN(body_error_json) == 0) { zend_string_release(body_error_json); @@ -830,7 +840,7 @@ static zend_string *nonnull _get_html_blocking_template(void) zend_string *nullable body_error_html = _read_file_contents(ZSTR_VAL(html_template_file)); if (!body_error_html) { - return zend_empty_string; + return _get_empty_blocking_template(); } if (ZSTR_LEN(body_error_html) == 0) { zend_string_release(body_error_html); diff --git a/appsec/src/extension/request_lifecycle.c b/appsec/src/extension/request_lifecycle.c index 0e14c3de991..35deaae25a5 100644 --- a/appsec/src/extension/request_lifecycle.c +++ b/appsec/src/extension/request_lifecycle.c @@ -52,7 +52,7 @@ static THREAD_LOCAL_ON_ZTS zval _blocking_function; static THREAD_LOCAL_ON_ZTS bool _shutdown_done_on_commit; static THREAD_LOCAL_ON_ZTS bool _empty_service_or_env; static THREAD_LOCAL_ON_ZTS bool _request_blocked; -#define MAX_LENGTH_OF_REM_CFG_PATH 31 +enum { MAX_LENGTH_OF_REM_CFG_PATH = 31 }; static THREAD_LOCAL_ON_ZTS char _last_rem_cfg_path[MAX_LENGTH_OF_REM_CFG_PATH + 1]; #define CLIENT_IP_LOOKUP_FAILED ((zend_string *)-1) diff --git a/appsec/src/extension/string_helpers.h b/appsec/src/extension/string_helpers.h index 7cf09f11c0a..5a81edffda9 100644 --- a/appsec/src/extension/string_helpers.h +++ b/appsec/src/extension/string_helpers.h @@ -1,8 +1,8 @@ // Unless explicitly stated otherwise all files in this repository are // dual-licensed under the Apache-2.0 License or BSD-3-Clause License. // -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2021 Datadog, Inc. +// This product includes software developed at Datadog +// (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once #include "attributes.h" @@ -12,10 +12,10 @@ #define STR_FOR_FMT(a) ((a) != NULL ? (a) : "(null)") -#define STR_CONS_EQ(str, len, cons) \ +#define STR_CONS_EQ(str, len, cons) \ (sizeof("" cons) - 1 == len && memcmp(str, cons, len) == 0) -#define STR_STARTS_WITH_CONS(str, len, cons) \ +#define STR_STARTS_WITH_CONS(str, len, cons) \ (sizeof("" cons) - 1 <= len && memcmp(str, cons, sizeof(cons) - 1) == 0) #define LSTRLEN(str) (sizeof(str "") - 1) diff --git a/appsec/src/extension/tags.c b/appsec/src/extension/tags.c index ed243e5a859..fccc545fe6f 100644 --- a/appsec/src/extension/tags.c +++ b/appsec/src/extension/tags.c @@ -477,7 +477,7 @@ static zend_string *_concat_json_fragments(void) zend_llist_position pos; for (zend_string **sp = zend_llist_get_first_ex(&_appsec_json_frags, &pos); - sp != NULL; sp = zend_llist_get_next_ex(&_appsec_json_frags, &pos)) { + sp != NULL; sp = zend_llist_get_next_ex(&_appsec_json_frags, &pos)) { zend_string *s = *sp; needed_len += ZSTR_LEN(s); } @@ -489,8 +489,8 @@ static zend_string *_concat_json_fragments(void) size_t i = 0; for (zend_string **sp = zend_llist_get_first_ex(&_appsec_json_frags, &pos); - sp != NULL; - sp = zend_llist_get_next_ex(&_appsec_json_frags, &pos), i++) { + sp != NULL; + sp = zend_llist_get_next_ex(&_appsec_json_frags, &pos), i++) { if (i != 0) { *buf++ = ','; } @@ -804,7 +804,7 @@ static void _dd_response_headers(zend_array *meta_ht) zend_llist *l = &SG(sapi_headers).headers; zend_llist_position pos; for (sapi_header_struct *header = zend_llist_get_first_ex(l, &pos); header; - header = zend_llist_get_next_ex(l, &pos)) { + header = zend_llist_get_next_ex(l, &pos)) { const char *pcol = memchr(header->header, ':', header->header_len); if (!pcol) { if (header->header_len <= INT_MAX) { diff --git a/appsec/src/extension/tags.h b/appsec/src/extension/tags.h index bc50195259e..2c219e55f0e 100644 --- a/appsec/src/extension/tags.h +++ b/appsec/src/extension/tags.h @@ -4,12 +4,11 @@ // This product includes software developed at Datadog // (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once -#include "configuration.h" #include "attributes.h" +#include "configuration.h" #include #include #include -#include "attributes.h" #define DD_TAG_DATA_MAX_LEN (1024UL * 1024UL) @@ -17,7 +16,8 @@ void dd_tags_startup(void); void dd_tags_shutdown(void); void dd_tags_rinit(void); void dd_tags_rshutdown(void); -void dd_tags_add_tags(zend_object *nonnull span, zend_array *nullable superglob_equiv); +void dd_tags_add_tags( + zend_object *nonnull span, zend_array *nullable superglob_equiv); void dd_tags_set_user_event_triggered(void); // Copies (or increases refcount) of zstr diff --git a/appsec/src/extension/tags_arginfo.h b/appsec/src/extension/tags_arginfo.h index 5d790d7a996..2cf3247880b 100644 --- a/appsec/src/extension/tags_arginfo.h +++ b/appsec/src/extension/tags_arginfo.h @@ -1,46 +1,58 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: cf49b514da3ab250e03685f2cabc7ed20575bfa7 */ -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_track_user_signup_event, 0, 1, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 0, "[]") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_track_user_signup_event, 0, 1, IS_VOID, 0) +ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 0) +ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -#define arginfo_datadog_appsec_track_user_login_success_event arginfo_datadog_appsec_track_user_signup_event +#define arginfo_datadog_appsec_track_user_login_success_event \ + arginfo_datadog_appsec_track_user_signup_event -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_track_user_login_failure_event, 0, 2, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, exists, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 0, "[]") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_track_user_login_failure_event, 0, 2, IS_VOID, 0) +ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 0) +ZEND_ARG_TYPE_INFO(0, exists, _IS_BOOL, 0) +ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -#define arginfo_datadog_appsec_track_authenticated_user_event arginfo_datadog_appsec_track_user_signup_event +#define arginfo_datadog_appsec_track_authenticated_user_event \ + arginfo_datadog_appsec_track_user_signup_event -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_track_custom_event, 0, 1, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, event_name, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 0, "[]") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_track_custom_event, 0, 1, IS_VOID, 0) +ZEND_ARG_TYPE_INFO(0, event_name, IS_STRING, 0) +ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_internal_track_user_signup_event_automated, 0, 3, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, framework, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, user_login, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 1) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 1, "null") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_internal_track_user_signup_event_automated, 0, 3, + IS_VOID, 0) +ZEND_ARG_TYPE_INFO(0, framework, IS_STRING, 0) +ZEND_ARG_TYPE_INFO(0, user_login, IS_STRING, 1) +ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 1) +ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_datadog_appsec_internal_track_user_login_success_event_automated arginfo_datadog_appsec_internal_track_user_signup_event_automated +#define arginfo_datadog_appsec_internal_track_user_login_success_event_automated \ + arginfo_datadog_appsec_internal_track_user_signup_event_automated -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_internal_track_user_login_failure_event_automated, 0, 4, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, framework, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, user_login, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, exists, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 1, "null") +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_internal_track_user_login_failure_event_automated, 0, + 4, IS_VOID, 0) +ZEND_ARG_TYPE_INFO(0, framework, IS_STRING, 0) +ZEND_ARG_TYPE_INFO(0, user_login, IS_STRING, 1) +ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 1) +ZEND_ARG_TYPE_INFO(0, exists, _IS_BOOL, 0) +ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, metadata, IS_ARRAY, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_datadog_appsec_internal_track_authenticated_user_event_automated, 0, 2, IS_VOID, 0) - ZEND_ARG_TYPE_INFO(0, framework, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 1) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX( + arginfo_datadog_appsec_internal_track_authenticated_user_event_automated, 0, + 2, IS_VOID, 0) +ZEND_ARG_TYPE_INFO(0, framework, IS_STRING, 0) +ZEND_ARG_TYPE_INFO(0, user_id, IS_STRING, 1) ZEND_END_ARG_INFO() ZEND_FUNCTION(datadog_appsec_track_user_signup_event); @@ -53,15 +65,39 @@ ZEND_FUNCTION(datadog_appsec_internal_track_user_login_success_event_automated); ZEND_FUNCTION(datadog_appsec_internal_track_user_login_failure_event_automated); ZEND_FUNCTION(datadog_appsec_internal_track_authenticated_user_event_automated); -static const zend_function_entry ext_functions[] = { - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", "track_user_signup_event"), zif_datadog_appsec_track_user_signup_event, arginfo_datadog_appsec_track_user_signup_event, 0, NULL, NULL) - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", "track_user_login_success_event"), zif_datadog_appsec_track_user_login_success_event, arginfo_datadog_appsec_track_user_login_success_event, ZEND_ACC_DEPRECATED, NULL, NULL) - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", "track_user_login_failure_event"), zif_datadog_appsec_track_user_login_failure_event, arginfo_datadog_appsec_track_user_login_failure_event, ZEND_ACC_DEPRECATED, NULL, NULL) - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", "track_authenticated_user_event"), zif_datadog_appsec_track_authenticated_user_event, arginfo_datadog_appsec_track_authenticated_user_event, 0, NULL, NULL) - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", "track_custom_event"), zif_datadog_appsec_track_custom_event, arginfo_datadog_appsec_track_custom_event, 0, NULL, NULL) - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec\\internal", "track_user_signup_event_automated"), zif_datadog_appsec_internal_track_user_signup_event_automated, arginfo_datadog_appsec_internal_track_user_signup_event_automated, 0, NULL, NULL) - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec\\internal", "track_user_login_success_event_automated"), zif_datadog_appsec_internal_track_user_login_success_event_automated, arginfo_datadog_appsec_internal_track_user_login_success_event_automated, 0, NULL, NULL) - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec\\internal", "track_user_login_failure_event_automated"), zif_datadog_appsec_internal_track_user_login_failure_event_automated, arginfo_datadog_appsec_internal_track_user_login_failure_event_automated, 0, NULL, NULL) - ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec\\internal", "track_authenticated_user_event_automated"), zif_datadog_appsec_internal_track_authenticated_user_event_automated, arginfo_datadog_appsec_internal_track_authenticated_user_event_automated, 0, NULL, NULL) - ZEND_FE_END -}; +static const zend_function_entry ext_functions[] = {ZEND_RAW_FENTRY( + ZEND_NS_NAME("datadog\\appsec", "track_user_signup_event"), + zif_datadog_appsec_track_user_signup_event, + arginfo_datadog_appsec_track_user_signup_event, 0, NULL, + NULL) ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", + "track_user_login_success_event"), + zif_datadog_appsec_track_user_login_success_event, + arginfo_datadog_appsec_track_user_login_success_event, ZEND_ACC_DEPRECATED, + NULL, NULL) ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", + "track_user_login_failure_event"), + zif_datadog_appsec_track_user_login_failure_event, + arginfo_datadog_appsec_track_user_login_failure_event, ZEND_ACC_DEPRECATED, + NULL, NULL) ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", + "track_authenticated_user_event"), + zif_datadog_appsec_track_authenticated_user_event, + arginfo_datadog_appsec_track_authenticated_user_event, 0, NULL, + NULL) ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec", "track_custom_event"), + zif_datadog_appsec_track_custom_event, + arginfo_datadog_appsec_track_custom_event, 0, NULL, + NULL) ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec\\internal", + "track_user_signup_event_automated"), + zif_datadog_appsec_internal_track_user_signup_event_automated, + arginfo_datadog_appsec_internal_track_user_signup_event_automated, 0, NULL, + NULL) ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec\\internal", + "track_user_login_success_event_automated"), + zif_datadog_appsec_internal_track_user_login_success_event_automated, + arginfo_datadog_appsec_internal_track_user_login_success_event_automated, 0, + NULL, NULL) ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec\\internal", + "track_user_login_failure_event_automated"), + zif_datadog_appsec_internal_track_user_login_failure_event_automated, + arginfo_datadog_appsec_internal_track_user_login_failure_event_automated, 0, + NULL, NULL) ZEND_RAW_FENTRY(ZEND_NS_NAME("datadog\\appsec\\internal", + "track_authenticated_user_event_automated"), + zif_datadog_appsec_internal_track_authenticated_user_event_automated, + arginfo_datadog_appsec_internal_track_authenticated_user_event_automated, 0, + NULL, NULL) ZEND_FE_END}; diff --git a/appsec/src/extension/telemetry.h b/appsec/src/extension/telemetry.h index ff0ba9a5a80..57eed8cc850 100644 --- a/appsec/src/extension/telemetry.h +++ b/appsec/src/extension/telemetry.h @@ -14,21 +14,18 @@ void dd_telemetry_add_metric(zend_string *nonnull name_zstr, double value, void dd_telemetry_add_sdk_event( char *nonnull event_type, size_t event_type_len); void dd_telemetry_add_missing_user_login(const char *nonnull event_type, - size_t event_type_len, const char *nonnull framework, - size_t framework_len); + size_t event_type_len, const char *nonnull framework, size_t framework_len); void dd_telemetry_add_missing_user_id(const char *nonnull event_type, - size_t event_type_len, const char *nonnull framework, - size_t framework_len); + size_t event_type_len, const char *nonnull framework, size_t framework_len); void dd_telemetry_startup(void); void dd_telemetry_mshutdown(void); void dd_telemetry_rinit(void); -void dd_telemetry_note_helper_string_meta(const char *nonnull key, size_t key_len, - const char *nonnull val, size_t val_len); +void dd_telemetry_note_helper_string_meta(const char *nonnull key, + size_t key_len, const char *nonnull val, size_t val_len); // NOLINTNEXTLINE(bugprone-easily-swappable-parameters) -void dd_telemetry_submit_duration_ext( - double waf_ext_us, double rasp_ext_us); +void dd_telemetry_submit_duration_ext(double waf_ext_us, double rasp_ext_us); void dd_telemetry_helper_conn_error(void); void dd_telemetry_helper_conn_success(void); diff --git a/appsec/src/extension/user_tracking.h b/appsec/src/extension/user_tracking.h index f01aa30b327..31df61ce1bf 100644 --- a/appsec/src/extension/user_tracking.h +++ b/appsec/src/extension/user_tracking.h @@ -5,8 +5,8 @@ // (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. #pragma once -#include "zai_string/string.h" #include "attributes.h" +#include "zai_string/string.h" #include typedef enum _user_collection_mode { @@ -17,7 +17,7 @@ typedef enum _user_collection_mode { } user_collection_mode; typedef enum _user_event { - user_event_none = 0, + user_event_none = 0, user_event_login_success, user_event_login_failure } user_event; diff --git a/appsec/src/extension/xml_truncated_parser.c b/appsec/src/extension/xml_truncated_parser.c index 8f8aa0a8552..9bf8522f42d 100644 --- a/appsec/src/extension/xml_truncated_parser.c +++ b/appsec/src/extension/xml_truncated_parser.c @@ -18,7 +18,7 @@ #include // clang-format on -#define STACK_INITIAL_CAPACITY 16 +enum { STACK_INITIAL_CAPACITY = 16 }; typedef struct { zval **items; size_t size; @@ -453,7 +453,8 @@ static void _sax_start_element_ns(void *user_ctx, const xmlChar *localname, for (int i = 0; i < nb_attributes; i++) { // NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers) - memcpy(&attr, &attributes[(ptrdiff_t)i * 5], sizeof(attr)); + memcpy(&attr, (const void *)&attributes[(ptrdiff_t)i * 5], + sizeof(attr)); // Build qualified attribute name with @ prefix zend_string *prefixed_name = diff --git a/appsec/src/extension/xml_truncated_parser.h b/appsec/src/extension/xml_truncated_parser.h index 3096c9c7711..d5bfe9046d6 100644 --- a/appsec/src/extension/xml_truncated_parser.h +++ b/appsec/src/extension/xml_truncated_parser.h @@ -5,10 +5,10 @@ // (https://www.datadoghq.com/). Copyright 2025 Datadog, Inc. #pragma once +#include "attributes.h" #include #include #include -#include "attributes.h" bool dd_xml_parser_startup(void); void dd_xml_parser_shutdown(void); diff --git a/appsec/src/helper/.clang-tidy b/appsec/src/helper/.clang-tidy index 56f0b950c90..86ef4b8b1b1 100644 --- a/appsec/src/helper/.clang-tidy +++ b/appsec/src/helper/.clang-tidy @@ -1,4 +1,4 @@ -Checks: 'readability-identifier-naming,-bugprone-lambda-function-name' +Checks: 'readability-identifier-naming,-bugprone-lambda-function-name,-clang-analyzer-optin.cplusplus.UninitializedObject' CheckOptions: - key: readability-identifier-naming.StructCase diff --git a/appsec/src/helper/client.cpp b/appsec/src/helper/client.cpp index 5a524c60ee2..5aee831ef6e 100644 --- a/appsec/src/helper/client.cpp +++ b/appsec/src/helper/client.cpp @@ -4,6 +4,7 @@ // This product includes software developed at Datadog // (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. +#include #include #include #include @@ -474,7 +475,8 @@ bool client::handle_command(network::request_shutdown::request &command) return false; } - context_->set_input_truncated(command.input_truncated); + assert(context_.has_value()); + context_.value().set_input_truncated(command.input_truncated); collect_metrics(*response, *service_, context_, sc_settings_); service_->drain_logs(sc_settings_); diff --git a/appsec/src/helper/compression.cpp b/appsec/src/helper/compression.cpp index 2446ad9b783..aa2c0a2c546 100644 --- a/appsec/src/helper/compression.cpp +++ b/appsec/src/helper/compression.cpp @@ -19,7 +19,8 @@ constexpr int max_round_decompression = 100; size_t estimate_compressed_size(size_t in_len) { // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers) - return (((size_t)((double)in_len * (double)1.015)) + 10 + 8 + 4 + 1); + return static_cast(static_cast(in_len) * 1.015) + 10 + 8 + + 4 + 1; // NOLINTEND(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers) } } // namespace @@ -31,7 +32,7 @@ std::optional compress(const std::string &text) std::string ret_string; z_stream strm = {}; - if (text.length() == 0) { + if (text.empty()) { return std::nullopt; } @@ -69,7 +70,7 @@ std::optional uncompress(const std::string &compressed) size_t capacity; z_stream strm = {}; - if (compressed.length() < 1 || Z_OK != inflateInit2(&strm, encoding)) { + if (compressed.empty() || Z_OK != inflateInit2(&strm, encoding)) { return std::nullopt; } diff --git a/appsec/src/helper/engine.cpp b/appsec/src/helper/engine.cpp index 083839ebdaf..bf20e040cbb 100644 --- a/appsec/src/helper/engine.cpp +++ b/appsec/src/helper/engine.cpp @@ -131,11 +131,15 @@ std::optional engine::context::publish( // no actions, but we have json fragments in triggers. Add a record action if (event.actions.empty()) { - action record = {dds::action_type::record, {}}; - event.actions.emplace_back(std::move(record)); + event.actions.emplace_back( + dds::action{.type = dds::action_type::record, .parameters = {}}); } - dds::engine::result res{{}, std::move(event.triggers), force_keep}; + dds::engine::result res{ + .actions = {}, + .triggers = std::move(event.triggers), + .force_keep = force_keep, + }; for (auto const &action : event.actions) { dds::action new_action; new_action.type = action.type; diff --git a/appsec/src/helper/engine_settings.cpp b/appsec/src/helper/engine_settings.cpp index d8e6e2440f7..fc2f24efb23 100644 --- a/appsec/src/helper/engine_settings.cpp +++ b/appsec/src/helper/engine_settings.cpp @@ -53,9 +53,9 @@ namespace dds { namespace { struct def_rules_file { - std::atomic stored_file{}; + std::atomic stored_file; - def_rules_file() = default; + def_rules_file() : stored_file(nullptr) {} def_rules_file(const def_rules_file &) = delete; def_rules_file(def_rules_file &&) = delete; def_rules_file &operator=(const def_rules_file &) = delete; diff --git a/appsec/src/helper/json_helper.cpp b/appsec/src/helper/json_helper.cpp index 79ed711c960..d3b4ebaefd2 100644 --- a/appsec/src/helper/json_helper.cpp +++ b/appsec/src/helper/json_helper.cpp @@ -9,6 +9,7 @@ #include "parameter_view.hpp" #include "std_logging.hpp" #include +#include #include #include #include @@ -90,10 +91,12 @@ std::string parameter_to_json(const parameter_view &pv) return {}; } +namespace { + // TODO: we should limit the recursion -template >, - std::is_same>>>> +template + requires(std::same_as> || + std::same_as>) // NOLINTNEXTLINE(misc-no-recursion) void json_to_object(ddwaf_object *object, T &doc) { @@ -110,7 +113,9 @@ void json_to_object(ddwaf_object *object, T &doc) ddwaf_object element; json_to_object(&element, kv.value); - std::string_view const key = kv.name.GetString(); + std::string_view const key{ + kv.name.GetString(), kv.name.GetStringLength()}; + // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage) ddwaf_object_map_addl(object, key.data(), key.length(), &element); } break; @@ -126,7 +131,8 @@ void json_to_object(ddwaf_object *object, T &doc) break; } case rapidjson::kStringType: { - std::string_view const str = doc.GetString(); + std::string_view const str{doc.GetString(), doc.GetStringLength()}; + // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage) ddwaf_object_stringl(object, str.data(), str.size()); break; } @@ -147,6 +153,8 @@ void json_to_object(ddwaf_object *object, T &doc) } } +} // namespace + dds::parameter json_to_parameter(const rapidjson::Value &value) { dds::parameter obj; @@ -157,7 +165,7 @@ dds::parameter json_to_parameter(const rapidjson::Value &value) dds::parameter json_to_parameter(std::string_view json) { rapidjson::Document doc; - rapidjson::ParseResult const result = doc.Parse(json.data()); + rapidjson::ParseResult const result = doc.Parse(json.data(), json.size()); if (result.IsError()) { throw parsing_error("invalid json object: "s + rapidjson::GetParseError_En(result.Code())); @@ -170,7 +178,7 @@ json_helper::get_field_of_type(const rapidjson::Value &parent_field, std::string_view key, rapidjson::Type type) { rapidjson::Value::ConstMemberIterator const output_itr = - parent_field.FindMember(key.data()); + parent_field.FindMember(rapidjson::StringRef(key.data(), key.size())); if (output_itr == parent_field.MemberEnd()) { SPDLOG_DEBUG("Field {} not found", key); @@ -206,7 +214,8 @@ json_helper::get_field_of_type( bool json_helper::field_exists( const rapidjson::Value &parent_field, std::string_view key) { - return parent_field.FindMember(key.data()) != parent_field.MemberEnd(); + return parent_field.FindMember(rapidjson::StringRef( + key.data(), key.size())) != parent_field.MemberEnd(); } bool json_helper::field_exists( diff --git a/appsec/src/helper/main.cpp b/appsec/src/helper/main.cpp index 61b7ce6279e..6785ed4cef9 100644 --- a/appsec/src/helper/main.cpp +++ b/appsec/src/helper/main.cpp @@ -104,7 +104,7 @@ bool ensure_unique_abstract_socket(std::string_view socket_path) return false; } - struct sockaddr_un addr {}; + struct sockaddr_un addr{}; addr.sun_family = AF_UNIX; addr.sun_path[0] = '\0'; diff --git a/appsec/src/helper/network/acceptor.cpp b/appsec/src/helper/network/acceptor.cpp index f2b80314886..5cd4e5fac03 100644 --- a/appsec/src/helper/network/acceptor.cpp +++ b/appsec/src/helper/network/acceptor.cpp @@ -28,7 +28,7 @@ acceptor::acceptor(const std::string_view &sv) throw std::system_error(errno, std::generic_category()); } - struct sockaddr_un addr {}; + struct sockaddr_un addr{}; std::size_t addr_size; addr.sun_family = AF_UNIX; bool const is_abstract = (!sv.empty() && sv[0] == '@'); @@ -101,7 +101,7 @@ acceptor::acceptor(const std::string_view &sv) void acceptor::set_accept_timeout(std::chrono::seconds timeout) { - struct timeval tv = {timeout.count(), 0}; + struct timeval tv = {.tv_sec = timeout.count(), .tv_usec = 0}; int const res = setsockopt(sock_.get(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); if (res == -1) { @@ -111,10 +111,10 @@ void acceptor::set_accept_timeout(std::chrono::seconds timeout) std::unique_ptr acceptor::accept() { - struct sockaddr_un addr {}; + struct sockaddr_un addr{}; socklen_t len = sizeof(addr); - int s = + const int s = // NOLINTNEXTLINE ::accept(sock_.get(), reinterpret_cast(&addr), &len); if (s == -1) { diff --git a/appsec/src/helper/network/msgpack_helpers.cpp b/appsec/src/helper/network/msgpack_helpers.cpp index 6effe74db8c..981da3b523b 100644 --- a/appsec/src/helper/network/msgpack_helpers.cpp +++ b/appsec/src/helper/network/msgpack_helpers.cpp @@ -70,6 +70,7 @@ msgpack::object const &convert::operator()( msgpack::object const &o, dds::parameter &v) const { v = msgpack_to_param(o); + // NOLINTNEXTLINE(bugprone-return-const-ref-from-parameter) return o; } diff --git a/appsec/src/helper/parameter.cpp b/appsec/src/helper/parameter.cpp index 61b50ff4417..c1ec3bcf1a1 100644 --- a/appsec/src/helper/parameter.cpp +++ b/appsec/src/helper/parameter.cpp @@ -84,6 +84,7 @@ parameter parameter::string(std::string_view str) noexcept length_type const length = str.length() <= max_length ? str.length() : max_length; ddwaf_object obj; + // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage) ddwaf_object_stringl(&obj, str.data(), length); return parameter{obj}; } @@ -124,6 +125,7 @@ bool parameter::add(std::string_view name, parameter &&entry) noexcept { length_type const length = name.length() <= max_length ? name.length() : max_length; + // NOLINTNEXTLINE(bugprone-suspicious-stringview-data-usage) if (!ddwaf_object_map_addl(this, name.data(), length, entry)) { return false; } diff --git a/appsec/src/helper/rate_limit.hpp b/appsec/src/helper/rate_limit.hpp index 54a47c43363..c91f57775c2 100644 --- a/appsec/src/helper/rate_limit.hpp +++ b/appsec/src/helper/rate_limit.hpp @@ -19,7 +19,7 @@ namespace dds { template class rate_limiter { public: explicit rate_limiter(uint32_t max_per_second) - : max_per_second_(max_per_second){}; + : max_per_second_(max_per_second) {}; bool allow() { SPDLOG_TRACE("rate_limiter: allow() called"); diff --git a/appsec/src/helper/rcu.h b/appsec/src/helper/rcu.h index 9f1081cf583..2ca020db24a 100644 --- a/appsec/src/helper/rcu.h +++ b/appsec/src/helper/rcu.h @@ -5,8 +5,8 @@ #include #include #include -#include #include +#include /* * A simple RCU implementation, using a global generation counter and per-reader @@ -192,7 +192,8 @@ template class rcu_manager { : data_ptr{initial_data.release()} {} - ~rcu_manager() { + ~rcu_manager() + { auto *data = data_ptr.exchange(nullptr, std::memory_order_release); if (data) { delete data; @@ -225,10 +226,7 @@ template class rcu_manager { } // for internal use by rcu_read_guard - T *get_data_acq() const - { - return data_ptr.load(std::memory_order_acquire); - } + T *get_data_acq() const { return data_ptr.load(std::memory_order_acquire); } void collect_garbage() { diff --git a/appsec/src/helper/remote_config/config.cpp b/appsec/src/helper/remote_config/config.cpp index 2a3ec65e779..9e06452d06c 100644 --- a/appsec/src/helper/remote_config/config.cpp +++ b/appsec/src/helper/remote_config/config.cpp @@ -42,7 +42,7 @@ config config::from_line(std::string_view line) // base64 decode rc_path (no padding): std::string rc_path = base64_decode(rc_path_encoded); - return {std::string{shm_path}, std::move(rc_path)}; + return {.shm_path = std::string{shm_path}, .rc_path = std::move(rc_path)}; } mapped_memory config::read() const @@ -57,7 +57,7 @@ mapped_memory config::read() const auto close_fs = defer{[fd]() { ::close(fd); }}; // check that the uid of the shared memory segment is the same as ours - struct ::stat shm_stat {}; + struct ::stat shm_stat{}; if (::fstat(fd, &shm_stat) == -1) { throw std::runtime_error{ "Call to fstat on memory segment failed: " + strerror_ts(errno)}; diff --git a/appsec/src/helper/remote_config/config.hpp b/appsec/src/helper/remote_config/config.hpp index be94906e6d0..586c5dd3832 100644 --- a/appsec/src/helper/remote_config/config.hpp +++ b/appsec/src/helper/remote_config/config.hpp @@ -135,9 +135,7 @@ class parsed_config_key { std::string key_; std::string_view source_; std::uint64_t org_id_{}; - class product product_ { - known_products::UNKNOWN - }; + class product product_{known_products::UNKNOWN}; std::string_view config_id_; std::string_view name_; }; diff --git a/appsec/src/helper/remote_config/listeners/asm_features_listener.hpp b/appsec/src/helper/remote_config/listeners/asm_features_listener.hpp index 0e81b07908c..a04fb4e4e4d 100644 --- a/appsec/src/helper/remote_config/listeners/asm_features_listener.hpp +++ b/appsec/src/helper/remote_config/listeners/asm_features_listener.hpp @@ -17,7 +17,7 @@ class asm_features_listener : public listener_base { public: explicit asm_features_listener( std::shared_ptr service_config) - : service_config_(std::move(service_config)){}; + : service_config_(std::move(service_config)) {}; void init() override; void on_update(const config &config) override; diff --git a/appsec/src/helper/remote_config/listeners/engine_listener.cpp b/appsec/src/helper/remote_config/listeners/engine_listener.cpp index 4e296600c46..1648fa6772e 100644 --- a/appsec/src/helper/remote_config/listeners/engine_listener.cpp +++ b/appsec/src/helper/remote_config/listeners/engine_listener.cpp @@ -44,7 +44,7 @@ void engine_listener::on_update(const config &config) } auto &aggregator = it->second; - if (to_commit_.find(aggregator.get()) == to_commit_.end()) { + if (!to_commit_.contains(aggregator.get())) { aggregator->init(&ruleset_.GetAllocator()); to_commit_.emplace(aggregator.get()); } @@ -62,7 +62,7 @@ void engine_listener::on_unapply(const config &config) } auto &aggregator = it->second; - if (to_commit_.find(aggregator.get()) == to_commit_.end()) { + if (!to_commit_.contains(aggregator.get())) { aggregator->init(&ruleset_.GetAllocator()); to_commit_.emplace(aggregator.get()); } @@ -77,7 +77,7 @@ void engine_listener::commit() } for (auto &[product, aggregator] : aggregators_) { - if (to_commit_.find(aggregator.get()) != to_commit_.end()) { + if (to_commit_.contains(aggregator.get())) { aggregator->aggregate(ruleset_); } } diff --git a/appsec/src/helper/runner.cpp b/appsec/src/helper/runner.cpp index 32e0ddd60d6..7e1a7fd2b11 100644 --- a/appsec/src/helper/runner.cpp +++ b/appsec/src/helper/runner.cpp @@ -35,10 +35,10 @@ std::unique_ptr acceptor_from_config( const config::config &cfg) { std::string_view const sock_path{cfg.socket_file_path()}; - if (sock_path.size() >= 4 && sock_path.substr(0, 3) == "fd:") { + if (sock_path.size() >= 4 && sock_path.starts_with("fd:")) { auto rest{sock_path.substr(3)}; int const fd = std::stoi(std::string{rest}); // can throw - struct stat statbuf {}; + struct stat statbuf{}; int const res = fstat(fd, &statbuf); if (res == -1 || !S_ISSOCK(statbuf.st_mode)) { throw std::invalid_argument{ diff --git a/appsec/src/helper/subscriber/waf.cpp b/appsec/src/helper/subscriber/waf.cpp index 74b9075f95b..047620955d6 100644 --- a/appsec/src/helper/subscriber/waf.cpp +++ b/appsec/src/helper/subscriber/waf.cpp @@ -216,7 +216,9 @@ void format_waf_result( const parameter_view actions_pv{*actions}; for (const auto &action : actions_pv) { dds::action a{ - parse_action_type_string(std::string(action.key())), {}}; + .type = parse_action_type_string(std::string(action.key())), + .parameters = {}, + }; for (const auto ¶meter : action) { std::string value; // As of libddwaf 1.28.0, status_code and grpc_status_code @@ -689,7 +691,8 @@ void instance::listener::call(dds::parameter_view &data, event &event, switch (code) { case DDWAF_MATCH: rule_triggered_ = true; - return format_waf_result(actions, events, event); + format_waf_result(actions, events, event); + return; case DDWAF_ERR_INTERNAL: waf_run_error_ = true; throw internal_error(); diff --git a/appsec/src/helper/utils.cpp b/appsec/src/helper/utils.cpp index 05c44fc0f02..ec32b690d33 100644 --- a/appsec/src/helper/utils.cpp +++ b/appsec/src/helper/utils.cpp @@ -15,13 +15,14 @@ namespace dds { std::string read_file(std::string_view filename) { - std::ifstream file(filename.data(), std::ios::in); + const std::string path{filename}; + std::ifstream file(path, std::ios::in); if (!file) { throw std::system_error(errno, std::generic_category()); } - struct stat statbuf {}; - auto rc = stat(std::string{filename}.c_str(), &statbuf); + struct stat statbuf{}; + auto rc = stat(path.c_str(), &statbuf); auto file_size = rc == 0 ? statbuf.st_size : 0; std::string buffer(file_size, '\0'); buffer.resize(file_size); diff --git a/appsec/tests/helper/engine_test.cpp b/appsec/tests/helper/engine_test.cpp index 3436374aa87..732e4c67c3d 100644 --- a/appsec/tests/helper/engine_test.cpp +++ b/appsec/tests/helper/engine_test.cpp @@ -279,14 +279,15 @@ TEST(EngineTest, WafDefaultActions) auto listener = std::make_unique(); EXPECT_CALL(*listener, call(_, _, _)) - .WillRepeatedly(Invoke([](dds::parameter_view &data, dds::event &event_, - const dds::network::request_exec_options - &options) -> void { - event_.actions.push_back({dds::action_type::redirect, {}}); - event_.actions.push_back({dds::action_type::block, {}}); - event_.actions.push_back({dds::action_type::stack_trace, {}}); - event_.actions.push_back({dds::action_type::extract_schema, {}}); - })); + .WillRepeatedly(Invoke( + [](dds::parameter_view &data, dds::event &event_, + const dds::network::request_exec_options &options) -> void { + event_.actions.push_back({dds::action_type::redirect, {}}); + event_.actions.push_back({dds::action_type::block, {}}); + event_.actions.push_back({dds::action_type::stack_trace, {}}); + event_.actions.push_back( + {dds::action_type::extract_schema, {}}); + })); auto sub = std::make_unique(); EXPECT_CALL(*sub, get_listener()).WillOnce(Invoke([&]() { diff --git a/appsec/tests/integration/build.gradle b/appsec/tests/integration/build.gradle index 6f10f373ef6..d9f23734e4d 100644 --- a/appsec/tests/integration/build.gradle +++ b/appsec/tests/integration/build.gradle @@ -1101,14 +1101,8 @@ buildRunInDockerTask( echo 'Found profraw files:' ls -la *.profraw - # Detect the architecture-specific toolchain path - ARCH=\$(uname -m) - if [ "\$ARCH" = "aarch64" ]; then - RUST_TARGET="aarch64-unknown-linux-gnu" - else - RUST_TARGET="x86_64-unknown-linux-gnu" - fi - LLVM_TOOLS="/root/.rustup/toolchains/1.84.1-\${RUST_TARGET}/lib/rustlib/\${RUST_TARGET}/bin" + RUST_TARGET_LIBDIR="\$(rustc --print target-libdir)" + LLVM_TOOLS="\${RUST_TARGET_LIBDIR%/lib}/bin" \${LLVM_TOOLS}/llvm-profdata merge -sparse *.profraw -o merged.profdata \${LLVM_TOOLS}/llvm-cov export \\ diff --git a/appsec/tests/integration/gradle/images.gradle b/appsec/tests/integration/gradle/images.gradle index b32e23eee34..f285ea546c1 100644 --- a/appsec/tests/integration/gradle/images.gradle +++ b/appsec/tests/integration/gradle/images.gradle @@ -307,6 +307,48 @@ tasks.register('pushMultiArch') { dependsOn allMultiArchTasks } +// Build a JSON-parsing closure backed by a private copy of groovy-json loaded +// in an isolated, child-first classloader. FastStringUtils' daemon-global +// static service cache can otherwise be poisoned permanently by a worker +// thread whose context classloader lacks the groovy-json service. +def makeIsolatedJsonParser = { + URL jsonJar = groovy.json.JsonSlurper.protectionDomain.codeSource.location + ClassLoader parent = groovy.json.JsonSlurper.classLoader + def isolated = new URLClassLoader([jsonJar] as URL[], parent) { + @Override + protected Class loadClass(String name, boolean resolve) { + // Define groovy-json's own classes locally so they get fresh + // static state; delegate everything else (groovy runtime, JDK, + // ...) to the parent so types stay mutually compatible. + if (name.startsWith('groovy.json.') || name.startsWith('org.apache.groovy.json.')) { + synchronized (getClassLoadingLock(name)) { + Class c = findLoadedClass(name) ?: findClass(name) + if (resolve) { + resolveClass(c) + } + return c + } + } + super.loadClass(name, resolve) + } + } + Class slurperClass = isolated.loadClass('groovy.json.JsonSlurper') + def ctor = slurperClass.getDeclaredConstructor() + def parseText = slurperClass.getMethod('parseText', String) + return { String text -> + // ServiceLoader (inside the isolated FastStringUtils) uses the thread + // context classloader; point it at our loader so the service resolves + // regardless of which thread runs the parse. + def prev = Thread.currentThread().contextClassLoader + Thread.currentThread().contextClassLoader = isolated + try { + parseText.invoke(ctor.newInstance(), text) + } finally { + Thread.currentThread().contextClassLoader = prev + } + } +} + task generateTagMappings { description = "Generate tag_mappings.gradle file with SHA256 hashes for all pushed images" def outputFile = file("${project.rootDir}/gradle/tag_mappings.gradle") @@ -318,6 +360,7 @@ task generateTagMappings { pushTask.name - ~/\ApushImage-/ } + def parseJson = makeIsolatedJsonParser() def tagMappings = new java.util.concurrent.ConcurrentHashMap() def customThreadPool = new java.util.concurrent.ForkJoinPool(10) @@ -336,7 +379,7 @@ task generateTagMappings { proc.waitForOrKill(10_000) if (proc.exitValue() == 0) { - String sha256 = new groovy.json.JsonSlurper().parseText(proc.text) + String sha256 = parseJson(proc.text) tagMappings[tag] = sha256 println "${imageRef} → ${sha256}" success = true diff --git a/appsec/tests/integration/gradle/tag_mappings.gradle b/appsec/tests/integration/gradle/tag_mappings.gradle index af3f27ce03e..ca2bdd442c4 100644 --- a/appsec/tests/integration/gradle/tag_mappings.gradle +++ b/appsec/tests/integration/gradle/tag_mappings.gradle @@ -1,141 +1,141 @@ // Auto-generated tag mappings with SHA256 hashes -// Generated on Thu Jun 26 16:49:39 WEST 2025 +// Generated on Fri May 29 00:08:57 WEST 2026 ext.tag_mappings = [ - 'apache2-mod-php-8.0-release-zts': 'sha256:5221a1aa7d1169c47b276c1a3ffd9021f751027814877ea44026fd2d1db3212a', - 'apache2-mod-php-8.1-release-zts': 'sha256:2d0d0a916e97de14450be9b88eb438074ea64a93b620c60039b8e643feb2226e', - 'apache2-mod-php-8.0-debug': 'sha256:5c8880c3365d1856c0d554d48b5d8f7800c6292d97e00d46eda638885c4f9cde', - 'apache2-mod-php-8.2-release-zts': 'sha256:6201a4210d48093c70c0d27f104f644be9f5a76287875a19f1453f44c13a19c8', - 'apache2-mod-php-7.2-debug': 'sha256:bde590e37918a4fb52fceba4eca20d67b31adc4d0a3f64b94b93e5c951bd375c', - 'php-8.0-release-zts': 'sha256:b6243199f6aea0792a97583c9036f0b191ad9efb96ea337632fbaca76289a4da', - 'apache2-fpm-php-7.0-release': 'sha256:c1770decbbcc963bcae3568531f6fff992bf1f522203477d379dd8118d681a21', - 'nginx-fpm-php-8.1-release-zts': 'sha256:fe2a456acc419a400263be30df53069183f99972a218d729632dfdcf3c370583', - 'nginx-fpm-php-8.0-release-zts': 'sha256:4a827735d62e4d16788d3f4b8575bcd66e98c40dfa0e15da2e8824d4a07109f7', - 'nginx-fpm-php-8.2-release': 'sha256:026f0ae916e4d8ea9a5524f13ca7c7878d057e6bba21598c6e769321a4002d5b', - 'php-8.4-release-zts': 'sha256:8e0ac25a3306b4b9f692c593b8a509cc789c2e001ce52682928065a92c880136', - 'php-8.0-release': 'sha256:15a9e23372df35fbb9c587ef7d3ec69be4b134be9742e108a70999f081e75e53', - 'nginx-fpm-php-8.2-release-zts': 'sha256:08b1e29c1ef5208a9ed51805340f913e52d8c7b414840407949e49cdf4dd0b6c', - 'nginx-fpm-php-8.3-release-zts': 'sha256:db36fddc1afdf5c8d0f1359e3dcfd74667c0e9df0c1d3baf3cb0b9b8bbba146e', - 'php-8.2-release-zts': 'sha256:cb143d915b394f16a2d78018765705460f3d1b788fdd2a90ef50fad5f8f5918c', - 'php-8.3-release-zts': 'sha256:e58e25a017f75df82691d408b8cb70453875ff36718e295ee8c6653a0f117331', - 'apache2-fpm-php-7.4-release': 'sha256:7b702e1d5ecfe1ffd97697bfe27f01a53808cfa27882e443ec75e2b52846b71e', - 'apache2-mod-php-8.3-debug': 'sha256:a9ac7a80d45ad77df9607d9f12e57f4881f97c0b21621c679df664ce70e73fd1', - 'php-8.1-release-zts': 'sha256:5b8a269b4228d9191420059daef820b660110be0aca6776557924172fd1ff0c8', - 'apache2-mod-php-7.4-release': 'sha256:8568f07aaf294f417df0c48209e920582c4f2a4af6a4596ebb9bc78b456f4806', - 'nginx-fpm-php-8.4-release-zts': 'sha256:8d7fc86b5fc18051a3b1aa34930e9ec69b06d0df1b5df48bf6f3e11318734aa6', - 'php-8.0-debug': 'sha256:900ceae7487db1e3652de2880c181e572fdf053673bcda8ff47abf664ff74d39', - 'nginx-fpm-php-8.4-debug': 'sha256:105176db0bd6631895cec72d9299d57debe07e6d858ebf253b2243b505fba36b', - 'apache2-fpm-php-8.1-debug': 'sha256:331e0d9041c83e63d645464320826794a06f28ba9a61fed398733678f5078713', - 'apache2-fpm-php-8.4-release': 'sha256:63892415800a28762de027338af3de1b67a5e20068270d5a1c3a255a52e099eb', - 'apache2-fpm-php-8.0-release': 'sha256:24af820f9381d0461308ae654831ff0de7b162f6ee4953b7731ad7c2b3864857', - 'apache2-fpm-php-8.4-debug': 'sha256:381cd576bee2c4a1b543b280d57f81e4869e72bd3d5108340744321c6f99d43b', - 'nginx-fpm-php-7.3-release': 'sha256:864053ec4c79c690bbec7646e958a24b5591eec74ca27a064a810a1dd29a1fdb', - 'nginx-fpm-php-8.1-debug': 'sha256:ae05a5bb3b0753c5cd684440812a4adebd52b32b6ea3106645fa5c5619847152', - 'apache2-mod-php-7.0-release': 'sha256:665f96b92febda98fc6290ed033b75fa699f075e87d764401735f9cea4305279', - 'php-7.1-release': 'sha256:09eeb2ad0350cd965a6cf1323f06a4ae26b3136967f9d6f211fa49ca5cd66fb6', - 'apache2-mod-php-8.4-release-zts': 'sha256:4ed6065fa3c565ec778fb3c6d3c0ebda7a54666a28f148698b7873f6154577cb', - 'php-8.4-release': 'sha256:947957777b616b3d0a8615b544521bb5e39456dd490d5fd9edc99f420ff13c4c', - 'apache2-mod-php-8.3-release-zts': 'sha256:654030bad096cff9c42e55e4d075e7aa594d97532f233e841db1e2e70d2a931a', - 'php-7.2-debug': 'sha256:4c5f111f8e84fcb7dcc9e3cc13e1277d0702b04cd33286ce33db885485d1f025', - 'apache2-mod-php-8.3-release': 'sha256:73a1a50b75f375131ee7c014135de2dc0dc7198554e14572f0a638e25ad870b1', - 'apache2-mod-php-7.1-release': 'sha256:f280f205789672705c27992e8deeaa50b7cab360ca2344193e8c75b8de6503b6', - 'apache2-fpm-php-7.1-release': 'sha256:e1a0599c9115e90bcdc425492dea2f02899943e634c2a5cfc58670e637130f50', - 'php-7.2-release': 'sha256:56dfed8eaa569e47452d1d9918889fd619c76ecdaf95e42f6bdefcaac4e9d437', - 'toolchain': 'sha256:20ddcdfa1da2e8cfa87b94425139b55e67e55910d219f6dedfc8808d142e6eaa', - 'nginx-fpm-php-8.1-release': 'sha256:1a44076b45fd4b344f1fee89a153c2561a3a5b95f40cb2e21eee45b9ca37317f', - 'php-8.3-debug': 'sha256:bb6df08160126374d3d9247428928aa19a9c2b2429c98356650199b85ae20212', - 'nginx-fpm-php-7.3-debug': 'sha256:eaec39c95b95bfbb24e08365622573fe377a8564ad8a06b636089d3c909a27ff', - 'apache2-mod-php-7.3-debug': 'sha256:14010c4b223a2c05f03acffd213cc26344f772b6364a45ec40e4a04c46809279', - 'apache2-fpm-php-7.3-debug': 'sha256:d678b10dc0e3d918587adfe0681fa521ee2b49d1f592702e4806d9b7a1c4a141', - 'apache2-mod-php-8.2-release': 'sha256:ebeaef9bedb7a7945286220129d0641481a7dd4aeb9602729cccd1b1f081a29e', - 'apache2-mod-php-8.1-debug': 'sha256:380f13cee2c09677a48132050c26015f55ade1c89b9a396eedc7d80d60a83858', - 'nginx-fpm-php-7.0-release': 'sha256:8c5ed03fe19bf0122aaeabdffb985181893af879d0009db0bef331fcd5db99a3', - 'php-7.4-debug': 'sha256:b8a9e982179189122d73feb896c1a1e8578a92fc9a023dabc825f45db8299c22', - 'php-8.3-release': 'sha256:47e8c84898a8129dcec1c93b329e05cc51d5c2ea1dfe0c383a8ecbbbd1555190', - 'nginx-fpm-php-8.2-debug': 'sha256:d2e922fd8b8d33f30a05dde0362225706e0fb621a8191f2713d7f5774343b757', - 'apache2-fpm-php-7.4-debug': 'sha256:78dda825ba7c29ed5f3fb8555bc096ad10cfc67a88d765284cdfbc89d0ae6d05', - 'php-8.2-debug': 'sha256:52ad14560672fc8c5130f5758bbee3fa401bc1d35b412f4a230c6258143291a5', - 'nginx-fpm-php-7.4-debug': 'sha256:46a0f429f9b91e4a93f382cdadd2ebe3c4797d355e095f769d839061d68e316c', - 'nginx-fpm-php-7.4-release': 'sha256:f921303421890714e67a9b3586471a9868ad35dd0086980ba5f08eb1e62a54a3', - 'apache2-fpm-php-8.3-release': 'sha256:fc791e96abc113beafccd411ecec882e5b25fa658f264433f5f511d323fadff8', - 'apache2-fpm-php-8.2-debug': 'sha256:580f5b205a7dc752e511ed5c448c6cb8abc6f4b55e554d497524d77a8d4d637f', - 'apache2-fpm-php-8.0-debug': 'sha256:619297f44a95859279672aeeb054c015391b94113e55362632dbee578909417d', - 'php-8.1-debug': 'sha256:1a1e5b44cf043e59768c65fd7c94aaefdacde5fa96d83102d35db11ad86f24c6', - 'apache2-fpm-php-7.2-release': 'sha256:b6ff99e6ecb632f9ab914f0366781d9203f814f9fcd994f1cca11c490237229b', - 'apache2-mod-php-7.2-release': 'sha256:b2d4c60b1290030def79d077a3229f0cb112f2b3f114fb110b0888df072aae73', - 'php-8.4-debug': 'sha256:15045688f6986f4625b1507a7f4be6104e7bbb88caf877f1611463b929f2bca2', - 'nginx-fpm-php-8.0-release': 'sha256:be7506249f270259e041e1f4f03386c74c0f71e6b1ddd5c3e4dda09e251a02b5', - 'apache2-fpm-php-8.3-debug': 'sha256:d4bf1720bfccd503b470ad58b78282d0fea360b6d2010e8fb2256e9f3705b0d2', - 'apache2-mod-php-7.4-release-zts': 'sha256:1d10765bcbf1d2e48cf14e5b8ac53f5f02ff89d34befe41490277805b16d83c8', - 'php-7.3-release': 'sha256:90222b164254e71896fdbc7d99e4b35c187f8a063e119d5f992027062ecd4852', - 'nginx-fpm-php-8.0-debug': 'sha256:5ad63d2c693bb849201e3675cadbe0ac33515808ad0be5052d9425d689af3465', - 'frankenphp-8.4-release-zts': 'sha256:554c7f7ffdb94fb47ba3388dcf8ea44f225549210f4a7a8bed088fc24cea431d', - 'nginx-fpm-php-8.4-release': 'sha256:9475ea59ddd091eb91b8cfa2200b883bf4e20a6a432a4655fe5b86b74b999f38', - 'apache2-mod-php-7.2-release-zts': 'sha256:0a2828f62f68001211195caf39b2111d36f1af8621796276b226e359d84020cf', - 'nginx-fpm-php-8.3-debug': 'sha256:2ad9efb823472ec780ac3ff2b8145df389712a056b1db286231765ffc0a986c6', - 'php-7.3-debug': 'sha256:efa81f79783097478a434578226fe9a3b8fe84abda33168034aaea60c197c73b', - 'apache2-mod-php-7.3-release-zts': 'sha256:1f839e9141ccc9bd9df62ae4b26a466e91e9fe6f51c57035e408cf959db3d898', - 'apache2-fpm-php-8.2-release': 'sha256:09de5f888a9a6fe435d16804a92a1566bb120a7ef6cb8414583d2ea737b2290b', - 'nginx-fpm-php-7.4-release-zts': 'sha256:040e014ecaba8c0b5a1f132732161586b7ba76a92a230fc856e99091f05f5077', - 'apache2-mod-php-7.1-debug': 'sha256:ce4b8cbb0ed829ffb56ab1436d09dbfdf0ef529b9e202f7aefdcef0c7ce21676', - 'apache2-mod-php-8.1-release': 'sha256:627058ded40e5573110d81a086926a92516867339c3478cd9bf698b5fc5093a1', - 'nginx-fpm-php-7.2-release-zts': 'sha256:40b1171928cb1a8be69c3f571d6bdd57ab22f8ef6cf88fe34e3c68971fdd4ad9', - 'nginx-fpm-php-7.1-release-zts': 'sha256:eb5e55128f9e91e93a9d4cd918777eceb163a88343db1d2679b73e0463769ce4', - 'nginx-fpm-php-7.0-release-zts': 'sha256:e2ae077387dc8af90ea4722df2558cbc90a76f04c01b65ed064151493e56ef81', - 'php-deps': 'sha256:b9601fa1937c745403f65a0f4919acf3883b812b843c0b7cd8e0ae817f217a52', - 'nginx-fpm-php-7.1-release': 'sha256:e7e42bb9410aee145bae2827a4d242e17dcd692ec8a4486bc5712788c4b3005c', - 'nginx-fpm-php-7.2-debug': 'sha256:20e284b3936a45547a60d7090d40aa1e57caea85fbc8ada666a97a959a863a0b', - 'apache2-mod-php-7.4-debug': 'sha256:2b76e1949737fd52ebea0227099b5a6821ea675008ea9091d8d8274ab8c47873', - 'php-8.2-release': 'sha256:21c07181c9cfef62c44f7530d79d8dd40650e62e676562f4e9d44f06dfcaa1b0', - 'apache2-mod-php-8.2-debug': 'sha256:18b0a514c809b1071f2ae1907b483428c479a3648116a73918f3f09b8b7c097c', - 'apache2-fpm-php-7.2-debug': 'sha256:ef4e471c80b845c89a1096ff442d7564806dd765bdc8b8aa66f4bb42446611e6', - 'nginx-fpm-php-7.3-release-zts': 'sha256:9f4a4640abcdac91e531c0958b9072319c64d05cf9e856e8f3a7025bf19a757e', - 'apache2-fpm-php-7.3-release': 'sha256:70711b04c38817b2b18c8365e7931bc4cebb7684dd619a744f5fcf492ea7f789', - 'php-7.1-debug': 'sha256:500007ad057d9e71b2bb9079a2f8ba3f1ecfbb26d112db69e17d6007b4e857b5', - 'apache2-mod-php-7.3-release': 'sha256:adba5678c350db9e4526da1ba96cadcc4def69caec64678bf070aabe5a081b85', - 'apache2-fpm-php-7.0-debug': 'sha256:389aca25e18e63a16c39481d905087b0c091011aebc4729f086adf6a5320035a', - 'apache2-mod-php-7.0-debug': 'sha256:067f016d0e2ee35f890a613019f84063ce4af1f0b533411dca5a67579d2cf06e', - 'apache2-fpm-php-8.3-release-zts': 'sha256:c74a06ebc208326840634e26538ad890a2502ece5a936109cbbdf1691f1b812e', - 'apache2-fpm-php-8.4-release-zts': 'sha256:6b12b3cd013162de5e8aa1d7650c9f8741ccf294b7a1dbfba1b48e375b733940', - 'apache2-fpm-php-8.2-release-zts': 'sha256:73999668dd180a304808f3ce3bcdc99c8d6adca143dab965576364f7430caacd', - 'php-7.4-release': 'sha256:8391f2193354f1f6bd63cb8c636139f4a22861b0c341afd940ae6820243ff718', - 'nginx-fpm-php-7.0-debug': 'sha256:df8842cfa506cbd2c86b38b55cb60ce5fbae5266a117cf9d382be5ac2812bcdd', - 'apache2-fpm-php-8.0-release-zts': 'sha256:f62d1745dd6756598d99a9f515ea5067bdad213f391826289ca53deee495547f', - 'apache2-fpm-php-8.1-release-zts': 'sha256:c783107ca73afabd25b57573310fbc817d836e6217efcc54b9a45ca3a3c0575b', - 'nginx-fpm-php-8.3-release': 'sha256:5a5d1031dcc93ff440677361bdd26fbc845d1b855de195346e742dff4c58ebcb', - 'apache2-fpm-php-7.1-debug': 'sha256:a127a0229c234f2c814c4e8c8640842124696fb4d54e926ae268e80fbadfd005', - 'apache2-fpm-php-8.1-release': 'sha256:09ed8c114fdbb9ea60ab249ebcb9827d0c40213e7aa7b1bb9fbc352202413203', - 'apache2-mod-php-7.1-release-zts': 'sha256:d4d8c0d950330bd3c6a6225857aec8eae6989fe38409bccf96d87c480cd7bedb', - 'apache2-mod-php-8.0-release': 'sha256:13bfc3bdcf6becf4916e4059faae71e8377cc707d1eda28f2d91025183eff276', - 'apache2-fpm-php-7.4-release-zts': 'sha256:05bb8279c9d7dde3a23ad24f982e82e4f348b63867e00abac2eef0bc81bc1697', - 'apache2-fpm-php-7.3-release-zts': 'sha256:26c45f5c73a972993d4ae94d420af274aa07856953da725bea8986a024d97434', - 'apache2-mod-php-7.0-release-zts': 'sha256:12c06f6d770c046d497cdc823332ad9514b6d7f10232d92c7c64c978d088ee0e', - 'php-8.1-release': 'sha256:20aa4acfb0d5ef3e16614c39daecf0c2df6068af46a592456e24884be73a59be', - 'php-7.0-debug': 'sha256:0a9aaeaf79bd4c578eac6dedabf6ac131537266f44562158ce67fdb37c794916', - 'apache2-fpm-php-7.0-release-zts': 'sha256:3a6d6d8fdadb6347131c0183aaf41a9a09da1632092ec702e555b2ab609ce3d0', - 'php-7.4-release-zts': 'sha256:6492e3334e722b106352180ec9f0cbee8dd81f008e3537d03f4b8da3522f49e1', - 'php-7.3-release-zts': 'sha256:c713df299596a9615f88cfe73c29b0a1f9faf32e5e6fa62fa07ee839313cd57e', - 'apache2-fpm-php-7.1-release-zts': 'sha256:ca2e04104d67272cf819f34525c5692192b7836c786b3dcda072f0c49d5abb59', - 'nginx-fpm-php-7.2-release': 'sha256:daa158286c8df095c61926441a7c3da75994533fa375882aad6e492c90f89c55', - 'apache2-fpm-php-7.2-release-zts': 'sha256:cd0f9ba39a4a8e3b3a5e6eef17f8094bddcdb2aae407b6bb15ec0d68645a17fd', - 'nginx-fpm-php-7.1-debug': 'sha256:26aa364fcd7fc7f9396962eda65058664bd83003e8ee272562baef2362d443f4', - 'php-7.2-release-zts': 'sha256:634b857d74c3d77b88986ceb088be2dd5bc30151bc08c2b536443984e6659d6e', - 'apache2-mod-php-8.4-debug': 'sha256:d172da243f1ebec74646fdbea7ab3e7a882e056b31942f7e5ad7560ef8e62359', - 'php-7.0-release-zts': 'sha256:4bb5fac6fbd3124234d062328c68f6c51027aa95f13e4e8b14afd7c8de518ec6', - 'apache2-mod-php-8.4-release': 'sha256:79c2d7dd843b18ce2c5f929e6300e9a1f64a5e00a7edbaeb9f75d8a60b2be3d2', - 'php-7.0-release': 'sha256:627c4f460fa1c11f3f5da44d9361eba5de9f38134189ca05b3bfdb9979011e44', - 'php-7.1-release-zts': 'sha256:d997b9f99c28967872bd0949f8572b089daaadb6ceaa1e856ccc76e07e2ba6b7', - 'php-8.5-release': 'sha256:2d3f721958476ac0837ae016d77a1fc796e48e0384e62721a6924c2fab204a82', - 'php-8.5-release-zts': 'sha256:b2096ab1477c3d90a53e62112774c525324ab2debc1cbfecc2cdd4c0a3599dc3', - 'php-8.5-debug': 'sha256:61a6a0d0fba6ad51dc39b3c8669e33498f78350e539a1ff7594d6a01e7ebdd0d', - 'apache2-fpm-php-8.5-release-zts': 'sha256:3434bfc2dee477bbf34c454b8b1fbb92a5dbdac7fc543e5d7a8714907493dea6', - 'apache2-fpm-php-8.5-release': 'sha256:f9e18353afcad74db9f56b4e46a8ffe9d628ac12f6fd491f525626d0e25429cb', - 'apache2-fpm-php-8.5-debug': 'sha256:86c7f37cb46200dbc73c6863a2255de7ed88fd01177cbaef69fa206719ba904c', - 'apache2-mod-php-8.5-release-zts': 'sha256:3b5132226a4f07628161f5a7a784b46426004c799f6a9e03d5397490b479d639', - 'apache2-mod-php-8.5-release': 'sha256:f6b156aaed21db2870cf1d452de1f0811d221b4ef250c777fecf2e96f6c9a161', - 'apache2-mod-php-8.5-debug': 'sha256:1ce0570b1e8fba34db0e4ec0f18134fb30c1d50ba795b6f42f0cbe3f19c7a68f', - 'nginx-fpm-php-8.5-release-zts': 'sha256:527f2ba273685ff7e3f72a74076fd6d99cbc87d51fb3485fef4dc80a0cfddeee', - 'nginx-fpm-php-8.5-release': 'sha256:fc2eea1ed06dfcf8102bdbfb2596f9a32bbe6493ca83d53370e1438289caa6aa', - 'nginx-fpm-php-8.5-debug': 'sha256:915d0155897e4f42cf1867b93edbb928afcc1c5b3bd3eccdb2d56ac50510cd82', - 'nginx-fpm-php-8.5-release-musl': 'sha256:a1ef09c1bf398049b340ab2a1c40839d828420df5a404831bb7b33a09d433755', + 'apache2-mod-php-8.0-release-zts': 'sha256:c63c903d32f9d4d13333fef94a09272825e97d1b9c0a680785a343803b9146fb', + 'apache2-mod-php-8.1-release-zts': 'sha256:df59e70404776f49dcc5ccdf120040c7af59715990c3fef6fef216d15d0af1fa', + 'apache2-mod-php-8.0-debug': 'sha256:d497d82298612b040c5ab9e3f85d1458ca7065d5fdda19e161691e424f3a2356', + 'apache2-mod-php-8.2-release-zts': 'sha256:94d85b00fa1f367b3ddf52accb8445ecf87cafc88d875d0f7004e07387585420', + 'apache2-mod-php-7.2-debug': 'sha256:042ec74fec68650fd599a5158320a8a9d09db1efd694010b6ddb239125e46ee8', + 'php-8.0-release-zts': 'sha256:93a3d95e843dc14a7c27755bd0c44754f668408ab1e7f5a70de7ce0f1542b920', + 'apache2-fpm-php-7.0-release': 'sha256:d685418801548ff3eadc3fabd55e4380c2297ea0b888f22f8a380ab16d16aec4', + 'nginx-fpm-php-8.1-release-zts': 'sha256:d334e70e6ff8c8ca891a7c1b5e275b0f5833575105e03512da8a2af4dd4d3c87', + 'php-8.5-release-zts': 'sha256:6285062325a4f55efaa76c5859d7c44ff75ce252093d3450030d6c598389e19c', + 'nginx-fpm-php-8.0-release-zts': 'sha256:edbb114900c00df737d6d4947f0d257ea4757d035888f2b211985e1ebb8632d9', + 'nginx-fpm-php-8.2-release': 'sha256:e1164329e80ed47ccf9e17df972dec569e027bb72da5d9f53dbe341f1ccfa89a', + 'php-8.4-release-zts': 'sha256:ec4ec4eaa7ce26da8705ba2fcfa2df39704bd8a83fa13173ee5c683b626b3ae9', + 'nginx-fpm-php-8.2-release-zts': 'sha256:c0c521ad7386913d7e0c39b977adce03006df0cdf6659fe253487239882213f5', + 'php-8.0-release': 'sha256:f6c7557c63d9da34d081bc681768798bc4f70d8be36c565c526e57cecd6c2249', + 'nginx-fpm-php-8.3-release-zts': 'sha256:1fbcce3b1a3c10b060141c14f1adf9c208a693d7012b10d44eabbcc69f1372fb', + 'php-8.2-release-zts': 'sha256:668613168e7d1d3b3895bc655d2871519e590ea5095efde48346c7eb8a305240', + 'php-8.3-release-zts': 'sha256:0f3717c52618fac31d69058be641a216622560d0f3ffa4d87ba195c112b4f939', + 'nginx-fpm-php-8.5-release-zts': 'sha256:1c72409eb4cfa7ee2722a6029d1e99570884d7a167f9ac9f835e8d951f5dc657', + 'php-8.1-release-zts': 'sha256:f6bae994704c0bdabd8906dfc1ef2843ee9a724002a8bbf8475a93591e7c0a56', + 'apache2-mod-php-8.3-debug': 'sha256:014a173295d6b7ecde224a23a06daae8d9e8b7c729a2f254b427de0f85d33800', + 'apache2-fpm-php-7.4-release': 'sha256:f95cb84e6f881db48cd8d3a108d5ca39aeac906c515eb44b02bd4f0d7dce4c5c', + 'apache2-mod-php-7.4-release': 'sha256:492b03fbbeb022e3a0f71a7b9c1c9c31b348d2085d8e7d525ad339f602ec3df1', + 'nginx-fpm-php-8.4-release-zts': 'sha256:12050bfecaff2934de98bb54b81d2efe2237fe6c7f1601c7dacaa0f34b93497a', + 'php-8.0-debug': 'sha256:c3ef955a68417284dcb5b08c14b05c2102f3e1273ad88bc6885da0207cf56837', + 'nginx-fpm-php-8.4-debug': 'sha256:f6766a758828e9779a1456a1f6f5b8a2329cecab8d9132b5d902b0427e0ef131', + 'apache2-fpm-php-8.1-debug': 'sha256:535dc70e8fbaacd8b65a405aa5046c7d799567a4071122aed6340580ff753050', + 'apache2-fpm-php-8.4-release': 'sha256:2790e7717c16f4636e8359f1a6dce67517592fdd879374f1f91bb989f7b890b9', + 'apache2-fpm-php-8.0-release': 'sha256:b4fe65a8ea7701f0f1c550da1cb6bbc0d48084dcc29a85b805521e46c8575365', + 'apache2-fpm-php-8.4-debug': 'sha256:c9bf37a838480999bdc4d31b624ec10a44ba5a77ff512e877bace0df82b70325', + 'nginx-fpm-php-7.3-release': 'sha256:6d742d87c59309eb726bc8069292c32ddb2a2a8e3dda09fe9075c49f13f57f4a', + 'nginx-fpm-php-8.1-debug': 'sha256:a4785f4b92fbd463cb05cadfc9b75e3a462a62f2052d87159f723637ff8b0aed', + 'apache2-mod-php-7.0-release': 'sha256:3aa3666fe0e1380d7f985e29b889567d653d8ec8f6b1b801665f7c6c68d6f069', + 'php-7.1-release': 'sha256:d52f126a9101785afe08aeb8af45ebc9393f6007fa9ad20f847fceb4dfe00ef6', + 'php-8.4-release': 'sha256:8dd60fd881701c66853820ca7bbbfa5554a91a6007c372444d3203f30d7eae4f', + 'apache2-mod-php-8.4-release-zts': 'sha256:d0974677d0f1e12dc59a217a07045afd9649bdc42e680df7d6f7c718ad07c9ed', + 'nginx-fpm-php-8.5-release-musl': 'sha256:0ab409dfc415b0c035414b89efdb34218faa1850e99ad3fcf7b52bd5fc042e0c', + 'apache2-mod-php-8.3-release-zts': 'sha256:0ddb8cdc827b9a3dc271a35712346c66ab5a70aa34ae4f2fdf73e3632d0fd1f0', + 'apache2-mod-php-8.5-release-zts': 'sha256:33aa76b5ee683d9eb3a1c199b01f3dc998671c0d27ea465ac67943ccda0ad017', + 'php-7.2-debug': 'sha256:b809a751f79a4a5b8dedaa57b08c1e9ad407805732f67609a015370867691b79', + 'apache2-mod-php-8.3-release': 'sha256:c53c867125a3e6af9a130d51443c4a0c77b9be2decc0a9344947ca6159e5bd04', + 'apache2-mod-php-7.1-release': 'sha256:54c3dc2e8401f980dacde153088e1082802fe4cb78575d71b2ddad903a705244', + 'apache2-fpm-php-7.1-release': 'sha256:0bd711fa4a12f6a650cb12c50dd594bc758b9caf69130c1ebde9f2da078590dd', + 'php-7.2-release': 'sha256:f99142253171e747c2759e243c6d4301d07d20133c539602e8734ff5ab4bce92', + 'toolchain': 'sha256:13429a447c9fa042f86a076ece568db7a240a0a1c63020dd34fc557a88040052', + 'nginx-fpm-php-8.1-release': 'sha256:bec0683f16dd81058bbd12d4ca893e4da8aa39b461a660c1c63386c89c872aab', + 'php-8.3-debug': 'sha256:421a5f36ee55c1f3b3937feea7083420d5768f47dec40d4561e00a7c7533c6b7', + 'nginx-fpm-php-7.3-debug': 'sha256:fc54b97cdd31239d28deb7f7b6f9c64e50922688c698335dc13a36831db62919', + 'apache2-mod-php-7.3-debug': 'sha256:b4951eb923ceac249c9dd41de2276f1c1473cecd7e895800623abfcd03e4ef03', + 'apache2-fpm-php-7.3-debug': 'sha256:1b19a626c049181d9322e9b62f0b1c6f6cc7038e94513e76d761749483f4c486', + 'apache2-mod-php-8.2-release': 'sha256:d748644e7978fa1907586c7d245c70a940df15a72e6e210f905e014b214c2026', + 'apache2-mod-php-8.1-debug': 'sha256:bc6d996b8585812b0b111c3351393e4929b5102de7d534ef8ab7de02edd49561', + 'nginx-fpm-php-8.5-release': 'sha256:a442e42bd3fc1a65f75124d77e94551d9ff1ce5f04f9e63d0931c7448958a300', + 'nginx-fpm-php-7.0-release': 'sha256:df1f49bf891042b89714c564e9ace325956c84621f1bb43a1ab4538f951b6017', + 'php-7.4-debug': 'sha256:70a2498d427dcd36b03eaa00d5ea73e95d67ace3385dcd76432be7a9e023dc2c', + 'php-8.3-release': 'sha256:2652449cecb073c780a38a11b6bf9a190851f704c5fb5b1058c898cda5cd6c25', + 'nginx-fpm-php-8.2-debug': 'sha256:02e90d98c06de3c43d139659b26d5cc37b3d7a6ace84f8efc57b03796489fd77', + 'apache2-fpm-php-7.4-debug': 'sha256:2f9fd1c9db1293a246ea9e2b1936fcb98f262448da96957357241c6b8d9b6895', + 'php-8.2-debug': 'sha256:61c6f4db9e8aab44a6571095aa363f28578064f5b627a09129aeffe32ab0864c', + 'nginx-fpm-php-7.4-release': 'sha256:ce1f20e94b691515eb473b69bf423ef012857d54e03e9f6e33cf8266ffcb8d34', + 'nginx-fpm-php-7.4-debug': 'sha256:9bcfe446e5769361c5106d1259195b0a958069eab1dc9dd9f40fb17efb98b123', + 'apache2-fpm-php-8.3-release': 'sha256:51a4c2dc5c9435f597cb4a042c67d22219e6517603b7febaeb079c6dd7d31a4f', + 'apache2-fpm-php-8.2-debug': 'sha256:2a9fc1240d389bf2e43a888a6dd93476ba5dc4dad75c5c3c8c4012ee4ab758d6', + 'apache2-fpm-php-8.0-debug': 'sha256:285ada20f496d3ac8bc6288254c6d5f3cdeaaa98a51aebbe69736ffe28c101fa', + 'php-8.1-debug': 'sha256:11bca87c7b9391b26933541c1d3ede5d91eea531e2ae89e7267573c5cba15037', + 'apache2-fpm-php-7.2-release': 'sha256:4b84d841ea820e2ce06ef2a3ee2bf0cd74ec87786feb54d85dcb81ddc5175015', + 'apache2-mod-php-7.2-release': 'sha256:def47c631f7f5ce9c1b436445149bfa586b7c9ded9b290f9fc3f4660fadddde4', + 'php-8.4-debug': 'sha256:c1ff0c7860d0923ea000ec1b4726277fc1bcce6b4942a7f0d636d7e6dfd23d40', + 'nginx-fpm-php-8.0-release': 'sha256:7c46bc623af1fc631ac5e67f26cd4a100faf39177862c8823b164c63ad9f510b', + 'apache2-fpm-php-8.3-debug': 'sha256:cecb69dd0cb1011b6295d55142f1eb421c961fe7f4bcfd5a8e0801a18e396b4f', + 'apache2-mod-php-7.4-release-zts': 'sha256:aa21db9d5eb27ee2fd8e187dd572074105d1f927cdca56d2e253569a5c210e79', + 'php-7.3-release': 'sha256:5f2b03a07e0272f5bccb9c57bc0bb780e49d9a0daf72499f9b32e4a2bfc2e467', + 'nginx-fpm-php-8.0-debug': 'sha256:d775c9cc49c04bec246eba8273a5cc1159282dd537468e4148aacae1d3e0fccc', + 'frankenphp-8.4-release-zts': 'sha256:497b1f786a902141ea35f9297909d3226ab3bd2fccace9af545093e9160e1526', + 'nginx-fpm-php-8.4-release': 'sha256:dabb50940ee3449d0244d5b6eae5b080d5065dde1ebe58119741d443ac8078bd', + 'nginx-fpm-php-8.3-debug': 'sha256:f536c26ceadff7759b2feb6433eff971e8959e5f193cc1063d1355cd9fc425de', + 'apache2-mod-php-7.2-release-zts': 'sha256:61ce4e813383289647249334a4f0bdb880a62d127eeedec9580cd0e4bdee9dae', + 'php-7.3-debug': 'sha256:43bef965a47a225221a4a2720809c0e589db4de081d9866699ae893ac01f9d09', + 'apache2-mod-php-7.3-release-zts': 'sha256:624948bcb9ec671fe150281c151ffbd44f7cb19d30a247ce8469f2dfdbf26087', + 'apache2-fpm-php-8.2-release': 'sha256:577529988acf977e8c64492bfa60c9d80ca5b9fa008164dcfa016d3d75023f79', + 'nginx-fpm-php-7.4-release-zts': 'sha256:b8b41a5c8d18651ddbd96979b5a350caf00e0bb652d4d5454a4faa55d03724a3', + 'apache2-mod-php-7.1-debug': 'sha256:de03b3d589570e649d88ee52de920b82ccf4de537a5f792b19c4fa0ab62da989', + 'nginx-fpm-php-7.2-release-zts': 'sha256:63d2b86e2a8190b1edd7850dcb489a76b9b7ee8b00ec2b4504153b23b0eceaee', + 'apache2-mod-php-8.1-release': 'sha256:eb7817c04c42baaf17f87641f655b03ac13263e58ca388f6672e932ede4cdc5b', + 'nginx-fpm-php-7.1-release-zts': 'sha256:c8c6edddf69729437be27d4e94559bcbd6f860e3e398552d628a5e92c8795f6e', + 'nginx-fpm-php-7.0-release-zts': 'sha256:bab423024b502c85a27995bac9b59420c8d7317f7c7910eee3d1ea7da71e3a14', + 'apache2-mod-php-8.5-release': 'sha256:60b1d07ec071793a0904a3b7898e45ca6dfddf933f360291bd64cb23929ca3cd', + 'php-deps': 'sha256:b8fdc9f7d169c15301f63e57d9f3f59e856343a371bd5a1053a9375a4e1ca5df', + 'nginx-fpm-php-7.1-release': 'sha256:57ed7ee61104d9ec322d92f1d9a0ef49502b303ba1380cc64e145053edcdd8f3', + 'nginx-fpm-php-7.2-debug': 'sha256:ad8cd02fbbb2ab4e284f03d9d296c3e0081336fa0366afb281a0cb7a5b826dad', + 'php-8.2-release': 'sha256:0199e251729b25276f97049cbcd39dd1997e98413a07b10a3c7e9e755d505a42', + 'apache2-mod-php-7.4-debug': 'sha256:e2c52ca16a8ede260ecef564d41d7c312e42fb7c35787de92d89e7d140b1cf67', + 'apache2-mod-php-8.2-debug': 'sha256:fe5ff47714a06c391a78f3b8429b03372dd5860020934e1beae2906167cff650', + 'apache2-fpm-php-7.2-debug': 'sha256:cad31d8b57102b81c9588a4f24dc170d2462e2e6f8e47612abd7c509edc6772c', + 'nginx-fpm-php-7.3-release-zts': 'sha256:db915c42d757ce6348d87da4eaf72ec106f591569be8fee04e0b78c25c9a578e', + 'apache2-fpm-php-7.3-release': 'sha256:c453dc5052aec33c790c6b9777f6d507e464e6c88786f4fbae2a20f683b24fbf', + 'php-7.1-debug': 'sha256:2acfe53ccedf9984d25293b3a4788fbbcacdf819915d69c53f1dc6bad40ba864', + 'apache2-mod-php-7.3-release': 'sha256:daed732e434a02035e223ba423b51d66ec67690513f899ec5c86e40a7b62af51', + 'apache2-fpm-php-7.0-debug': 'sha256:bf41c2c81931d81dcf1e3bbe762ca81a3331c2b6cc38635639d0519e38a3727f', + 'nginx-fpm-php-8.5-debug': 'sha256:7dfbeb5ddb62cb1cbcb6d75373eb5662a534da5b7c067b53426201047b6b7d15', + 'apache2-mod-php-7.0-debug': 'sha256:74049cb549aedc9103ca6832b69afe7bbb9536320fc98245b5ffbabeae02ba96', + 'apache2-mod-php-8.5-debug': 'sha256:c461996eaff3ce3e296ddbfdbefbc1bddd81439b24d3699b5a7f3344bfad1da1', + 'apache2-fpm-php-8.5-debug': 'sha256:abe529d92654d0712526b4f60a77964582559a18728604d79726c7a815057d71', + 'apache2-fpm-php-8.5-release-zts': 'sha256:d6ee244a11431eccce5b20d88849f30ed866ac4f6192c3be41b128c31d447675', + 'apache2-fpm-php-8.3-release-zts': 'sha256:be50109cefa6468e2d939b22c5a9468b28b570f3470bd502240085a89a2819c7', + 'apache2-fpm-php-8.2-release-zts': 'sha256:9faba6f49dd5bcac33d81814e5e62131ebe1efed0fd2ca537b6306c02b89cc12', + 'apache2-fpm-php-8.4-release-zts': 'sha256:fabebf5f234bdac72cda9bf061fe6bb2689cfdba6976c528271f182e99d194e2', + 'php-7.4-release': 'sha256:6d073fea82095decf37458d238b763a8df26688ffe8ad8017c8f7d8d7e588931', + 'nginx-fpm-php-7.0-debug': 'sha256:9192d5bd27a9a023cd644c9f7413f35327500232cc1b75cd8ed66efbe3266044', + 'apache2-fpm-php-8.0-release-zts': 'sha256:bdb859af20f596e53b96b805a3471e2f7883264c75dd432adc3492ed40628959', + 'nginx-fpm-php-8.3-release': 'sha256:6dc2fae96359b927c8b04ff5e1b31a5fdcc85fbfb7c234e374bdab347e9e3f94', + 'apache2-fpm-php-8.1-release-zts': 'sha256:a2fd874506abaa5e286ce2ab47124a1bce4e1df76d404256fbb48d024ba5b1b6', + 'apache2-fpm-php-7.1-debug': 'sha256:e8b1f333504620ebcd3fa9d66d95ba480796644a778686731ad021e364a89b0f', + 'apache2-fpm-php-8.1-release': 'sha256:7f7849bd0c60b3303dfda144d275b3ed0a0a41528e4eb06bd5990b04d552c205', + 'apache2-mod-php-8.0-release': 'sha256:2e7442b1e571ac14b41021b751a6f0580eae25067b165feb42e2cdbc12bd964b', + 'apache2-mod-php-7.1-release-zts': 'sha256:e774faad6c4cb0ace56e4b5e3f6eb1babf1dc810674658722d9dce0d0149815a', + 'apache2-fpm-php-7.4-release-zts': 'sha256:58e6a775d06e46899c6f3cd76275fa50f0099865acd3474d0b0542753aa0b389', + 'apache2-fpm-php-7.3-release-zts': 'sha256:95dfd5b007bd025252f7d93d77ecda720738d8f377a85a10dac2026409a29c04', + 'apache2-fpm-php-8.5-release': 'sha256:52cd6c2a5a7266e74f55c1e3c2f21f30caa02b496618926e2f11a73abad0cded', + 'apache2-mod-php-7.0-release-zts': 'sha256:ad63a984521e51c587c240728a1d4a6a808911d54900f4b95424d63137090aea', + 'php-8.1-release': 'sha256:cce133e903895e3eb9223cd15f705cfde50cba62165fe4acc8ea7231883c13b8', + 'php-7.0-debug': 'sha256:42a2d76a8507208f27c1860c0ad280cb825e61f130ba5af462989ea065fce007', + 'apache2-fpm-php-7.0-release-zts': 'sha256:b6524092e1d603f73d3ba725b825db1e5e8a9c6dbbf1033a52a6aac762759c1c', + 'php-7.3-release-zts': 'sha256:ac6923e62f7dc9ba46c1045c3c63acb4ebfb8d2945639e954c3f350aa2fddada', + 'php-7.4-release-zts': 'sha256:ce0f6f7b6683d64826135bc1c52d1a0a412e506627bf9245d7896ca283247528', + 'apache2-fpm-php-7.1-release-zts': 'sha256:f94515ad517d90daacde76d133e097f48cf3e6cb386b64e66ed6c85c8e62101b', + 'nginx-fpm-php-7.2-release': 'sha256:09ecf5f3db71b66c7a1d26d9b865f1de1b79c7166b16f48b992dd8cc2a3ff73a', + 'apache2-fpm-php-7.2-release-zts': 'sha256:1ed67a099859f464df86246c82e5b38b552b2af059a6519ed723d26153ed9006', + 'nginx-fpm-php-7.1-debug': 'sha256:914c9314a4de5aafd26f74061716be44753cd466bf143e3cf1e380972bfd9cf2', + 'php-7.2-release-zts': 'sha256:db53b9c2cc53fb38954eb4260cf1791d129a9f35efa2ea2655593e002300ea26', + 'apache2-mod-php-8.4-debug': 'sha256:59f59f18032b0a513447a9fcd0ae9982f6f889e6d78a5757baf73d55d2395500', + 'php-8.5-debug': 'sha256:10a60296e5900e60c0a04478ad5e3c603f3923f02f0a7ce61f207c68704cae26', + 'php-7.0-release-zts': 'sha256:d1e78bda9eaa59fddb59bf08ceb3a5362f184f2d22074e6913d52bacf563bc9a', + 'apache2-mod-php-8.4-release': 'sha256:197b5c7d1251fa669831392efa824fd8938f5a7c0acf9f83108e5791c7010932', + 'php-7.0-release': 'sha256:0262fe65291c8415e0792bf24e6ac6e01eac84de47e62ac6c4cc72342634a895', + 'php-8.5-release': 'sha256:d5d38441284b053c1667ef282b528802d7c437582a9ba77735a0286ca4951cc3', + 'php-7.1-release-zts': 'sha256:e3cefd4d4f8dfc7508a4db56e9fba18f9c63c928f79540fa0f2ecbe6ace70a03' ] diff --git a/appsec/tests/integration/src/docker/nginx-fpm-musl/Dockerfile b/appsec/tests/integration/src/docker/nginx-fpm-musl/Dockerfile index b43281b06fb..b82083c3196 100644 --- a/appsec/tests/integration/src/docker/nginx-fpm-musl/Dockerfile +++ b/appsec/tests/integration/src/docker/nginx-fpm-musl/Dockerfile @@ -18,7 +18,7 @@ ENV CARGO_HOME=/usr/local/cargo \ LIBCLANG_PATH=/usr/lib RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ - sh -s -- -y --default-toolchain 1.84.1 --no-modify-path && \ + sh -s -- -y --default-toolchain 1.87.0 --no-modify-path && \ chmod -R 777 /usr/local/cargo /usr/local/rustup && \ ln -sf /usr/local/cargo/bin/{cargo,rustc} /usr/local/bin/ && \ rustup toolchain install nightly-$(uname -m)-unknown-linux-musl && \ diff --git a/appsec/tests/integration/src/docker/php/Dockerfile-php-deps b/appsec/tests/integration/src/docker/php/Dockerfile-php-deps index ed62102399a..1c6b8f76869 100644 --- a/appsec/tests/integration/src/docker/php/Dockerfile-php-deps +++ b/appsec/tests/integration/src/docker/php/Dockerfile-php-deps @@ -22,8 +22,7 @@ RUN apt-get update && apt-get install -y \ ADD build_dev_php.sh /build/php/ RUN USER=root /build/php/build_dev_php.sh deps -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.84.1 -y \ +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.87.0 -y \ && /root/.cargo/bin/rustup component add llvm-tools-preview \ && chmod -R a+rX /root /root/.cargo /root/.rustup ENV PATH="/root/.cargo/bin:${PATH}" - diff --git a/appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/RemoteConfigTests.groovy b/appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/RemoteConfigTests.groovy index 2379d3b2df9..0f66f5620c6 100644 --- a/appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/RemoteConfigTests.groovy +++ b/appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/RemoteConfigTests.groovy @@ -48,6 +48,7 @@ class RemoteConfigTests { ExecResult res = CONTAINER.execInContainer( 'bash', '-c', '''sed -e '/appsec.enabled/d' -e '/appsec.rules=/d' /etc/php/php.ini > /etc/php/php-rc.ini; + sed -i 's/pm.max_children = .*/pm.max_children = 1/' /etc/php-fpm.d/www.conf; kill -9 `pgrep php-fpm`; export DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS=1 DD_ENV=; php-fpm -y /etc/php-fpm.conf -c /etc/php/php-rc.ini''') diff --git a/appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/TelemetryTests.groovy b/appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/TelemetryTests.groovy index 7e04e211ad3..b5c17618564 100644 --- a/appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/TelemetryTests.groovy +++ b/appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/TelemetryTests.groovy @@ -58,6 +58,7 @@ class TelemetryTests { org.testcontainers.containers.Container.ExecResult res = CONTAINER.execInContainer( 'bash', '-c', '''sed -e '/appsec.enabled/d' -e '/appsec.rules=/d' /etc/php/php.ini > /etc/php/php-rc.ini; + sed -i 's/pm.max_children = .*/pm.max_children = 1/' /etc/php-fpm.d/www.conf; kill -9 `pgrep php-fpm`; export DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS=1; php-fpm -y /etc/php-fpm.conf -c /etc/php/php-rc.ini''') diff --git a/appsec/third_party/CMakeLists.txt b/appsec/third_party/CMakeLists.txt index f09cfab64cf..0500f7d962a 100644 --- a/appsec/third_party/CMakeLists.txt +++ b/appsec/third_party/CMakeLists.txt @@ -76,7 +76,7 @@ endif() FetchContent_Declare( spdlog GIT_REPOSITORY https://github.com/gabime/spdlog.git - GIT_TAG 5fd32e1a70871e2f6a52734e36bc33cb7ac022a5) + GIT_TAG 79524ddd08a4ec981b7fea76afd08ee05f83755d) FetchContent_MakeAvailable(spdlog) set_target_properties(spdlog PROPERTIES POSITION_INDEPENDENT_CODE 1) diff --git a/appsec/third_party/libddwaf b/appsec/third_party/libddwaf index 2f4aa84cd61..3e1cb0f030b 160000 --- a/appsec/third_party/libddwaf +++ b/appsec/third_party/libddwaf @@ -1 +1 @@ -Subproject commit 2f4aa84cd61dc13229d1431779c007bf4ebda89c +Subproject commit 3e1cb0f030b1d9f8c696a06621116d452013133c diff --git a/docker-compose.yml b/docker-compose.yml index 1ae0b5f428b..5c8542a2b73 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -72,20 +72,19 @@ services: # --- Alpine --- '8.0-alpine': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.0_alpine' } # --- Bookworm --- - '7.0-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.0_bookworm-7' } - '7.1-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.1_bookworm-7' } - '7.2-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.2_bookworm-7' } - '7.3-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.3_bookworm-7' } - '7.4-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.4_bookworm-7' } - '7.4-bookworm-shared-ext': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.4-shared-ext-6' } - '8.0-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.0_bookworm-7' } - '8.0-bookworm-shared-ext': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.0-shared-ext-6' } - '8.1-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.1_bookworm-7' } - '8.2-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.2_bookworm-7' } - '8.3-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.3_bookworm-7' } - '8.4-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.4_bookworm-7' } - '8.5-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.5_bookworm-7' } - 'php-master-buster': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-master_buster' } + '7.0-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.0_bookworm-8' } + '7.1-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.1_bookworm-8' } + '7.2-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.2_bookworm-8' } + '7.3-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.3_bookworm-8' } + '7.4-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.4_bookworm-8' } + '7.4-bookworm-shared-ext': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.4-shared-ext-8' } + '8.0-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.0_bookworm-8' } + '8.0-bookworm-shared-ext': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.0-shared-ext-8' } + '8.1-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.1_bookworm-8' } + '8.2-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.2_bookworm-8' } + '8.3-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.3_bookworm-8' } + '8.4-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.4_bookworm-8' } + '8.5-bookworm': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-8.5_bookworm-8' } # --- CentOS 6 --- '7.0-centos7': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.0_centos-7' } '7.1-centos7': { <<: *linux_php_service, image: 'datadog/dd-trace-ci:php-7.1_centos-7' } diff --git a/dockerfiles/ci/alpine_compile_extension/base.Dockerfile b/dockerfiles/ci/alpine_compile_extension/base.Dockerfile index aff36105b8e..c879e2429b1 100644 --- a/dockerfiles/ci/alpine_compile_extension/base.Dockerfile +++ b/dockerfiles/ci/alpine_compile_extension/base.Dockerfile @@ -34,7 +34,7 @@ RUN set -eux; \ # Minimum: libclang. Nice-to-have: full toolchain including linker to play # with cross-language link-time optimization. Needs to match rustc -Vv's llvm # version. -RUN apk add --no-cache llvm19-libs clang19-dev lld llvm19 rust-stdlib rust-src cargo clang git protoc unzip +RUN apk add --no-cache llvm20-libs clang20-dev lld llvm20 rust-stdlib rust-src cargo clang git protoc unzip RUN cargo install --force --locked bindgen-cli && mv /root/.cargo/bin/bindgen /usr/local/bin/ && rm -rf /root/.cargo diff --git a/dockerfiles/ci/alpine_compile_extension/docker-compose.yml b/dockerfiles/ci/alpine_compile_extension/docker-compose.yml index 764b2896c5d..0201dc852bb 100644 --- a/dockerfiles/ci/alpine_compile_extension/docker-compose.yml +++ b/dockerfiles/ci/alpine_compile_extension/docker-compose.yml @@ -104,8 +104,8 @@ services: context: . x-bake: *bake args: - phpVersion: 8.2.26 - phpSha256Hash: 04e47b46b347ed6404dcc9e9989486710b075eafc8490500fd271aeeac5d83cb + phpVersion: 8.2.31 + phpSha256Hash: 083c2f61cc5f527eb293c4c468a91af46a9678785957e023b2796a9db290d870 phpApi: 20220829 volumes: - ../../:/app @@ -116,8 +116,8 @@ services: context: . x-bake: *bake args: - phpVersion: 8.3.14 - phpSha256Hash: e4ee602c31e2f701c9f0209a2902dd4802727431246a9155bf56dda7bcf7fb4a + phpVersion: 8.3.31 + phpSha256Hash: 4e7baaf0a690e954a20e7ced3dd633ce8cb8094e2b6b612a55e703ecbbdcbf4f phpApi: 20230831 volumes: - ../../:/app @@ -128,8 +128,8 @@ services: context: . x-bake: *bake args: - phpVersion: 8.4.1 - phpSha256Hash: c3d1ce4157463ea43004289c01172deb54ce9c5894d8722f4e805461bf9feaec + phpVersion: 8.4.21 + phpSha256Hash: db96ee0a8e5ee7b73a4913a2aeddc162ba2ef16cd34b9347b5b9a6150e1f8e48 phpApi: 20240924 volumes: - ../../:/app @@ -140,9 +140,8 @@ services: context: . x-bake: *bake args: - phpVersion: 8.5.0 - phpTarGzUrl: https://downloads.php.net/~daniels/php-8.5.0RC3.tar.gz - phpSha256Hash: "937e544d72ee1eb28d2190cadaadf8e5e8d7d8c365b5c1f6a99b4f979a1f3a1b" + phpVersion: 8.5.6 + phpSha256Hash: "169aaa21c2834b38df8e39169f43bc5bea8d4059a816cfbc59be08fc2bae60cd" phpApi: 20250925 volumes: - ../../:/app diff --git a/dockerfiles/ci/bookworm/.env b/dockerfiles/ci/bookworm/.env index c262c5f2817..def4d3a63e9 100644 --- a/dockerfiles/ci/bookworm/.env +++ b/dockerfiles/ci/bookworm/.env @@ -1,2 +1,2 @@ -BOOKWORM_CURRENT_VERSION=7 -BOOKWORM_NEXT_VERSION=8 +BOOKWORM_CURRENT_VERSION=8 +BOOKWORM_NEXT_VERSION=9 diff --git a/dockerfiles/ci/bookworm/Dockerfile b/dockerfiles/ci/bookworm/Dockerfile index 53ca77f14ab..8b391bd0b87 100644 --- a/dockerfiles/ci/bookworm/Dockerfile +++ b/dockerfiles/ci/bookworm/Dockerfile @@ -9,10 +9,10 @@ ENV ACCEPT_EULA=Y # with cross-language link-time optimization. Needs to match rustc -Vv's llvm # version. ENV DEVLIBS \ - libclang-19-dev \ - libclang-rt-19-dev \ - llvm-19-dev \ - lld-19 \ + libclang-20-dev \ + libclang-rt-20-dev \ + llvm-20-dev \ + lld-20 \ libbrotli-dev \ libcurl4-openssl-dev \ libedit-dev \ @@ -48,8 +48,8 @@ ENV RUNTIME_DEPS \ apache2 \ apache2-dev \ ca-certificates \ - clang-format-19 \ - clang-tidy-19 \ + clang-format-20 \ + clang-tidy-20 \ curl \ debian-goodies \ git \ @@ -70,7 +70,7 @@ ENV RUNTIME_DEPS \ ENV PHPIZE_DEPS \ autoconf \ bison \ - clang-19 \ + clang-20 \ cmake \ dpkg-dev \ file \ @@ -83,6 +83,7 @@ ENV PHPIZE_DEPS \ re2c ARG TARGETPLATFORM +ARG MAKE_JOBS= RUN set -eux; \ # Set timezone to UTC by default ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime; \ @@ -97,12 +98,12 @@ RUN set -eux; \ echo "deb http://deb.debian.org/debian-debug/ bookworm-debug main" | \ tee -a /etc/apt/sources.list; \ \ -# Use LLVM from orig vendor (also LLVM 19 is not shipped with bookworm) +# Use LLVM from orig vendor (also LLVM 20 is not shipped with bookworm) apt-get update; \ apt-get install -y curl gnupg software-properties-common; \ curl https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc; \ - add-apt-repository "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-19 main"; \ - add-apt-repository "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-19 main"; \ + add-apt-repository "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-20 main"; \ + add-apt-repository "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-20 main"; \ \ # prevent Debian's PHP packages from being installed # https://github.com/docker-library/php/pull/542 @@ -131,19 +132,21 @@ RUN set -eux; \ useradd --uid 3434 --gid circleci --shell /bin/bash --create-home circleci; \ echo 'circleci ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci; \ echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep; \ + mkdir -p /opt; \ + chown circleci:circleci /opt; \ \ # Allow nginx to be run as non-root for tests chown -R circleci:circleci /var/log/nginx/ /var/lib/nginx/; \ \ # Make clang the default compiler - update-alternatives --install /usr/bin/cc cc /usr/bin/clang-19 100; \ - update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-19 100; \ - update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 100; \ - update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 100; \ - update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-19 100; \ - echo "-L /usr/lib/llvm-19/lib/clang/19/lib/linux" > /usr/lib/llvm-19/bin/clang.cfg; \ + update-alternatives --install /usr/bin/cc cc /usr/bin/clang-20 100; \ + update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-20 100; \ + update-alternatives --install /usr/bin/clang clang /usr/bin/clang-20 100; \ + update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-20 100; \ + update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-20 100; \ + echo "-L /usr/lib/llvm-20/lib/clang/20/lib/linux" > /usr/lib/llvm-20/bin/clang.cfg; \ # Include libasan library path - echo /usr/lib/llvm-19/lib/clang/19/lib/linux > /etc/ld.so.conf.d/libasan.conf && ldconfig + echo /usr/lib/llvm-20/lib/clang/20/lib/linux > /etc/ld.so.conf.d/libasan.conf && ldconfig ENV CMAKE_VERSION="3.24.4" @@ -188,19 +191,24 @@ RUN set -eux; \ # Install gdb RUN set -eux; \ + make_jobs="${MAKE_JOBS:-0}"; \ + if [ "$make_jobs" = "0" ]; then make_jobs="$(nproc)"; fi; \ apt install -y libmpfr-dev libgmp-dev; \ - GDB_VERSION="15.2"; \ - GDB_SHA256="9d16bc2539a2a20dc3ef99b48b8414d51c51305c8577eb7a1da00996f6dea223";\ + GDB_VERSION="17.2"; \ + GDB_SHA256="cb891b9a9f554cac972eea5368176b240640ae90b681aae84bf873a9501f0063";\ cd /tmp && curl -OL https://mirrors.kernel.org/sourceware/gdb/releases/gdb-${GDB_VERSION}.tar.gz; \ (echo "${GDB_SHA256} gdb-${GDB_VERSION}.tar.gz" | sha256sum -c -); \ mkdir gdb && cd gdb; \ tar -xf ../gdb-${GDB_VERSION}.tar.gz --strip 1;\ ./configure; \ - make -j "$((`nproc`+1))"; \ - make install + make -j "$make_jobs"; \ + make install; \ + rm -rfv /tmp/* # Install valgrind RUN set -eux; \ + make_jobs="${MAKE_JOBS:-0}"; \ + if [ "$make_jobs" = "0" ]; then make_jobs="$(nproc)"; fi; \ VALGRIND_VERSION="3.25.1"; \ VALGRIND_SHA256="61deb8d0727b45c268efdc1b3b6c9e679cd97cbf5ee4b28d1dead7c8b7a271af"; \ cd /tmp && curl -OL https://mirrors.kernel.org/sourceware/valgrind/valgrind-${VALGRIND_VERSION}.tar.bz2; \ @@ -208,8 +216,9 @@ RUN set -eux; \ mkdir valgrind && cd valgrind; \ tar -xjf ../valgrind-${VALGRIND_VERSION}.tar.bz2 --strip 1;\ ./configure; \ - make -j "$((`nproc`+1))"; \ - make install + make -j "$make_jobs"; \ + make install; \ + rm -rfv /tmp/* # Install SqlServer PHP Driver # https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server @@ -295,21 +304,24 @@ RUN set -eux; \ chown -R circleci:circleci /usr/local/src; \ # Setup php install directory mkdir -p $PHP_INSTALL_DIR; \ - chown -R circleci:circleci /opt; + chown circleci:circleci $PHP_INSTALL_DIR; # rust sha256sum generated locally after verifying it with sha256 -ARG RUST_VERSION="1.84.1" +ARG RUST_VERSION="1.87.0" ARG RUST_NIGHTLY_VERSION="-2025-06-13" # Mount a cache into /rust/cargo if you want to pre-fetch packages or something ENV CARGO_HOME=/rust/cargo ENV RUSTUP_HOME=/rust/rustup + +# Using minimal and adding additional components avoids the HTML docs, which +# are unnecessary bloat. RUN mkdir -p -v "${CARGO_HOME}" "${RUSTUP_HOME}" \ && chmod -R 777 "${CARGO_HOME}" "${RUSTUP_HOME}" \ && MARCH=$(uname -m) \ - && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $RUST_VERSION -c "rustc,cargo,clippy-preview,rustfmt-preview,rust-std,rust-src" \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain $RUST_VERSION -c "rustc,cargo,clippy-preview,rustfmt-preview,rust-std,rust-src" \ && export PATH="/rust/cargo/bin:$PATH" \ - && rustup install nightly${RUST_NIGHTLY_VERSION} \ - && rustup component add rust-src --toolchain nightly${RUST_NIGHTLY_VERSION}-$MARCH-unknown-linux-gnu + && rustup toolchain install --profile minimal nightly${RUST_NIGHTLY_VERSION} \ + && rustup component add clippy-preview rustfmt-preview rust-src --toolchain nightly${RUST_NIGHTLY_VERSION}-$MARCH-unknown-linux-gnu ENV PATH="/rust/cargo/bin:${PATH}" diff --git a/dockerfiles/ci/bookworm/README.md b/dockerfiles/ci/bookworm/README.md index 628fd93d08b..d2a2fd14b66 100644 --- a/dockerfiles/ci/bookworm/README.md +++ b/dockerfiles/ci/bookworm/README.md @@ -1,6 +1,6 @@ The base image should be built and published first, before other jobs run. -The images are versioned, unlike the buster image. This so that when you are +The images are versioned. This so that when you are working on the next version of the image, you don't have to worry about breaking master; you only have to worry about other people also working on the next version. Version numbers are maintained in .env, and the diff --git a/dockerfiles/ci/bookworm/build-extensions.sh b/dockerfiles/ci/bookworm/build-extensions.sh index 8a6ebe891bb..a619baaba14 100755 --- a/dockerfiles/ci/bookworm/build-extensions.sh +++ b/dockerfiles/ci/bookworm/build-extensions.sh @@ -7,8 +7,9 @@ PHP_VERSION_ID=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') PHP_ZTS=$(php -r 'echo PHP_ZTS;') EXTENSION_DIR=$(php-config --extension-dir) -# This make `pecl install` use all available cores -export MAKEFLAGS="-s -j $(nproc)" +if [[ -z "${MAKE_JOBS:-}" || "${MAKE_JOBS}" == "0" ]]; then + MAKE_JOBS="$(nproc)" +fi XDEBUG_VERSIONS=(-3.1.2) if [[ $PHP_VERSION_ID -le 70 ]]; then @@ -89,7 +90,7 @@ if [[ $SHARED_BUILD -ne 0 ]]; then tar -xf curl.tar.gz && rm curl.tar.gz cd curl-${curlVer} ./configure --with-openssl --prefix=/opt/curl/${curlVer} - make -j "$((`nproc`+1))" + make -j "$MAKE_JOBS" make install done @@ -100,14 +101,14 @@ if [[ $SHARED_BUILD -ne 0 ]]; then cd ${PHP_SRC_DIR}/ext/curl phpize ./configure - make -j "$((`nproc`+1))" + make -j "$MAKE_JOBS" mv ./modules/*.so $EXTENSION_DIR make clean for curlVer in ${CURL_VERSIONS}; do PKG_CONFIG_PATH=/opt/curl/${curlVer}/lib/pkgconfig/ ./configure - make -j "$((`nproc`+1))" + make -j "$MAKE_JOBS" mv ./modules/curl.so $EXTENSION_DIR/curl-${curlVer}.so make clean done @@ -117,7 +118,7 @@ if [[ $SHARED_BUILD -ne 0 ]]; then cd ${PHP_SRC_DIR}/ext/pdo phpize ./configure - make -j "$((`nproc`+1))" + make -j "$MAKE_JOBS" mv ./modules/*.so $(php-config --extension-dir) make clean; phpize --clean @@ -149,13 +150,13 @@ else # memcached master version git clone https://github.com/php-memcached-dev/php-memcached.git cd php-memcached - phpize && ./configure && make -j"$(nproc)" && make install && echo "extension=memcached.so" >> ${iniDir}/memcached.ini; + phpize && ./configure && make -j"$MAKE_JOBS" && make install && echo "extension=memcached.so" >> ${iniDir}/memcached.ini; cd .. # memcache master version git clone https://github.com/websupport-sk/pecl-memcache.git cd pecl-memcache - phpize && ./configure && make -j"$(nproc)" && make install && echo "extension=memcache.so" >> ${iniDir}/memcache.ini; + phpize && ./configure && make -j"$MAKE_JOBS" && make install && echo "extension=memcache.so" >> ${iniDir}/memcache.ini; cd .. pecl install mongodb$MONGODB_VERSION; echo "extension=mongodb.so" >> ${iniDir}/mongodb.ini; @@ -163,7 +164,7 @@ else # Xdebug master version (disabled by default) git clone https://github.com/xdebug/xdebug.git cd xdebug - phpize && ./configure && make -j"$(nproc)" && make install; + phpize && ./configure && make -j"$MAKE_JOBS" && make install; cd .. fi pecl install rdkafka; echo "extension=rdkafka.so" >> ${iniDir}/rdkafka.ini; @@ -190,7 +191,7 @@ else fi phpize ./configure --host=$HOST_ARCH-linux-gnu - make -j "$((`nproc`+1))" + make -j "$MAKE_JOBS" make install popd fi @@ -222,7 +223,7 @@ else if [[ $PHP_VERSION_ID -ge 85 ]]; then git clone https://github.com/phpredis/phpredis.git cd phpredis - phpize && ./configure && make -j"$(nproc)" && make install + phpize && ./configure && make -j"$MAKE_JOBS" && make install else pecl install redis-6.1.0 fi diff --git a/dockerfiles/ci/bookworm/build-php.sh b/dockerfiles/ci/bookworm/build-php.sh index 29e622b447d..83df36900a4 100755 --- a/dockerfiles/ci/bookworm/build-php.sh +++ b/dockerfiles/ci/bookworm/build-php.sh @@ -7,6 +7,10 @@ INSTALL_VERSION=$3 PHP_VERSION=$4 SHARED_BUILD=${5:-0} +if [[ -z "${MAKE_JOBS:-}" || "${MAKE_JOBS}" == "0" ]]; then + MAKE_JOBS="$(nproc)" +fi + PHP_VERSION_ID=${PHP_VERSION:0:3} PHP_VERSION_ID=${PHP_VERSION_ID/./} INSTALL_DIR=$BASE_INSTALL_DIR/$INSTALL_VERSION @@ -91,7 +95,7 @@ ${PHP_SRC_DIR}/configure \ --with-config-file-path=${INSTALL_DIR} \ --with-config-file-scan-dir=${INSTALL_DIR}/conf.d -make -s -j "$((`nproc`+1))" || true +make -s -j "$MAKE_JOBS" || true if ! [[ -f ext/phar/phar.phar ]] && [[ ${INSTALL_VERSION} == *asan* ]]; then # Cross-compilation with asan and qemu will fail with a segfault instead. Handle this. @@ -99,7 +103,7 @@ if ! [[ -f ext/phar/phar.phar ]] && [[ ${INSTALL_VERSION} == *asan* ]]; then mkdir -p ext/phar/ touch ext/phar/phar.phar # ensure compilation finishes, then back up php - make -s || true; + make -s -j "$MAKE_JOBS" || true; exit; fi @@ -109,7 +113,7 @@ if [[ ${INSTALL_VERSION} != *asan* ]]; then # In two steps, because: You've configured multiple SAPIs to be built. You can build only one SAPI module plus CGI, CLI and FPM binaries at the same time. sed -i 's/--enable-embed/--with-apxs2=\/usr\/bin\/apxs2/' config.nice ./config.nice - make -s -j "$((`nproc`+1))" + make -s -j "$MAKE_JOBS" cp .libs/libphp*.so ${INSTALL_DIR}/lib/apache2handler-libphp.so fi diff --git a/dockerfiles/ci/bookworm/docker-compose.yml b/dockerfiles/ci/bookworm/docker-compose.yml index b771375e0b3..08e8d54cff2 100644 --- a/dockerfiles/ci/bookworm/docker-compose.yml +++ b/dockerfiles/ci/bookworm/docker-compose.yml @@ -12,6 +12,7 @@ services: - linux/amd64 args: &build-base BUILD_BASE: datadog/dd-trace-ci:bookworm-$BOOKWORM_NEXT_VERSION + MAKE_JOBS: ${MAKE_JOBS:-} php-8.5: image: datadog/dd-trace-ci:php-8.5_bookworm-$BOOKWORM_NEXT_VERSION @@ -22,8 +23,8 @@ services: args: <<: *build-base phpVersion: "8.5" - phpTarGzUrl: https://www.php.net/distributions/php-8.5.4.tar.gz - phpSha256Hash: "4fef7f44eff3c18e329504cb0d3eb30b41cf54e2db05cb4ebe8b78fc37d38ce1" + 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_bookworm-$BOOKWORM_NEXT_VERSION @@ -34,8 +35,8 @@ services: args: <<: *build-base phpVersion: "8.4" - phpTarGzUrl: https://www.php.net/distributions/php-8.4.19.tar.gz - phpSha256Hash: "9e862435ffb533dc5b0eb486170a74e5f7c8095e8eb8819a2ff5aad430292a18" + 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_bookworm-$BOOKWORM_NEXT_VERSION @@ -46,8 +47,8 @@ services: args: <<: *build-base phpVersion: "8.3" - phpTarGzUrl: https://www.php.net/distributions/php-8.3.30.tar.gz - phpSha256Hash: "e587dc95fb7f62730299fa7b36b6e4f91e6708aaefa2fff68a0098d320c16386" + 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_bookworm-$BOOKWORM_NEXT_VERSION @@ -58,8 +59,8 @@ services: args: <<: *build-base phpVersion: "8.2" - phpTarGzUrl: https://www.php.net/distributions/php-8.2.30.tar.gz - phpSha256Hash: "a0fa6673ba4b0c8335fbab08afb7c2e13a3791f2b5a0928c7ad3d7ad872edf26" + 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_bookworm-$BOOKWORM_NEXT_VERSION @@ -170,4 +171,3 @@ services: phpVersion: "7.0" phpTarGzUrl: https://www.php.net/distributions/php-7.0.33.tar.gz phpSha256Hash: d71a6ecb6b13dc53fed7532a7f8f949c4044806f067502f8fb6f9facbb40452a - diff --git a/dockerfiles/ci/bookworm/php-7.0/Dockerfile b/dockerfiles/ci/bookworm/php-7.0/Dockerfile index e218acf11a3..ce79de67566 100644 --- a/dockerfiles/ci/bookworm/php-7.0/Dockerfile +++ b/dockerfiles/ci/bookworm/php-7.0/Dockerfile @@ -30,6 +30,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} # install cross-compiling packages RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ diff --git a/dockerfiles/ci/bookworm/php-7.1/Dockerfile b/dockerfiles/ci/bookworm/php-7.1/Dockerfile index d21d6962b1d..97926597e55 100644 --- a/dockerfiles/ci/bookworm/php-7.1/Dockerfile +++ b/dockerfiles/ci/bookworm/php-7.1/Dockerfile @@ -30,6 +30,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} # install cross-compiling packages RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ diff --git a/dockerfiles/ci/bookworm/php-7.2/Dockerfile b/dockerfiles/ci/bookworm/php-7.2/Dockerfile index 5bafb197c28..66df6a34a5f 100644 --- a/dockerfiles/ci/bookworm/php-7.2/Dockerfile +++ b/dockerfiles/ci/bookworm/php-7.2/Dockerfile @@ -31,6 +31,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} # install cross-compiling packages RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ diff --git a/dockerfiles/ci/bookworm/php-7.3/Dockerfile b/dockerfiles/ci/bookworm/php-7.3/Dockerfile index 09a21305975..c02b3b144f7 100644 --- a/dockerfiles/ci/bookworm/php-7.3/Dockerfile +++ b/dockerfiles/ci/bookworm/php-7.3/Dockerfile @@ -24,6 +24,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} # install cross-compiling packages RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ diff --git a/dockerfiles/ci/bookworm/php-7.4/Dockerfile b/dockerfiles/ci/bookworm/php-7.4/Dockerfile index 4c9d31edf88..f15f41d7b62 100644 --- a/dockerfiles/ci/bookworm/php-7.4/Dockerfile +++ b/dockerfiles/ci/bookworm/php-7.4/Dockerfile @@ -22,6 +22,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} ARG sharedBuild=0 ENV SHARED_BUILD=${sharedBuild} # install cross-compiling packages diff --git a/dockerfiles/ci/bookworm/php-8.0/Dockerfile b/dockerfiles/ci/bookworm/php-8.0/Dockerfile index 6ff8fc523a7..add481710c9 100644 --- a/dockerfiles/ci/bookworm/php-8.0/Dockerfile +++ b/dockerfiles/ci/bookworm/php-8.0/Dockerfile @@ -28,6 +28,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} ARG sharedBuild=0 ENV SHARED_BUILD=${sharedBuild} # install cross-compiling packages diff --git a/dockerfiles/ci/bookworm/php-8.1/Dockerfile b/dockerfiles/ci/bookworm/php-8.1/Dockerfile index 15d7a69d71f..087a0f9f9f9 100644 --- a/dockerfiles/ci/bookworm/php-8.1/Dockerfile +++ b/dockerfiles/ci/bookworm/php-8.1/Dockerfile @@ -31,6 +31,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} # install cross-compiling packages RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ diff --git a/dockerfiles/ci/bookworm/php-8.2/Dockerfile b/dockerfiles/ci/bookworm/php-8.2/Dockerfile index bfb9d871b5a..0401cbfa24c 100644 --- a/dockerfiles/ci/bookworm/php-8.2/Dockerfile +++ b/dockerfiles/ci/bookworm/php-8.2/Dockerfile @@ -29,6 +29,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} # install cross-compiling packages RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ diff --git a/dockerfiles/ci/bookworm/php-8.3/Dockerfile b/dockerfiles/ci/bookworm/php-8.3/Dockerfile index dbf79aff9e0..9df64d84de1 100644 --- a/dockerfiles/ci/bookworm/php-8.3/Dockerfile +++ b/dockerfiles/ci/bookworm/php-8.3/Dockerfile @@ -28,6 +28,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} # install cross-compiling packages RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ diff --git a/dockerfiles/ci/bookworm/php-8.4/Dockerfile b/dockerfiles/ci/bookworm/php-8.4/Dockerfile index 632221b1595..4f3911b0b26 100644 --- a/dockerfiles/ci/bookworm/php-8.4/Dockerfile +++ b/dockerfiles/ci/bookworm/php-8.4/Dockerfile @@ -26,6 +26,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} # install cross-compiling packages RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ diff --git a/dockerfiles/ci/bookworm/php-8.5/Dockerfile b/dockerfiles/ci/bookworm/php-8.5/Dockerfile index 5a98c2832af..0be7910cfd7 100644 --- a/dockerfiles/ci/bookworm/php-8.5/Dockerfile +++ b/dockerfiles/ci/bookworm/php-8.5/Dockerfile @@ -28,6 +28,8 @@ ENV PHP_VERSION=${phpVersion} ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} ARG TARGETPLATFORM ARG BUILDPLATFORM +ARG MAKE_JOBS= +ENV MAKE_JOBS=${MAKE_JOBS} # install cross-compiling packages RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ diff --git a/dockerfiles/ci/buster/0001-Better-support-for-cross-compilation.patch b/dockerfiles/ci/buster/0001-Better-support-for-cross-compilation.patch deleted file mode 100644 index 8eda0525e84..00000000000 --- a/dockerfiles/ci/buster/0001-Better-support-for-cross-compilation.patch +++ /dev/null @@ -1,288 +0,0 @@ -From f1ad9199eff32dd805bb5b155002bdb6ca69bf01 Mon Sep 17 00:00:00 2001 -From: Dmitry Stogov -Date: Fri, 16 Apr 2021 17:28:54 +0300 -Subject: [PATCH] Better support for cross-compilation - ---- - Zend/Zend.m4 | 2 + - build/php.m4 | 24 ++++++++++-- - configure.ac | 35 ++++++++++++++++- - ext/opcache/config.m4 | 71 +++++++++++++++++++---------------- - ext/opcache/jit/Makefile.frag | 2 +- - ext/standard/config.m4 | 12 +++++- - 6 files changed, 106 insertions(+), 40 deletions(-) - -diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 -index 081a237012..a2e506412d 100644 ---- a/Zend/Zend.m4 -+++ b/Zend/Zend.m4 -@@ -276,6 +276,8 @@ int main() - ], [], [ - dnl Cross compilation needs something here. - LIBZEND_MM_ALIGN=8 -+ AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT, 8, [ ]) -+ AC_DEFINE_UNQUOTED(ZEND_MM_ALIGNMENT_LOG2, 3, [ ]) - ]) - - AC_MSG_RESULT(done) -diff --git a/build/php.m4 b/build/php.m4 -index 8994e1fe6a..a4469ac0b1 100644 ---- a/build/php.m4 -+++ b/build/php.m4 -@@ -1477,7 +1477,15 @@ int main() { - ], [ - cookie_io_functions_use_off64_t=no - ], [ -- cookie_io_functions_use_off64_t=no -+ dnl Cross compilation. -+ case $host_alias in -+ *linux*) -+ cookie_io_functions_use_off64_t=yes -+ ;; -+ *) -+ cookie_io_functions_use_off64_t=no -+ ;; -+ esac - ]) - - else -@@ -1582,7 +1590,10 @@ AC_DEFUN([PHP_CHECK_FUNC_LIB],[ - if test "$found" = "yes"; then - ac_libs=$LIBS - LIBS="$LIBS -l$2" -- AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return (0); }]])],[found=yes],[found=no],[found=no]) -+ AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return (0); }]])],[found=yes],[found=no],[ -+ dnl Cross compilation. -+ found=yes -+ ]) - LIBS=$ac_libs - fi - -@@ -2298,7 +2309,14 @@ int main() - ],[ - ac_cv_write_stdout=no - ],[ -- ac_cv_write_stdout=no -+ case $host_alias in -+ *linux*) -+ ac_cv_write_stdout=yes -+ ;; -+ *) -+ ac_cv_write_stdout=no -+ ;; -+ esac - ]) - ]) - if test "$ac_cv_write_stdout" = "yes"; then -diff --git a/configure.ac b/configure.ac -index e626fd7687..b358a666a7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -133,6 +133,14 @@ AC_PROG_CPP - AC_USE_SYSTEM_EXTENSIONS - AC_PROG_LN_S - -+if test "$cross_compiling" = yes ; then -+ AC_MSG_CHECKING(for native build C compiler) -+ AC_CHECK_PROGS(BUILD_CC, [gcc clang c99 c89 cc cl],none) -+ AC_MSG_RESULT($BUILD_CC) -+else -+ BUILD_CC=$CC -+fi -+ - dnl Support systems with system libraries in e.g. /usr/lib64. - PHP_ARG_WITH([libdir], - [for system library directory], -@@ -645,7 +653,17 @@ int main(void) { - freeaddrinfo(ai); - return 0; - } -- ]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ac_cv_func_getaddrinfo=no])], -+ ]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ -+ dnl Cross compilation. -+ case $host_alias in -+ *linux*) -+ ac_cv_func_getaddrinfo=yes -+ ;; -+ *) -+ ac_cv_func_getaddrinfo=no -+ ;; -+ esac -+ ])], - [ac_cv_func_getaddrinfo=no])]) - if test "$ac_cv_func_getaddrinfo" = yes; then - AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function]) -@@ -674,7 +692,19 @@ int main(void) { - end: - return 0; - } -- ]])], [ac_cv__asm_goto=yes], [ac_cv__asm_goto=no], [ac_cv__asm_goto=no])]) -+ ]])], [ac_cv__asm_goto=yes], [ac_cv__asm_goto=no], [ -+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ -+int main(void) { -+#if defined(__x86_64__) || defined(__i386__) -+ __asm__ goto("jmp %l0\n" :::: end); -+#elif defined(__aarch64__) -+ __asm__ goto("b %l0\n" :::: end); -+#endif -+end: -+ return 0; -+} -+ ]])], [ac_cv__asm_goto=yes], [ac_cv__asm_goto=no]) -+])]) - - if test "$ac_cv__asm_goto" = yes; then - AC_DEFINE(HAVE_ASM_GOTO,1,[Define if asm goto support]) -@@ -1334,6 +1364,7 @@ PHP_SUBST(sysconfdir) - - PHP_SUBST(EXEEXT) - PHP_SUBST(CC) -+PHP_SUBST(BUILD_CC) - PHP_SUBST(CFLAGS) - PHP_SUBST(CFLAGS_CLEAN) - PHP_SUBST(CPP) -diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 -index 19514b9b1c..2002eaa9b6 100644 ---- a/ext/opcache/config.m4 -+++ b/ext/opcache/config.m4 -@@ -43,28 +43,26 @@ if test "$PHP_OPCACHE" != "no"; then - ZEND_JIT_SRC="jit/zend_jit.c jit/zend_jit_vm_helpers.c" - - dnl Find out which ABI we are using. -- AC_RUN_IFELSE([AC_LANG_SOURCE([[ -- int main(void) { -- return sizeof(void*) == 4; -- } -- ]])],[ -- ac_cv_32bit_build=no -- ],[ -- ac_cv_32bit_build=yes -- ],[ -- ac_cv_32bit_build=no -- ]) -- -- if test "$ac_cv_32bit_build" = "no"; then -- case $host_alias in -- *x86_64-*-darwin*) -- DASM_FLAGS="-D X64APPLE=1 -D X64=1" -+ case $host_alias in -+ x86_64-*-darwin*) -+ DASM_FLAGS="-D X64APPLE=1 -D X64=1" -+ DASM_ARCH="x86" - ;; -- *x86_64*) -- DASM_FLAGS="-D X64=1" -+ x86_64*) -+ DASM_FLAGS="-D X64=1" -+ DASM_ARCH="x86" - ;; -- esac -- fi -+ i[34567]86*) -+ DASM_ARCH="x86" -+ ;; -+ x86*) -+ DASM_ARCH="x86" -+ ;; -+ aarch64*) -+ DASM_FLAGS="-D ARM64=1" -+ DASM_ARCH="arm64" -+ ;; -+ esac - - if test "$PHP_THREAD_SAFETY" = "yes"; then - DASM_FLAGS="$DASM_FLAGS -D ZTS=1" -@@ -173,9 +171,10 @@ int main() { - } - return 0; - } --]])],[dnl -+]])],[have_shm_ipc=yes],[have_shm_ipc=no],[have_shm_ipc=no]) -+ if test "$have_shm_ipc" = "yes"; then - AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support]) -- have_shm_ipc=yes],[have_shm_ipc=no],[have_shm_ipc=no]) -+ fi - AC_MSG_RESULT([$have_shm_ipc]) - - AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support) -@@ -225,9 +224,19 @@ int main() { - } - return 0; - } --]])],[dnl -+]])],[have_shm_mmap_anon=yes],[have_shm_mmap_anon=no],[ -+ case $host_alias in -+ *linux*) -+ have_shm_mmap_anon=yes -+ ;; -+ *) -+ have_shm_mmap_anon=no -+ ;; -+ esac -+]) -+ if test "$have_shm_mmap_anon" = "yes"; then - AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support]) -- have_shm_mmap_anon=yes],[have_shm_mmap_anon=no],[have_shm_mmap_anon=no]) -+ fi - AC_MSG_RESULT([$have_shm_mmap_anon]) - - PHP_CHECK_FUNC_LIB(shm_open, rt, root) -@@ -295,16 +304,12 @@ int main() { - } - return 0; - } --]])],[dnl -+]])],[have_shm_mmap_posix=yes],[have_shm_mmap_posix=no],[have_shm_mmap_posix=no]) -+ if test "$have_shm_mmap_posix" = "yes"; then - AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support]) -- AC_MSG_RESULT([yes]) -- have_shm_mmap_posix=yes - PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)]) -- ],[ -- AC_MSG_RESULT([no]) -- ],[ -- AC_MSG_RESULT([no]) -- ]) -+ fi -+ AC_MSG_RESULT([$have_shm_mmap_posix]) - - PHP_NEW_EXTENSION(opcache, - ZendAccelerator.c \ -diff --git a/ext/opcache/jit/Makefile.frag b/ext/opcache/jit/Makefile.frag -index eac6bb84c3..d44e06a3ad 100644 ---- a/ext/opcache/jit/Makefile.frag -+++ b/ext/opcache/jit/Makefile.frag -@@ -1,6 +1,6 @@ - - $(builddir)/minilua: $(srcdir)/jit/dynasm/minilua.c -- $(CC) $(srcdir)/jit/dynasm/minilua.c -lm -o $@ -+ $(BUILD_CC) $(srcdir)/jit/dynasm/minilua.c -lm -o $@ - - $(builddir)/jit/zend_jit_x86.c: $(srcdir)/jit/zend_jit_x86.dasc $(srcdir)/jit/dynasm/*.lua $(builddir)/minilua - $(builddir)/minilua $(srcdir)/jit/dynasm/dynasm.lua $(DASM_FLAGS) -o $@ $(srcdir)/jit/zend_jit_x86.dasc -diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 -index d04add9629..4b687b3df5 100644 ---- a/ext/standard/config.m4 -+++ b/ext/standard/config.m4 -@@ -295,7 +295,17 @@ if test "$ac_cv_attribute_aligned" = "yes"; then - AC_DEFINE([HAVE_ATTRIBUTE_ALIGNED], 1, [whether the compiler supports __attribute__ ((__aligned__))]) - fi - --AC_FUNC_FNMATCH -+if test "$cross_compiling" = yes ; then -+ case $host_alias in -+ *linux*) -+ AC_DEFINE([HAVE_FNMATCH], 1, -+ [Define to 1 if your system has a working POSIX `fnmatch' -+ function.]) -+ ;; -+ esac -+else -+ AC_FUNC_FNMATCH -+fi - - dnl - dnl Check if there is a support means of creating a new process and defining --- -2.37.1 - diff --git a/dockerfiles/ci/buster/0001-Delete-timers-on-fork.patch b/dockerfiles/ci/buster/0001-Delete-timers-on-fork.patch deleted file mode 100644 index 6b9427e1130..00000000000 --- a/dockerfiles/ci/buster/0001-Delete-timers-on-fork.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 97c104a11dec32eb2d6eacc570d08a2d3174eac7 Mon Sep 17 00:00:00 2001 -From: Bob Weinand -Date: Thu, 28 Mar 2024 19:55:12 +0100 -Subject: [PATCH] Delete timers on fork - -Works around https://github.com/php/php-src/issues/12298 and the related memory leaks. -This is necessary with the relatively old version of glibc we are building against. - -Signed-off-by: Bob Weinand ---- - Zend/zend_max_execution_timer.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/Zend/zend_max_execution_timer.c b/Zend/zend_max_execution_timer.c -index 48a4d1bd66..26dacd83ad 100644 ---- a/Zend/zend_max_execution_timer.c -+++ b/Zend/zend_max_execution_timer.c -@@ -41,6 +41,10 @@ ZEND_API void zend_max_execution_timer_init(void) /* {{{ */ - return; - } - -+ if (EG(pid)) { -+ free(EG(max_execution_timer_timer)); -+ } -+ - struct sigevent sev; - sev.sigev_notify = SIGEV_THREAD_ID; - sev.sigev_value.sival_ptr = &EG(max_execution_timer_timer); --- -2.41.0 - diff --git a/dockerfiles/ci/buster/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch b/dockerfiles/ci/buster/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch deleted file mode 100644 index 5ea7168eb4b..00000000000 --- a/dockerfiles/ci/buster/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 0bf39b8db984f2bad7f9bb19b413be14af40a890 Mon Sep 17 00:00:00 2001 -From: Arnaud Le Blanc -Date: Mon, 3 Mar 2025 13:12:21 +0100 -Subject: [PATCH] Disable ZEND_RC_MOD_CHECK() while loading shared extension in - FPM - -This fixes a ZEND_RC_MOD_CHECK() assertion failure when building with -"-DZEND_RC_DEBUG=1 --enable-debug --enable-zts". php_dl() is called after -startup, and manipulates the refcount of persistent strings, which is not -allowed at this point of the lifecycle. - -The dl() function disables the ZEND_RC_MOD_CHECK() assertion before calling -php_dl(). This change applies the same workaround in FPM. - -Closes GH-18075 - -(cherry picked from commit c531f3d79b1ddbddc04fe3a5b5f51e8d9c2f36d4) - -Destroy temporary module classes in reverse order - -We destroy classes of dl()'ed modules in clean_module_classes(), during -shutdown. Child classes of a module use structures of the parent class (such as -inherited properties), which are destroyed earlier, so we have a use-after-free -when destroying a child class. - -Here I destroy classes in reverse order, as it is done in zend_shutdown() for -persistent classes. - -Fixes GH-17961 -Fixes GH-15367 - -(cherry picked from commit 1c182674b09b88cb3ca954740504ba57aa1826ad) ---- - Zend/zend_API.c | 23 ++++++++++------------- - sapi/fpm/fpm/fpm_php.c | 16 +++++++++++++++- - 2 files changed, 25 insertions(+), 14 deletions(-) - -diff --git a/Zend/zend_API.c b/Zend/zend_API.c -index 5fd38a25c8b..480de589b5f 100644 ---- a/Zend/zend_API.c -+++ b/Zend/zend_API.c -@@ -22,6 +22,7 @@ - #include "zend.h" - #include "zend_execute.h" - #include "zend_API.h" -+#include "zend_hash.h" - #include "zend_modules.h" - #include "zend_extensions.h" - #include "zend_constants.h" -@@ -2932,21 +2933,17 @@ ZEND_API zend_result zend_get_module_started(const char *module_name) /* {{{ */ - } - /* }}} */ - --static int clean_module_class(zval *el, void *arg) /* {{{ */ --{ -- zend_class_entry *ce = (zend_class_entry *)Z_PTR_P(el); -- int module_number = *(int *)arg; -- if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { -- return ZEND_HASH_APPLY_REMOVE; -- } else { -- return ZEND_HASH_APPLY_KEEP; -- } --} --/* }}} */ -- - static void clean_module_classes(int module_number) /* {{{ */ - { -- zend_hash_apply_with_argument(EG(class_table), clean_module_class, (void *) &module_number); -+ /* Child classes may reuse structures from parent classes, so destroy in reverse order. */ -+ Bucket *bucket; -+ ZEND_HASH_REVERSE_FOREACH_BUCKET(EG(class_table), bucket) { -+ zend_class_entry *ce = Z_CE(bucket->val); -+ if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { -+ zend_hash_del_bucket(EG(class_table), bucket); -+ } -+ } ZEND_HASH_FOREACH_END(); -+ - } - /* }}} */ - -diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c -index dae98bdfc08..4b2066e8978 100644 ---- a/sapi/fpm/fpm/fpm_php.c -+++ b/sapi/fpm/fpm/fpm_php.c -@@ -93,9 +93,23 @@ int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */ - if (!strcmp(name, "extension") && *value) { - zval zv; - zend_interned_strings_switch_storage(0); -+ -+#if ZEND_RC_DEBUG -+ bool orig_rc_debug = zend_rc_debug; -+ /* Loading extensions after php_module_startup() breaks some invariants. -+ * For instance, it will update the refcount of persistent strings, -+ * which is normally not allowed at this stage. */ -+ zend_rc_debug = false; -+#endif -+ - php_dl(value, MODULE_PERSISTENT, &zv, 1); -+ -+#if ZEND_RC_DEBUG -+ zend_rc_debug = orig_rc_debug; -+#endif -+ - zend_interned_strings_switch_storage(1); -- return Z_TYPE(zv) == IS_TRUE ? FPM_PHP_INI_EXTENSION_LOADED : FPM_PHP_INI_EXTENSION_FAILED; -+ return Z_TYPE(zv) == IS_TRUE ? FPM_PHP_INI_EXTENSION_LOADED : FPM_PHP_INI_EXTENSION_FAILED; - } - - if (fpm_php_zend_ini_alter_master(name, name_len, value, value_len, mode, PHP_INI_STAGE_ACTIVATE) == FAILURE) { --- -2.41.0 - diff --git a/dockerfiles/ci/buster/0001-Fix-GH-10611-fpm_env_init_main-leaks-environ.patch b/dockerfiles/ci/buster/0001-Fix-GH-10611-fpm_env_init_main-leaks-environ.patch deleted file mode 100644 index 236bf6671ef..00000000000 --- a/dockerfiles/ci/buster/0001-Fix-GH-10611-fpm_env_init_main-leaks-environ.patch +++ /dev/null @@ -1,63 +0,0 @@ -From c6d9381c4333e2b6d3c0b5b7bed0f997d411a6fd Mon Sep 17 00:00:00 2001 -From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> -Date: Sat, 18 Feb 2023 20:41:26 +0100 -Subject: [PATCH] Fix GH-10611: fpm_env_init_main leaks environ - -Closes GH-10618. ---- - sapi/fpm/fpm/fpm_env.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - -diff --git a/sapi/fpm/fpm/fpm_env.c b/sapi/fpm/fpm/fpm_env.c -index c1f41f7bf9..9efb6b4cbe 100644 ---- a/sapi/fpm/fpm/fpm_env.c -+++ b/sapi/fpm/fpm/fpm_env.c -@@ -11,6 +11,7 @@ - - #include "fpm_env.h" - #include "fpm.h" -+#include "fpm_cleanup.h" - - #ifndef HAVE_SETPROCTITLE - #ifdef __linux__ -@@ -195,6 +196,26 @@ static int fpm_env_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */ - } - /* }}} */ - -+ -+#ifndef HAVE_SETPROCTITLE -+#if defined(__linux__) || defined(__APPLE__) -+/* Frees our copied environment variables. */ -+static void fpm_env_cleanup(int which, void *arg) /* {{{ */ -+{ -+ char** allocated_environ = environ; -+ if (allocated_environ) { -+ environ = NULL; -+ unsigned int i = 0; -+ while (allocated_environ[i]) { -+ free(allocated_environ[i]); -+ i++; -+ } -+ free(allocated_environ); -+ } -+} -+#endif -+#endif -+ - int fpm_env_init_main(void) - { - struct fpm_worker_pool_s *wp; -@@ -255,6 +276,10 @@ int fpm_env_init_main(void) - env_nb++; - } - -+ if (0 > fpm_cleanup_add(FPM_CLEANUP_PARENT_EXIT_MAIN, fpm_env_cleanup, 0)) { -+ return -1; -+ } -+ - if ((new_environ = malloc((1U + env_nb) * sizeof (char *))) == NULL) { - return -1; - } --- -2.37.1 - diff --git a/dockerfiles/ci/buster/0001-Fixed-incorrect-behavior-of-internal-memory-debugger.patch b/dockerfiles/ci/buster/0001-Fixed-incorrect-behavior-of-internal-memory-debugger.patch deleted file mode 100644 index 6116c136c4b..00000000000 --- a/dockerfiles/ci/buster/0001-Fixed-incorrect-behavior-of-internal-memory-debugger.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 45b4368d5c2354781a7b2f1cad86402658868e1d Mon Sep 17 00:00:00 2001 -From: Dmitry Stogov -Date: Thu, 27 Feb 2020 12:27:22 +0300 -Subject: [PATCH] Fixed incorrect behavior of internal memory debugger - ---- - Zend/zend_alloc.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c -index 0ccc004e14..25216898ed 100644 ---- a/Zend/zend_alloc.c -+++ b/Zend/zend_alloc.c -@@ -2103,6 +2103,7 @@ static zend_long zend_mm_find_leaks(zend_mm_heap *heap, zend_mm_chunk *p, uint32 - } - } - p = p->next; -+ i = ZEND_MM_FIRST_PAGE; - } while (p != heap->main_chunk); - return count; - } --- -2.32.0 (Apple Git-132) - diff --git a/dockerfiles/ci/buster/Dockerfile b/dockerfiles/ci/buster/Dockerfile deleted file mode 100644 index ae01f8a5dc6..00000000000 --- a/dockerfiles/ci/buster/Dockerfile +++ /dev/null @@ -1,369 +0,0 @@ -FROM debian:buster AS base - -ENV LANG=C.UTF-8 -ENV DEBIAN_FRONTEND=noninteractive -ENV ACCEPT_EULA=Y - -# For LLVM dependencies: -# Minimum: libclang. Nice-to-have: full toolchain including linker to play -# with cross-language link-time optimization. Needs to match rustc -Vv's llvm -# version. -ENV DEVLIBS \ - libclang-17-dev \ - libclang-rt-17-dev \ - llvm-17-dev \ - lld-17 \ - libbrotli-dev \ - libcurl4-openssl-dev \ - libedit-dev \ - libffi-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libmcrypt-dev \ - libmemcached-dev \ - libodbc1 \ - libonig-dev \ - libpq-dev \ - libpng-dev \ - librabbitmq-dev \ - librdkafka-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - libwebp-dev \ - libxml2-dev \ - libxslt1-dev \ - libzip-dev \ - libc6-dbg \ - odbcinst1debian2 \ - zlib1g-dev \ - unixodbc-dev \ - unixodbc - -#netcat -ENV RUNTIME_DEPS \ - apache2 \ - apache2-dev \ - ca-certificates \ - clang-format-17 \ - clang-tidy-17 \ - curl \ - debian-goodies \ - git \ - jq \ - less \ - lsof \ - netbase \ - netcat \ - nginx \ - strace \ - sudo \ - unzip \ - vim \ - xz-utils \ - zip - -ENV PHPIZE_DEPS \ - autoconf \ - bison \ - clang-17 \ - cmake \ - dpkg-dev \ - file \ - gnupg \ - gpg \ - file \ - libc-dev \ - make \ - pkg-config \ - re2c - -ARG TARGETPLATFORM -RUN set -eux; \ -# Set timezone to UTC by default - ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime; \ - \ -# Use unicode - locale-gen C.UTF-8 || true; \ - \ -# Core Dumps - ulimit -c unlimited; \ - \ -# Ensure debug symbols are available - echo "deb http://deb.debian.org/debian-debug/ buster-debug main" | \ - tee -a /etc/apt/sources.list; \ - \ -# Use LLVM from orig vendor (also LLVM 17 is not shipped with buster) - apt-get update; \ - apt-get install -y curl gnupg; \ - echo "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-17 main" >> /etc/apt/sources.list; \ - echo "deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster-17 main" >> /etc/apt/sources.list; \ - curl https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -; \ - curl https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc; \ - \ -# prevent Debian's PHP packages from being installed -# https://github.com/docker-library/php/pull/542 - { \ - echo 'Package: php*'; \ - echo 'Pin: release *'; \ - echo 'Pin-Priority: -1'; \ - } > /etc/apt/preferences.d/no-debian-php; \ - \ -# persistent / runtime deps - apt-get update; \ - apt-get install -y --no-install-recommends \ - gcc-$(if [ "$TARGETPLATFORM" != "linux/arm64" ]; then echo aarch64; else echo x86-64; fi)-linux-gnu \ - g++-$(if [ "$TARGETPLATFORM" != "linux/arm64" ]; then echo aarch64; else echo x86-64; fi)-linux-gnu \ - libc6-dev-$(if [ "$TARGETPLATFORM" != "linux/arm64" ]; then echo arm64; else echo amd64; fi)-cross \ - $DEVLIBS \ - $PHPIZE_DEPS \ - $RUNTIME_DEPS; \ - \ -# Disable DST ROOT X3 certificate explicitly to fix conflicts with older openssl versions \ - sed -ri 's/(mozilla\/DST_Root_CA_X3.crt)/!\1/' /etc/ca-certificates.conf; \ - update-ca-certificates; \ - \ -# circleci user + sudo - groupadd --gid 3434 circleci; \ - useradd --uid 3434 --gid circleci --shell /bin/bash --create-home circleci; \ - echo 'circleci ALL=NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci; \ - echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep; \ - \ -# Allow nginx to be run as non-root for tests - chown -R circleci:circleci /var/log/nginx/ /var/lib/nginx/; \ - \ -# Make clang the default compiler - update-alternatives --install /usr/bin/cc cc /usr/bin/clang-17 100; \ - update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-17 100; \ - update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 100; \ - update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 100; \ - update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-17 100; \ - echo "-L /usr/lib/llvm-17/lib/clang/17/lib/linux" > /usr/lib/llvm-17/bin/clang.cfg; \ -# Include libasan library path - echo /usr/lib/llvm-17/lib/clang/17/lib/linux > /etc/ld.so.conf.d/libasan.conf && ldconfig - -ENV CMAKE_VERSION="3.24.4" - -# Install CMake -RUN set -eux; \ - if [ "$(uname -m)" = "aarch64" ]; then \ - CMAKE_SHA256="86f823f2636bf715af89da10e04daa476755a799d451baee66247846e95d7bee"; \ - else \ - CMAKE_SHA256="cac77d28fb8668c179ac02c283b058aeb846fe2133a57d40b503711281ed9f19"; \ - fi; \ - cd /tmp && curl -L --output cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-$(uname -m).tar.gz; \ - (echo "${CMAKE_SHA256} cmake.tar.gz" | sha256sum -c -); \ - mkdir -p /opt/cmake/${CMAKE_VERSION}; \ - tar --strip-components 1 -C /opt/cmake/${CMAKE_VERSION} -xf /tmp/cmake.tar.gz; \ -# Currently there's only one version of cmake, make it default - ln -s /opt/cmake/${CMAKE_VERSION}/bin/cmake /usr/local/bin/cmake; \ - rm -rfv /tmp/* - -# Install Catch2 -RUN set -eux; \ - CATCH2_VERSION="2.13.10"; \ - CATCH2_SHA256="d54a712b7b1d7708bc7a819a8e6e47b2fde9536f487b89ccbca295072a7d9943"; \ - cd /tmp && curl -OL https://github.com/catchorg/Catch2/archive/v${CATCH2_VERSION}.tar.gz; \ - (echo "${CATCH2_SHA256} v${CATCH2_VERSION}.tar.gz" | sha256sum -c -); \ - mkdir catch2 && cd catch2; \ - tar -xf ../v${CATCH2_VERSION}.tar.gz --strip 1; \ - /opt/cmake/${CMAKE_VERSION}/bin/cmake -Bbuild -H. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/opt/catch2 -DCATCH_BUILD_STATIC_LIBRARY=ON; \ - /opt/cmake/${CMAKE_VERSION}/bin/cmake --build build/ --target install; \ - rm -rfv /tmp/* - -# Install lcov -RUN set -eux; \ - LCOV_VERSION="1.15"; \ - LCOV_SHA256="c1cda2fa33bec9aa2c2c73c87226cfe97de0831887176b45ee523c5e30f8053a"; \ - cd /tmp && curl -OL https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION}/lcov-${LCOV_VERSION}.tar.gz; \ - (echo "${LCOV_SHA256} lcov-${LCOV_VERSION}.tar.gz" | sha256sum -c -); \ - mkdir lcov && cd lcov; \ - tar -xf ../lcov-${LCOV_VERSION}.tar.gz --strip 1; \ - make install; \ - lcov --version; \ - rm -rfv /tmp/* - -# Install gdb -RUN set -eux; \ - apt install -y libmpfr-dev libgmp-dev; \ - GDB_VERSION="15.2"; \ - GDB_SHA256="9d16bc2539a2a20dc3ef99b48b8414d51c51305c8577eb7a1da00996f6dea223";\ - cd /tmp && curl -OL https://mirrors.kernel.org/sourceware/gdb/releases/gdb-${GDB_VERSION}.tar.gz; \ - (echo "${GDB_SHA256} gdb-${GDB_VERSION}.tar.gz" | sha256sum -c -); \ - mkdir gdb && cd gdb; \ - tar -xf ../gdb-${GDB_VERSION}.tar.gz --strip 1;\ - ./configure; \ - make -j "$((`nproc`+1))"; \ - make install - -# Install valgrind -RUN set -eux; \ - VALGRIND_VERSION="3.25.1"; \ - VALGRIND_SHA256="61deb8d0727b45c268efdc1b3b6c9e679cd97cbf5ee4b28d1dead7c8b7a271af"; \ - cd /tmp && curl -OL https://mirrors.kernel.org/sourceware/valgrind/valgrind-${VALGRIND_VERSION}.tar.bz2; \ - (echo "${VALGRIND_SHA256}" valgrind-${VALGRIND_VERSION}.tar.bz2 | sha256sum -c -); \ - mkdir valgrind && cd valgrind; \ - tar -xjf ../valgrind-${VALGRIND_VERSION}.tar.bz2 --strip 1;\ - ./configure; \ - make -j "$((`nproc`+1))"; \ - make install - -# Install SqlServer PHP Driver -# https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server -RUN set -eux; \ - curl -s https://packages.microsoft.com/keys/microsoft.asc | apt-key add -; \ - curl -s https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list; \ - apt-get update; \ - apt-get install -y \ - msodbcsql18 \ - mssql-tools18 \ - $(if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo msodbcsql17 mssql-tools; fi); - -# Apache config -ENV APACHE_CONFDIR /etc/apache2 -ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars - -RUN set -eux; \ -# generically convert lines like -# export APACHE_RUN_USER=www-data -# into -# : ${APACHE_RUN_USER:=www-data} -# export APACHE_RUN_USER -# so that they can be overridden at runtime ("-e APACHE_RUN_USER=...") - sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \ - \ -# setup directories and permissions - . "$APACHE_ENVVARS"; \ - for dir in \ - "$APACHE_LOCK_DIR" \ - "$APACHE_RUN_DIR" \ - "$APACHE_LOG_DIR" \ - ; do \ - rm -rvf "$dir"; \ - mkdir -p "$dir"; \ - chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \ -# allow running as an arbitrary user (https://github.com/docker-library/php/issues/743) - chmod 777 "$dir"; \ - done; \ - \ -# delete the "index.html" that installing Apache drops in here - rm -rvf /var/www/html/*; \ - \ -# disable config depending on env var - a2disconf other-vhosts-access-log.conf; \ - \ -# logs should go to stdout / stderr - ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \ - ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \ - chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR"; \ - \ -# Apache + PHP requires preforking Apache for best results - a2dismod mpm_event && a2enmod mpm_prefork ;\ -# PHP files should be handled by PHP, and should be preferred over any other file type - { \ - echo ''; \ - echo '\tSetHandler application/x-httpd-php'; \ - echo ''; \ - echo; \ - echo 'DirectoryIndex disabled'; \ - echo 'DirectoryIndex index.php index.html'; \ - echo; \ - echo ''; \ - echo '\tOptions -Indexes'; \ - echo '\tAllowOverride All'; \ - echo ''; \ - } | tee "$APACHE_CONFDIR/conf-available/docker-php.conf"; \ - a2enconf docker-php; \ -# We want to use mod_rewrite - a2enmod rewrite; - -RUN set -eux; \ -# Share welcome message with the world - echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' \ - >> /etc/bash.bashrc; - -# Set up PHP directories -ENV PHP_SRC_DIR=/usr/local/src/php -ENV PHP_INSTALL_DIR=/opt/php - -RUN set -eux; \ -# Setup php source directory - mkdir -p $PHP_SRC_DIR; \ - chown -R circleci:circleci /usr/local/src; \ -# Setup php install directory - mkdir -p $PHP_INSTALL_DIR; \ - chown -R circleci:circleci /opt; - -# rust sha256sum generated locally after verifying it with sha256 -ARG RUST_VERSION="1.84.1" -ARG RUST_SHA256_ARM="be89f6ad9b70cc4b25182ae299f94ab047a713a51fddf95284823c8afe4aef85" -ARG RUST_SHA256_X86="106c89f23ce1c763fcbea8e2714b2ba869bf7af70804813987a4483896398933" -# Mount a cache into /rust/cargo if you want to pre-fetch packages or something -ENV CARGO_HOME=/rust/cargo -ENV RUSTUP_HOME=/rust/rustup -RUN mkdir -p -v "${CARGO_HOME}" "${RUSTUP_HOME}" \ - && chmod -R 777 "${CARGO_HOME}" "${RUSTUP_HOME}" \ - && MARCH=$(uname -m) \ - && RUST_SHA256=$(if [ "$MARCH" = "x86_64" ]; then echo ${RUST_SHA256_X86}; elif [ "$MARCH" = "aarch64" ]; then echo ${RUST_SHA256_ARM}; fi) \ - && FILENAME=rust-${RUST_VERSION}-${MARCH}-unknown-linux-gnu.tar.gz \ - && curl -L --write-out '%{http_code}' -O https://static.rust-lang.org/dist/${FILENAME} \ - && printf '%s %s' "$RUST_SHA256" "$FILENAME" | sha256sum --check --status \ - && tar -xf "$FILENAME" \ - && cd ${FILENAME%.tar.gz} \ - && ./install.sh --components="rustc,cargo,clippy-preview,rustfmt-preview,rust-std-${MARCH}-unknown-linux-gnu" \ - && cd - \ - && rm -fr "$FILENAME" "${FILENAME%.tar.gz}" \ - && rm -rfv /tmp/* - -ENV PATH="/rust/cargo/bin:${PATH}" - -ARG GO_VERSION="1.22.1" -ARG GO_SHA256_ARM="e56685a245b6a0c592fc4a55f0b7803af5b3f827aaa29feab1f40e491acf35b8" -ARG GO_SHA256_X86="aab8e15785c997ae20f9c88422ee35d962c4562212bb0f879d052a35c8307c7f" -ENV GOROOT=/go -RUN MARCH=$(uname -m) \ - && GO_SHA256=$(if [ "$MARCH" = "x86_64" ]; then echo ${GO_SHA256_X86}; elif [ "$MARCH" = "aarch64" ]; then echo ${GO_SHA256_ARM}; fi) \ - && FILENAME=go${GO_VERSION}.linux-$(if [ "$MARCH" = "x86_64" ]; then echo amd64; elif [ "$MARCH" = "aarch64" ]; then echo arm64; fi).tar.gz \ - && curl -L --write-out '%{http_code}' -O https://go.dev/dl/${FILENAME} \ - && printf '%s %s' "$GO_SHA256" "$FILENAME" | sha256sum --check --status \ - && tar -xf "$FILENAME" -C / \ - && rm "${FILENAME}" - -ENV PATH="/go/bin:${PATH}" - -# Add the wait script to the image: note SHA 672a28f0509433e3b4b9bcd4d9cd7668cea7e31a has been reviewed and should not -# be changed without an appropriate code review. -ADD https://raw.githubusercontent.com/eficode/wait-for/672a28f0509433e3b4b9bcd4d9cd7668cea7e31a/wait-for /usr/bin/wait-for -RUN chmod a+rx /usr/bin/wait-for - -# Run everything else as circleci user -USER circleci - -RUN set -eux; \ -# Pretty prompt - echo "PS1='\[\033[01;32m\]\u\[\033[00m\]\[\033[00;35m\](buster)\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" | \ - tee -a /home/circleci/.bashrc; \ -# Autocomplete of Makefile targets (see: https://stackoverflow.com/a/38415982) - echo "complete -W \"\\\`grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' ?akefile | sed 's/[^a-zA-Z0-9_.-]*$//'\\\`\" make" | \ - tee -a /home/circleci/.bashrc; \ -# Handy aliases - echo "alias ll='ls -al'" | \ - tee -a /home/circleci/.bash_aliases; \ -# Please remember gdb history - echo 'set history save on' >> /home/circleci/.gdbinit; \ - chmod 600 /home/circleci/.gdbinit; - -COPY install-ext-from-source /usr/local/bin/install-ext-from-source -COPY switch-php /usr/local/bin/ - -WORKDIR /home/circleci - -# Override stop signal to stop process gracefully -# https://github.com/php/php-src/blob/17baa87faddc2550def3ae7314236826bc1b1398/sapi/fpm/php-fpm.8.in#L163 -STOPSIGNAL SIGQUIT - -EXPOSE 9000 -EXPOSE 80 - -CMD [ "bash" ] diff --git a/dockerfiles/ci/buster/build-extensions.sh b/dockerfiles/ci/buster/build-extensions.sh deleted file mode 100755 index 09f9d9438fc..00000000000 --- a/dockerfiles/ci/buster/build-extensions.sh +++ /dev/null @@ -1,195 +0,0 @@ -#!/bin/bash -set -eux - -# We can't match for "shared" only, as zend_test is built shared. Match something explicitly. -SHARED_BUILD=$(if php -i | grep -q enable-pcntl=shared; then echo 1; else echo 0; fi) -PHP_VERSION_ID=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') -PHP_ZTS=$(php -r 'echo PHP_ZTS;') -EXTENSION_DIR=$(php-config --extension-dir) - -# This make `pecl install` use all available cores -export MAKEFLAGS="-j $(nproc)" - -XDEBUG_VERSIONS=(-3.1.2) -if [[ $PHP_VERSION_ID -le 70 ]]; then - XDEBUG_VERSIONS=(-2.7.2) -elif [[ $PHP_VERSION_ID -le 74 ]]; then - XDEBUG_VERSIONS=(-2.9.2 -2.9.5) -elif [[ $PHP_VERSION_ID -le 80 ]]; then - XDEBUG_VERSIONS=(-3.0.0) -elif [[ $PHP_VERSION_ID -le 81 ]]; then - XDEBUG_VERSIONS=(-3.1.0) -elif [[ $PHP_VERSION_ID -le 82 ]]; then - XDEBUG_VERSIONS=(-3.2.2) -elif [[ $PHP_VERSION_ID -le 83 ]]; then - XDEBUG_VERSIONS=(-3.3.2) -else - XDEBUG_VERSIONS=(-3.4.0) -fi - -MONGODB_VERSION= -if [[ $PHP_VERSION_ID -le 70 ]]; then - MONGODB_VERSION=-1.9.2 -elif [[ $PHP_VERSION_ID -le 71 ]]; then - MONGODB_VERSION=-1.11.1 -elif [[ $PHP_VERSION_ID -le 73 ]]; then - MONGODB_VERSION=-1.16.2 -elif [[ $PHP_VERSION_ID -le 80 ]]; then - MONGODB_VERSION=-1.20.1 -fi - -AMQP_VERSION= -if [[ $PHP_VERSION_ID -le 73 ]]; then - AMQP_VERSION=-1.11.0 -else - AMQP_VERSION=-2.1.2 -fi - -AST_VERSION= -if [[ $PHP_VERSION_ID -le 71 ]]; then - AST_VERSION=-1.0.16 -fi - -MEMCACHE_VERSION= -if [[ $PHP_VERSION_ID -le 74 ]]; then - MEMCACHE_VERSION=-4.0.5.2 -fi - -SQLSRV_VERSION= -if [[ $PHP_VERSION_ID -le 70 ]]; then - SQLSRV_VERSION=-5.3.0 -elif [[ $PHP_VERSION_ID -le 71 ]]; then - SQLSRV_VERSION=-5.6.1 -elif [[ $PHP_VERSION_ID -le 74 ]]; then - SQLSRV_VERSION=-5.8.0 -elif [[ $PHP_VERSION_ID -le 80 ]]; then - SQLSRV_VERSION=-5.11.0 -fi - -HOST_ARCH=$(if [[ $(file $(readlink -f $(which php))) == *aarch64* ]]; then echo "aarch64"; else echo "x86_64"; fi) - -export PKG_CONFIG=/usr/bin/$HOST_ARCH-linux-gnu-pkg-config -# export CC=$HOST_ARCH-linux-gnu-gcc -# export CXX=$HOST_ARCH-linux-gnu-g++ - -iniDir=$(php -i | awk -F"=> " '/Scan this dir for additional .ini files/ {print $2}'); - -if [[ $SHARED_BUILD -ne 0 ]]; then - # Build curl versions - CURL_VERSIONS="7.72.0 7.77.0" - for curlVer in ${CURL_VERSIONS}; do - echo "Build curl ${curlVer}..." - cd /tmp - curl -L -o curl.tar.gz https://curl.se/download/curl-${curlVer}.tar.gz - tar -xf curl.tar.gz && rm curl.tar.gz - cd curl-${curlVer} - ./configure --with-openssl --prefix=/opt/curl/${curlVer} - make -j "$((`nproc`+1))" - make install - done - - # Build core extensions as shared libraries. - # We intentionally do not run 'make install' here so that we can test the - # scenario where headers are not installed for the shared library. - # ext/curl - cd ${PHP_SRC_DIR}/ext/curl - phpize - ./configure - make -j "$((`nproc`+1))" - mv ./modules/*.so $EXTENSION_DIR - make clean - - for curlVer in ${CURL_VERSIONS}; do - PKG_CONFIG_PATH=/opt/curl/${curlVer}/lib/pkgconfig/ - ./configure - make -j "$((`nproc`+1))" - mv ./modules/curl.so $EXTENSION_DIR/curl-${curlVer}.so - make clean - done - phpize --clean - - # ext/pdo - cd ${PHP_SRC_DIR}/ext/pdo - phpize - ./configure - make -j "$((`nproc`+1))" - mv ./modules/*.so $(php-config --extension-dir) - make clean; - phpize --clean - - # TODO Add ext/pdo_mysql, ext/pdo_pgsql, and ext/pdo_sqlite -else - pecl channel-update pecl.php.net; - - pecl install amqp$AMQP_VERSION; echo "extension=amqp.so" >> ${iniDir}/amqp.ini; - yes '' | pecl install apcu; echo "extension=apcu.so" >> ${iniDir}/apcu.ini; - pecl install ast$AST_VERSION; echo "extension=ast.so" >> ${iniDir}/ast.ini; - if [[ $PHP_VERSION_ID -ge 71 && $PHP_VERSION_ID -le 80 ]]; then - yes '' | CFLAGS="-Wno-incompatible-function-pointer-types" pecl install mcrypt$(if [[ $PHP_VERSION_ID -le 71 ]]; then echo -1.0.0; fi); echo "extension=mcrypt.so" >> ${iniDir}/mcrypt.ini; - fi - yes 'no' | pecl install memcached; echo "extension=memcached.so" >> ${iniDir}/memcached.ini; - yes '' | pecl install memcache$MEMCACHE_VERSION; echo "extension=memcache.so" >> ${iniDir}/memcache.ini; - pecl install mongodb$MONGODB_VERSION; echo "extension=mongodb.so" >> ${iniDir}/mongodb.ini; - pecl install rdkafka; echo "extension=rdkafka.so" >> ${iniDir}/rdkafka.ini; - pecl install sqlsrv$SQLSRV_VERSION; - # Xdebug is disabled by default - for VERSION in "${XDEBUG_VERSIONS[@]}"; do - pecl install xdebug$VERSION; - cd $(php-config --extension-dir); - mv xdebug.so xdebug$VERSION.so; - done - echo "zend_extension=opcache.so" >> ${iniDir}/../php-apache2handler.ini; - - # ext-parallel needs PHP 8 ZTS - if [[ $PHP_VERSION_ID -ge 80 && $PHP_ZTS -eq 1 ]]; then - pecl install parallel; - echo "extension=parallel" >> ${iniDir}/parallel.ini; - fi - - # ext-swoole needs PHP 8 - if [[ $PHP_VERSION_ID -ge 80 ]]; then - pushd /tmp - if [[ $PHP_VERSION_ID -ge 83 ]]; then - pecl download swoole-6.0.0RC1; - tar xzf swoole-6.0.0RC1.tgz - cd swoole-6.0.0RC1 - else - pecl download swoole-5.1.6; - tar xzf swoole-5.1.6.tgz - cd swoole-5.1.6 - fi - phpize - ./configure --host=$HOST_ARCH-linux-gnu - make -j "$((`nproc`+1))" - make install - popd - fi - - # ext-grpc is needed for google spanner - if [[ $PHP_VERSION_ID -ge 80 ]]; then - pecl install grpc; - # avoid installing it by default, it seems to stall some testsuites. - fi - - # We don't install any redis.so to inis, but allow selection at runtime. - if [[ $PHP_VERSION_ID -lt 80 ]]; then - pecl install redis-3.1.6 - mv $EXTENSION_DIR/redis.so $EXTENSION_DIR/redis-3.1.6.so - pecl install redis-4.3.0 - mv $EXTENSION_DIR/redis.so $EXTENSION_DIR/redis-4.3.0.so - fi - if [[ $PHP_VERSION_ID -le 83 ]]; then - pecl install redis-5.3.7 - # Redis 6.0.0 dropped support for PHP 7.1 and below - if [[ $PHP_VERSION_ID -gt 71 ]]; then - mv $EXTENSION_DIR/redis.so $EXTENSION_DIR/redis-5.3.7.so - pecl install redis-6.0.2 - else - ln -s $EXTENSION_DIR/redis.so $EXTENSION_DIR/redis-5.3.7.so - fi - fi - if [[ $PHP_VERSION_ID -ge 84 ]]; then - pecl install redis-6.1.0 - fi - -fi diff --git a/dockerfiles/ci/buster/build-php.sh b/dockerfiles/ci/buster/build-php.sh deleted file mode 100755 index e6297eac321..00000000000 --- a/dockerfiles/ci/buster/build-php.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash -set -eux - -TARGETPLATFORM=$1 -BASE_INSTALL_DIR=$2 -INSTALL_VERSION=$3 -PHP_VERSION=$4 -SHARED_BUILD=${5:-0} - -PHP_VERSION_ID=${PHP_VERSION:0:3} -PHP_VERSION_ID=${PHP_VERSION_ID/./} -INSTALL_DIR=$BASE_INSTALL_DIR/$INSTALL_VERSION - -if [[ ${INSTALL_VERSION} == *asan* ]]; then - export CFLAGS='-fsanitize=address -DZEND_TRACK_ARENA_ALLOC' - # GCC has `-shared-libasan` default, clang has '-static-libasan' default - export LDFLAGS='-fsanitize=address -shared-libasan' -fi - -if [[ ${PHP_VERSION_ID} -le 73 ]]; then - if [[ -z "${CFLAGS:-}" ]]; then - export CFLAGS="-Wno-implicit-function-declaration -DHAVE_POSIX_READDIR_R=1 -DHAVE_OLD_READDIR_R=0" - else - export CFLAGS="${CFLAGS} -Wno-implicit-function-declaration -DHAVE_POSIX_READDIR_R=1 -DHAVE_OLD_READDIR_R=0" - fi -fi - -mkdir -p /tmp/build-php && cd /tmp/build-php - -mkdir -p ${INSTALL_DIR}/conf.d - -HOST_ARCH=$(if [[ $TARGETPLATFORM == "linux/arm64" ]]; then echo "aarch64"; else echo "x86_64"; fi) - -PKG_CONFIG=/usr/bin/$HOST_ARCH-linux-gnu-pkg-config \ -# CC=$HOST_ARCH-linux-gnu-gcc \ -LIBS=-ldl \ -${PHP_SRC_DIR}/configure \ - $(if [[ $SHARED_BUILD -ne 0 ]]; then echo \ - --disable-all \ - --enable-phpdbg \ - --enable-pcntl=shared \ - --enable-mbstring=shared \ - $(if [[ ${PHP_VERSION_ID} -ge 74 ]]; then echo --with-ffi=shared; fi) \ - $(if [[ ${PHP_VERSION_ID} -le 74 ]]; then echo --enable-json=shared; fi) \ - --without-pear \ - ; else echo \ - --disable-phpdbg \ - --enable-bcmath \ - --enable-ftp \ - $(if [[ ${PHP_VERSION_ID} -ge 71 ]]; then echo --enable-intl; fi) \ - --enable-mbstring \ - $(if [[ ${PHP_VERSION_ID} -le 84 ]]; then echo --enable-opcache; fi) \ - $(if [[ ${PHP_VERSION_ID} -ge 80 ]]; then echo --enable-zend-test=shared; fi) \ - --enable-pcntl \ - --enable-soap \ - --enable-sockets \ - $(if [[ ${PHP_VERSION_ID} -le 73 ]]; then echo --enable-zip; fi) \ - $(if [[ ${PHP_VERSION_ID} -ge 74 ]]; - then echo --enable-gd --with-jpeg --with-freetype --with-webp; - else echo --with-gd --with-png-dir --with-jpeg-dir=/usr/include/; - fi) \ - --with-curl \ - $(if [[ ${PHP_VERSION_ID} -ge 74 ]]; then echo --with-ffi; fi) \ - --with-libedit \ - $(if [[ ${PHP_VERSION_ID} -le 70 ]]; then echo --with-mcrypt; fi) \ - --with-mhash \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-mysql=mysqlnd \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ - --with-pear \ - --with-readline \ - $(if [[ ${PHP_VERSION_ID} -ge 72 ]]; then echo --with-sodium; fi) \ - --with-xsl \ - $(if [[ ${PHP_VERSION_ID} -ge 74 ]]; then echo --with-zip; fi) \ - --with-zlib \ - ; fi) \ - --enable-cgi \ - --enable-embed \ - --enable-fpm \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --enable-option-checking=fatal \ - --program-prefix= \ - --host=$HOST_ARCH-linux-gnu \ - $(if [[ $INSTALL_VERSION == *debug* ]]; then echo --enable-debug; fi) \ - $(if [[ $INSTALL_VERSION == *zts* ]]; then echo --enable$(if grep -q 'maintainer-zts' ${PHP_SRC_DIR}/configure; then echo "-maintainer"; fi)-zts; fi) \ - `# https://externals.io/message/118859` \ - $(if [[ $INSTALL_VERSION == *zts* ]]; then echo --disable-zend-signals; fi) \ - $(if [[ $INSTALL_VERSION == *zts* && ${PHP_VERSION_ID} -ge 82 ]]; then echo --enable-zend-max-execution-timers; fi) \ - $(if [[ $INSTALL_VERSION == *asan* ]]; then echo --without-pcre-jit; fi) \ - --prefix=${INSTALL_DIR} \ - --with-config-file-path=${INSTALL_DIR} \ - --with-config-file-scan-dir=${INSTALL_DIR}/conf.d - -make -j "$((`nproc`+1))" || true - -if ! [[ -f ext/phar/phar.phar ]] && [[ ${INSTALL_VERSION} == *asan* ]]; then - # Cross-compilation with asan and qemu will fail with a segfault instead. Handle this. - sed -ir 's/TEST_PHP_EXECUTABLE_RES =.*/TEST_PHP_EXECUTABLE_RES = 1/' Makefile - mkdir -p ext/phar/ - touch ext/phar/phar.phar - # ensure compilation finishes, then back up php - make || true; - exit; -fi - -make install - -if [[ ${INSTALL_VERSION} != *asan* ]]; then - # In two steps, because: You've configured multiple SAPIs to be built. You can build only one SAPI module plus CGI, CLI and FPM binaries at the same time. - sed -i 's/--enable-embed/--with-apxs2=\/usr\/bin\/apxs2/' config.nice - ./config.nice - make -j "$((`nproc`+1))" - cp .libs/libphp*.so ${INSTALL_DIR}/lib/apache2handler-libphp.so -fi - -switch-php $INSTALL_VERSION; diff --git a/dockerfiles/ci/buster/docker-compose.yml b/dockerfiles/ci/buster/docker-compose.yml deleted file mode 100644 index 73c016e292a..00000000000 --- a/dockerfiles/ci/buster/docker-compose.yml +++ /dev/null @@ -1,161 +0,0 @@ -services: - - base: - image: datadog/dd-trace-ci:buster - build: - context: . - x-bake: &bake - platforms: - - linux/arm64 - - linux/amd64 - - php-8.5: - image: datadog/dd-trace-ci:php-8.5_buster - build: - context: . - dockerfile: php-8.5/Dockerfile - x-bake: *bake - args: - phpVersion: "8.5" - phpTarGzUrl: https://downloads.php.net/~daniels/php-8.5.0RC3.tar.gz - phpSha256Hash: "937e544d72ee1eb28d2190cadaadf8e5e8d7d8c365b5c1f6a99b4f979a1f3a1b" - - php-8.4: - image: datadog/dd-trace-ci:php-8.4_buster - build: - context: . - dockerfile: php-8.4/Dockerfile - x-bake: *bake - args: - phpVersion: "8.4" - phpTarGzUrl: https://www.php.net/distributions/php-8.4.6.tar.gz - phpSha256Hash: "49be0f2f45c9b07c9b921d023bf28b1fc781700c829869725681300e72e3faa8" - - php-8.3: - image: datadog/dd-trace-ci:php-8.3_buster - build: - context: . - dockerfile: php-8.3/Dockerfile - x-bake: *bake - args: - phpVersion: "8.3" - phpTarGzUrl: https://www.php.net/distributions/php-8.3.20.tar.gz - phpSha256Hash: "515ed37529df6b7f569ba68d505713bce23a93a58471dedac4ecfd17c44e5650" - - php-8.2: - image: datadog/dd-trace-ci:php-8.2_buster - build: - context: . - dockerfile: php-8.2/Dockerfile - x-bake: *bake - args: - phpVersion: "8.2" - phpTarGzUrl: https://www.php.net/distributions/php-8.2.28.tar.gz - phpSha256Hash: "3318300888de5023720cc84efad5e005e53f30b5f0072fae65a750dabcaf6ec3" - - php-8.1: - image: datadog/dd-trace-ci:php-8.1_buster - build: - context: . - dockerfile: php-8.1/Dockerfile - x-bake: *bake - args: - phpVersion: "8.1" - 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_buster - build: - context: . - dockerfile: php-8.0/Dockerfile - x-bake: *bake - args: - phpVersion: "8.0" - phpTarGzUrl: https://www.php.net/distributions/php-8.0.30.tar.gz - phpSha256Hash: "449d2048fcb20a314d8c218097c6d1047a9f1c5bb72aa54d5d3eba0a27a4c80c" - - php-8.0-shared-ext: - image: datadog/dd-trace-ci:php-8.0-shared-ext - build: - context: . - dockerfile: php-8.0/Dockerfile - x-bake: *bake - args: - sharedBuild: 1 - phpVersion: "8.0" - 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_buster - build: - context: . - dockerfile: php-7.4/Dockerfile - x-bake: *bake - args: - phpVersion: "7.4" - phpTarGzUrl: https://www.php.net/distributions/php-7.4.33.tar.gz - phpSha256Hash: 5a2337996f07c8a097e03d46263b5c98d2c8e355227756351421003bea8f463e - - php-7.4-shared-ext: - image: datadog/dd-trace-ci:php-7.4-shared-ext - build: - context: . - dockerfile: php-7.4/Dockerfile - x-bake: *bake - args: - sharedBuild: 1 - phpVersion: "7.4" - 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_buster - build: - context: . - dockerfile: php-7.3/Dockerfile - x-bake: *bake - args: - phpVersion: "7.3" - 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_buster - build: - context: . - dockerfile: php-7.2/Dockerfile - x-bake: *bake - args: - phpVersion: "7.2" - 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_buster - build: - context: . - dockerfile: php-7.1/Dockerfile - x-bake: *bake - args: - phpVersion: "7.1" - 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_buster - build: - context: . - dockerfile: php-7.0/Dockerfile - x-bake: *bake - args: - phpVersion: "7.0" - phpTarGzUrl: https://www.php.net/distributions/php-7.0.33.tar.gz - phpSha256Hash: d71a6ecb6b13dc53fed7532a7f8f949c4044806f067502f8fb6f9facbb40452a - - php-master: - image: datadog/dd-trace-ci:php-master_buster - build: - x-bake: *bake - context: ./php-master diff --git a/dockerfiles/ci/buster/install-ext-from-source b/dockerfiles/ci/buster/install-ext-from-source deleted file mode 100755 index 3cbb86d2acd..00000000000 --- a/dockerfiles/ci/buster/install-ext-from-source +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -set -e - -sourceUrl=$1 -sourceSha=$2 -configure_flags=$3 - -cd /tmp -rm -rf /tmp/ext - -curl -L --output ext.tar.gz $sourceUrl -echo "${sourceSha} ext.tar.gz" | sha256sum -c - - -mkdir -p /tmp/ext -tar -xf ext.tar.gz -C /tmp/ext --strip 1 -cd /tmp/ext - -phpize -./configure $configure_flags -make -make install diff --git a/dockerfiles/ci/buster/php-7.0/0001-Fix-stream_cookie_seeker-signature-under-musl.patch b/dockerfiles/ci/buster/php-7.0/0001-Fix-stream_cookie_seeker-signature-under-musl.patch deleted file mode 100644 index 99ebdecd34a..00000000000 --- a/dockerfiles/ci/buster/php-7.0/0001-Fix-stream_cookie_seeker-signature-under-musl.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 684f0d9e5946e92008404b3d5a131edc4f34f7da Mon Sep 17 00:00:00 2001 -From: Arnaud Le Blanc -Date: Thu, 4 Apr 2024 16:10:28 +0200 -Subject: [PATCH] Fix stream_cookie_seeker signature under musl - ---- - main/streams/cast.c | 10 +++------- - 1 file changed, 3 insertions(+), 7 deletions(-) - -diff --git a/main/streams/cast.c b/main/streams/cast.c -index 3bad65fbac1f5..8d9f4a9d2d54b 100644 ---- a/main/streams/cast.c -+++ b/main/streams/cast.c -@@ -104,6 +104,9 @@ static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t siz - - # ifdef COOKIE_SEEKER_USES_OFF64_T - static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence) -+# else -+static int stream_cookie_seeker(void *cookie, off_t *position, int whence) -+# endif - { - - *position = php_stream_seek((php_stream *)cookie, (zend_off_t)*position, whence); -@@ -113,13 +116,6 @@ static int stream_cookie_seeker(void *cookie, off64_t *position, int whence) - } - return 0; - } --# else --static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence) --{ -- -- return php_stream_seek((php_stream *)cookie, position, whence); --} --# endif - - static int stream_cookie_closer(void *cookie) - { diff --git a/dockerfiles/ci/buster/php-7.0/0001-fix-broken-sprintf-detection.patch b/dockerfiles/ci/buster/php-7.0/0001-fix-broken-sprintf-detection.patch deleted file mode 100644 index 0aa9196d3cb..00000000000 --- a/dockerfiles/ci/buster/php-7.0/0001-fix-broken-sprintf-detection.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Zend/acinclude.m4 2024-10-24 07:14:03.431931000 +0000 -+++ b/Zend/acinclude.m4 2024-10-24 07:14:19.239931008 +0000 -@@ -67,7 +67,7 @@ - dnl - AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ -- AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ -+ AC_TRY_RUN([int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes diff --git a/dockerfiles/ci/buster/php-7.0/0001-fix-build-scripts.patch b/dockerfiles/ci/buster/php-7.0/0001-fix-build-scripts.patch deleted file mode 100644 index 935111c6810..00000000000 --- a/dockerfiles/ci/buster/php-7.0/0001-fix-build-scripts.patch +++ /dev/null @@ -1,91 +0,0 @@ ---- a/acinclude.m4 2024-10-24 19:18:39.914585008 +0000 -+++ b/acinclude.m4 2024-10-24 19:19:21.978743014 +0000 -@@ -1171,7 +1171,7 @@ - AC_TRY_RUN([ - #include - --main() { -+int main() { - char buf[27]; - struct tm t; - time_t old = 0; -@@ -1187,7 +1187,7 @@ - ],[ - AC_TRY_RUN([ - #include --main() { -+int main() { - struct tm t, *s; - time_t old = 0; - char buf[27], *p; -@@ -1225,7 +1225,7 @@ - #include - #include - $1 -- main() { -+ int main() { - int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); - - if (fd < 0) exit(1); -@@ -1368,7 +1368,7 @@ - #define PATH_MAX 1024 - #endif - --main() { -+int main() { - DIR *dir; - char entry[sizeof(struct dirent)+PATH_MAX]; - struct dirent *pentry = (struct dirent *) &entry; -@@ -1487,7 +1487,7 @@ - dnl - AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ -- AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ -+ AC_TRY_RUN([int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes -@@ -1511,7 +1511,7 @@ - AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ - AC_TRY_RUN([ - #define NULL (0L) --main() { -+int main() { - char buf[20]; - int res = 0; - res = res || (snprintf(buf, 2, "marcus") != 6); -@@ -1794,7 +1794,7 @@ - - cookie_io_functions_t funcs = {reader, writer, seeker, closer}; - --main() { -+int main() { - struct cookiedata g = { 0 }; - FILE *fp = fopencookie(&g, "r", funcs); - -@@ -1911,7 +1911,7 @@ - if test "$found" = "yes"; then - ac_libs=$LIBS - LIBS="$LIBS -l$2" -- AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no]) -+ AC_TRY_RUN([int main() { return (0); }],[found=yes],[found=no],[found=no]) - LIBS=$ac_libs - fi - -@@ -2647,7 +2647,7 @@ - - X - cat >conftest.$ac_ext < -Date: Thu, 4 Apr 2024 16:10:28 +0200 -Subject: [PATCH] Fix stream_cookie_seeker signature under musl - ---- - main/streams/cast.c | 10 +++------- - 1 file changed, 3 insertions(+), 7 deletions(-) - -diff --git a/main/streams/cast.c b/main/streams/cast.c -index 3bad65fbac1f5..8d9f4a9d2d54b 100644 ---- a/main/streams/cast.c -+++ b/main/streams/cast.c -@@ -104,6 +104,9 @@ static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t siz - - # ifdef COOKIE_SEEKER_USES_OFF64_T - static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence) -+# else -+static int stream_cookie_seeker(void *cookie, off_t *position, int whence) -+# endif - { - - *position = php_stream_seek((php_stream *)cookie, (zend_off_t)*position, whence); -@@ -113,13 +116,6 @@ static int stream_cookie_seeker(void *cookie, off64_t *position, int whence) - } - return 0; - } --# else --static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence) --{ -- -- return php_stream_seek((php_stream *)cookie, position, whence); --} --# endif - - static int stream_cookie_closer(void *cookie) - { diff --git a/dockerfiles/ci/buster/php-7.1/0001-fix-broken-sprintf-detection.patch b/dockerfiles/ci/buster/php-7.1/0001-fix-broken-sprintf-detection.patch deleted file mode 100644 index 0aa9196d3cb..00000000000 --- a/dockerfiles/ci/buster/php-7.1/0001-fix-broken-sprintf-detection.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Zend/acinclude.m4 2024-10-24 07:14:03.431931000 +0000 -+++ b/Zend/acinclude.m4 2024-10-24 07:14:19.239931008 +0000 -@@ -67,7 +67,7 @@ - dnl - AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ -- AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ -+ AC_TRY_RUN([int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes diff --git a/dockerfiles/ci/buster/php-7.1/0001-fix-build-scripts.patch b/dockerfiles/ci/buster/php-7.1/0001-fix-build-scripts.patch deleted file mode 100644 index 136e3ab5aea..00000000000 --- a/dockerfiles/ci/buster/php-7.1/0001-fix-build-scripts.patch +++ /dev/null @@ -1,100 +0,0 @@ ---- a/acinclude.m4 2024-10-24 19:01:57.116321002 +0000 -+++ b/acinclude.m4 2024-10-24 19:02:48.937505012 +0000 -@@ -1171,7 +1171,7 @@ - AC_TRY_RUN([ - #include - --main() { -+int main() { - char buf[27]; - struct tm t; - time_t old = 0; -@@ -1187,7 +1187,7 @@ - ],[ - AC_TRY_RUN([ - #include --main() { -+int main() { - struct tm t, *s; - time_t old = 0; - char buf[27], *p; -@@ -1225,7 +1225,7 @@ - #include - #include - $1 -- main() { -+ int main() { - int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); - - if (fd < 0) exit(1); -@@ -1255,7 +1255,7 @@ - #include - #include - $1 -- main() { -+ int main() { - char buf[3]; - int fd = open("conftest_in", O_RDONLY); - if (fd < 0) exit(1); -@@ -1368,7 +1368,7 @@ - #define PATH_MAX 1024 - #endif - --main() { -+int main() { - DIR *dir; - char entry[sizeof(struct dirent)+PATH_MAX]; - struct dirent *pentry = (struct dirent *) &entry; -@@ -1487,7 +1487,7 @@ - dnl - AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ -- AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ -+ AC_TRY_RUN([int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes -@@ -1511,7 +1511,7 @@ - AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ - AC_TRY_RUN([ - #define NULL (0L) --main() { -+int main() { - char buf[20]; - int res = 0; - res = res || (snprintf(buf, 2, "marcus") != 6); -@@ -1794,7 +1794,7 @@ - - cookie_io_functions_t funcs = {reader, writer, seeker, closer}; - --main() { -+int main() { - struct cookiedata g = { 0 }; - FILE *fp = fopencookie(&g, "r", funcs); - -@@ -1911,7 +1911,7 @@ - if test "$found" = "yes"; then - ac_libs=$LIBS - LIBS="$LIBS -l$2" -- AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no]) -+ AC_TRY_RUN([int main() { return (0); }],[found=yes],[found=no],[found=no]) - LIBS=$ac_libs - fi - -@@ -2647,7 +2647,7 @@ - - X - cat >conftest.$ac_ext < -Date: Thu, 4 Apr 2024 16:10:28 +0200 -Subject: [PATCH] Fix stream_cookie_seeker signature under musl - ---- - main/streams/cast.c | 10 +++------- - 1 file changed, 3 insertions(+), 7 deletions(-) - -diff --git a/main/streams/cast.c b/main/streams/cast.c -index 3bad65fbac1f5..8d9f4a9d2d54b 100644 ---- a/main/streams/cast.c -+++ b/main/streams/cast.c -@@ -104,6 +104,9 @@ static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t siz - - # ifdef COOKIE_SEEKER_USES_OFF64_T - static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence) -+# else -+static int stream_cookie_seeker(void *cookie, off_t *position, int whence) -+# endif - { - - *position = php_stream_seek((php_stream *)cookie, (zend_off_t)*position, whence); -@@ -113,13 +116,6 @@ static int stream_cookie_seeker(void *cookie, off64_t *position, int whence) - } - return 0; - } --# else --static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence) --{ -- -- return php_stream_seek((php_stream *)cookie, position, whence); --} --# endif - - static int stream_cookie_closer(void *cookie) - { diff --git a/dockerfiles/ci/buster/php-7.2/0001-fix-broken-sprintf-detection.patch b/dockerfiles/ci/buster/php-7.2/0001-fix-broken-sprintf-detection.patch deleted file mode 100644 index 0aa9196d3cb..00000000000 --- a/dockerfiles/ci/buster/php-7.2/0001-fix-broken-sprintf-detection.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Zend/acinclude.m4 2024-10-24 07:14:03.431931000 +0000 -+++ b/Zend/acinclude.m4 2024-10-24 07:14:19.239931008 +0000 -@@ -67,7 +67,7 @@ - dnl - AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ -- AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ -+ AC_TRY_RUN([int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes diff --git a/dockerfiles/ci/buster/php-7.2/0001-fix-build-scripts.patch b/dockerfiles/ci/buster/php-7.2/0001-fix-build-scripts.patch deleted file mode 100644 index 326e5531af2..00000000000 --- a/dockerfiles/ci/buster/php-7.2/0001-fix-build-scripts.patch +++ /dev/null @@ -1,100 +0,0 @@ ---- a/acinclude.m4 2024-10-24 18:37:07.605265007 +0000 -+++ b/acinclude.m4 2024-10-24 18:37:46.078994011 +0000 -@@ -1158,7 +1158,7 @@ - AC_TRY_RUN([ - #include - --main() { -+int main() { - char buf[27]; - struct tm t; - time_t old = 0; -@@ -1174,7 +1174,7 @@ - ],[ - AC_TRY_RUN([ - #include --main() { -+int main() { - struct tm t, *s; - time_t old = 0; - char buf[27], *p; -@@ -1212,7 +1212,7 @@ - #include - #include - $1 -- main() { -+ int main() { - int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600); - - if (fd < 0) exit(1); -@@ -1242,7 +1242,7 @@ - #include - #include - $1 -- main() { -+ int main() { - char buf[3]; - int fd = open("conftest_in", O_RDONLY); - if (fd < 0) exit(1); -@@ -1355,7 +1355,7 @@ - #define PATH_MAX 1024 - #endif - --main() { -+int main() { - DIR *dir; - char entry[sizeof(struct dirent)+PATH_MAX]; - struct dirent *pentry = (struct dirent *) &entry; -@@ -1474,7 +1474,7 @@ - dnl - AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ -- AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ -+ AC_TRY_RUN([int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes -@@ -1498,7 +1498,7 @@ - AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ - AC_TRY_RUN([ - #define NULL (0L) --main() { -+int main() { - char buf[20]; - int res = 0; - res = res || (snprintf(buf, 2, "marcus") != 6); -@@ -1781,7 +1781,7 @@ - - cookie_io_functions_t funcs = {reader, writer, seeker, closer}; - --main() { -+int main() { - struct cookiedata g = { 0 }; - FILE *fp = fopencookie(&g, "r", funcs); - -@@ -1898,7 +1898,7 @@ - if test "$found" = "yes"; then - ac_libs=$LIBS - LIBS="$LIBS -l$2" -- AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no]) -+ AC_TRY_RUN([int main() { return (0); }],[found=yes],[found=no],[found=no]) - LIBS=$ac_libs - fi - -@@ -2697,7 +2697,7 @@ - - X - cat >conftest.$ac_ext < - --main() { -+int main() { - char buf[27]; - struct tm t; - time_t old = 0; -@@ -1171,7 +1171,7 @@ - ],[ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include --main() { -+int main() { - struct tm t, *s; - time_t old = 0; - char buf[27], *p; -@@ -1471,7 +1471,7 @@ - dnl - AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[ - AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ -- AC_RUN_IFELSE([AC_LANG_SOURCE([[main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[ -+ AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }]])],[ - ac_cv_broken_sprintf=no - ],[ - ac_cv_broken_sprintf=yes -@@ -1495,7 +1495,7 @@ - AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #define NULL (0L) --main() { -+int main() { - char buf[20]; - int res = 0; - res = res || (snprintf(buf, 2, "marcus") != 6); -@@ -1931,7 +1931,7 @@ - if test "$found" = "yes"; then - ac_libs=$LIBS - LIBS="$LIBS -l$2" -- AC_RUN_IFELSE([AC_LANG_SOURCE([[main() { return (0); }]])],[found=yes],[found=no],[found=no]) -+ AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return (0); }]])],[found=yes],[found=no],[found=no]) - LIBS=$ac_libs - fi - -@@ -2679,7 +2679,7 @@ - - X - cat >conftest.$ac_ext < - --main() { -+int main() { - char buf[27]; - struct tm t; - time_t old = 0; -@@ -1136,7 +1136,7 @@ - ],[ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include --main() { -+int main() { - struct tm t, *s; - time_t old = 0; - char buf[27], *p; -@@ -1597,7 +1597,7 @@ - if test "$found" = "yes"; then - ac_libs=$LIBS - LIBS="$LIBS -l$2" -- AC_RUN_IFELSE([AC_LANG_SOURCE([[main() { return (0); }]])],[found=yes],[found=no],[found=no]) -+ AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return (0); }]])],[found=yes],[found=no],[found=no]) - LIBS=$ac_libs - fi - -@@ -2285,7 +2285,7 @@ - - #define TEXT "This is the test message -- " - --main() -+int main() - { - int n; diff --git a/dockerfiles/ci/buster/php-7.4/Dockerfile b/dockerfiles/ci/buster/php-7.4/Dockerfile deleted file mode 100644 index e419082ea17..00000000000 --- a/dockerfiles/ci/buster/php-7.4/Dockerfile +++ /dev/null @@ -1,86 +0,0 @@ -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS src -ARG phpTarGzUrl -ARG phpSha256Hash -COPY php-7.4/0001-fix-build-scripts.patch /home/circleci -RUN set -eux; \ - curl -fsSL -o /tmp/php.tar.gz "${phpTarGzUrl}"; \ - (echo "${phpSha256Hash} /tmp/php.tar.gz" | sha256sum -c -); \ - tar xf /tmp/php.tar.gz -C "${PHP_SRC_DIR}" --strip-components=1; \ - rm -f /tmp/php.tar.gz; \ - cd ${PHP_SRC_DIR}; \ - patch -p1 < /home/circleci/0001-fix-build-scripts.patch; \ - # We need to remove the dl() calls from run-tests as some extensions don't properly switch interned string storage for INIs. \ - sed -i 's/\bdl(/(bool)(/' run-tests.php; \ - ./buildconf --force; - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS build -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} -ARG TARGETPLATFORM -ARG BUILDPLATFORM -ARG sharedBuild=0 -ENV SHARED_BUILD=${sharedBuild} -# install cross-compiling packages -RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ - sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ - sudo apt update; \ - sudo apt-get install -y --no-install-recommends valgrind:${TARGETPLATFORM#linux/} $(echo $DEVLIBS | sed "s/\(\s\|$\)/:${TARGETPLATFORM#linux/}\1/g"); \ - fi -COPY build-php.sh /home/circleci -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR - -FROM build AS php-debug -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug $PHP_VERSION $SHARED_BUILD -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-nts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR nts $PHP_VERSION $SHARED_BUILD -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-zts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR zts $PHP_VERSION $SHARED_BUILD -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-debug-zts-asan -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug-zts-asan $PHP_VERSION $SHARED_BUILD \ - && mv /tmp/build-php/sapi/cli/php /tmp/build-php/sapi/cli/php-asan -# for reasons the asan build just ... crashes in qemu (or executed via bytecode interpreter). The binary itself however perfectly works on the target platform -# just put a working php binary there to continue installation and be happy, then copy back later. -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug/bin/php /tmp/build-php/sapi/cli/php -RUN set -eux; ln -s $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug; cd /tmp/build-php; touch sapi/cli/php; make install; switch-php debug-zts-asan; -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh -RUN cp /tmp/build-php/sapi/cli/php-asan $PHP_INSTALL_DIR/debug-zts-asan/bin/php - -FROM datadog/dd-trace-ci:buster AS final -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR -COPY --chown=circleci:circleci --from=php-debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug $PHP_INSTALL_DIR/debug -COPY --chown=circleci:circleci --from=php-nts $PHP_INSTALL_DIR/nts $PHP_INSTALL_DIR/nts -COPY --chown=circleci:circleci --from=php-zts $PHP_INSTALL_DIR/zts $PHP_INSTALL_DIR/zts - -USER root - -RUN set -eux; \ - # Enable the apache config \ - echo "LoadModule php7_module /usr/lib/apache2/modules/libphp.so" | tee /etc/apache2/mods-enabled/php.load; \ - # Set the default PHP version - switch-php debug; - -# Install Composer -COPY --from=composer:2.2 /usr/bin/composer /usr/local/bin/composer - -COPY welcome /etc/motd -RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd - -USER circleci - -CMD ["php-fpm", "-F"] diff --git a/dockerfiles/ci/buster/php-8.0/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch b/dockerfiles/ci/buster/php-8.0/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch deleted file mode 100644 index 00e4c3aa66f..00000000000 --- a/dockerfiles/ci/buster/php-8.0/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 48ea62ce58d1587d83202620f7523667649b9001 Mon Sep 17 00:00:00 2001 -From: Arnaud Le Blanc -Date: Mon, 3 Mar 2025 13:12:21 +0100 -Subject: [PATCH] Disable ZEND_RC_MOD_CHECK() while loading shared extension in - FPM - -This fixes a ZEND_RC_MOD_CHECK() assertion failure when building with -"-DZEND_RC_DEBUG=1 --enable-debug --enable-zts". php_dl() is called after -startup, and manipulates the refcount of persistent strings, which is not -allowed at this point of the lifecycle. - -The dl() function disables the ZEND_RC_MOD_CHECK() assertion before calling -php_dl(). This change applies the same workaround in FPM. - -Closes GH-18075 - -(cherry picked from commit c531f3d79b1ddbddc04fe3a5b5f51e8d9c2f36d4) - -Destroy temporary module classes in reverse order - -We destroy classes of dl()'ed modules in clean_module_classes(), during -shutdown. Child classes of a module use structures of the parent class (such as -inherited properties), which are destroyed earlier, so we have a use-after-free -when destroying a child class. - -Here I destroy classes in reverse order, as it is done in zend_shutdown() for -persistent classes. - -Fixes GH-17961 -Fixes GH-15367 - -(cherry picked from commit 1c182674b09b88cb3ca954740504ba57aa1826ad) ---- - Zend/zend_API.c | 23 ++++++++++------------- - sapi/fpm/fpm/fpm_php.c | 16 ++++++++++++++++ - 2 files changed, 26 insertions(+), 13 deletions(-) - -diff --git a/Zend/zend_API.c b/Zend/zend_API.c -index 78cd7a04f79..c4325209b73 100644 ---- a/Zend/zend_API.c -+++ b/Zend/zend_API.c -@@ -22,6 +22,7 @@ - #include "zend.h" - #include "zend_execute.h" - #include "zend_API.h" -+#include "zend_hash.h" - #include "zend_modules.h" - #include "zend_extensions.h" - #include "zend_constants.h" -@@ -2597,21 +2598,17 @@ ZEND_API zend_result zend_get_module_started(const char *module_name) /* {{{ */ - } - /* }}} */ - --static int clean_module_class(zval *el, void *arg) /* {{{ */ --{ -- zend_class_entry *ce = (zend_class_entry *)Z_PTR_P(el); -- int module_number = *(int *)arg; -- if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { -- return ZEND_HASH_APPLY_REMOVE; -- } else { -- return ZEND_HASH_APPLY_KEEP; -- } --} --/* }}} */ -- - static void clean_module_classes(int module_number) /* {{{ */ - { -- zend_hash_apply_with_argument(EG(class_table), clean_module_class, (void *) &module_number); -+ /* Child classes may reuse structures from parent classes, so destroy in reverse order. */ -+ Bucket *bucket; -+ ZEND_HASH_REVERSE_FOREACH_BUCKET(EG(class_table), bucket) { -+ zend_class_entry *ce = Z_CE(bucket->val); -+ if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module->module_number == module_number) { -+ zend_hash_del_bucket(EG(class_table), bucket); -+ } -+ } ZEND_HASH_FOREACH_END(); -+ - } - /* }}} */ - -diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c -index 92b18966820..f9cb7bf816d 100644 ---- a/sapi/fpm/fpm/fpm_php.c -+++ b/sapi/fpm/fpm/fpm_php.c -@@ -87,7 +87,23 @@ int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode) /* {{{ */ - - if (!strcmp(name, "extension") && *value) { - zval zv; -+ zend_interned_strings_switch_storage(0); -+ -+#if ZEND_RC_DEBUG -+ bool orig_rc_debug = zend_rc_debug; -+ /* Loading extensions after php_module_startup() breaks some invariants. -+ * For instance, it will update the refcount of persistent strings, -+ * which is normally not allowed at this stage. */ -+ zend_rc_debug = false; -+#endif -+ - php_dl(value, MODULE_PERSISTENT, &zv, 1); -+ -+#if ZEND_RC_DEBUG -+ zend_rc_debug = orig_rc_debug; -+#endif -+ -+ zend_interned_strings_switch_storage(1); - return Z_TYPE(zv) == IS_TRUE; - } - --- -2.41.0 - diff --git a/dockerfiles/ci/buster/php-8.0/0001-Fix-memory-leak-in-zend_wrong_callback_error.patch b/dockerfiles/ci/buster/php-8.0/0001-Fix-memory-leak-in-zend_wrong_callback_error.patch deleted file mode 100644 index d42ec6d9d97..00000000000 --- a/dockerfiles/ci/buster/php-8.0/0001-Fix-memory-leak-in-zend_wrong_callback_error.patch +++ /dev/null @@ -1,31 +0,0 @@ -From a7ab292521d7d4277dfe632b34c6790731a8d1b5 Mon Sep 17 00:00:00 2001 -From: Bob Weinand -Date: Mon, 7 Apr 2025 12:16:21 +0200 -Subject: [PATCH] Fix memory leak in zend_wrong_callback_error - ---- - Zend/zend_API.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/Zend/zend_API.c b/Zend/zend_API.c -index b75dcc27004..78cd7a04f79 100644 ---- a/Zend/zend_API.c -+++ b/Zend/zend_API.c -@@ -328,11 +328,11 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_nu - - ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(uint32_t num, char *error) /* {{{ */ - { -- if (EG(exception)) { -- return; -+ if (!EG(exception)) { -+ zend_argument_type_error(num, "must be a valid callback, %s", error); - } - -- zend_argument_type_error(num, "must be a valid callback, %s", error); -+ - efree(error); - } - /* }}} */ --- -2.41.0 - diff --git a/dockerfiles/ci/buster/php-8.0/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch b/dockerfiles/ci/buster/php-8.0/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch deleted file mode 100644 index 13532cd62c1..00000000000 --- a/dockerfiles/ci/buster/php-8.0/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 79314c03bca9b9aff892b3cc1a099b6ae47776fe Mon Sep 17 00:00:00 2001 -From: Bob Weinand -Date: Wed, 7 Aug 2024 22:53:39 +0200 -Subject: [PATCH] Introduce DD_IGNORE_ARGINFO_ZPP_CHECK env var to skip these - assertions in testing - -See e.g. https://github.com/phpredis/phpredis/issues/1869, where phpredis 5 fails these assertions, and it likely will never be fixed there -This allows a simpler approach than having an extra nts-runner just for that test. ---- - Zend/zend_execute.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c -index d5e35898f9..e4df9fa149 100644 ---- a/Zend/zend_execute.c -+++ b/Zend/zend_execute.c -@@ -1142,6 +1142,7 @@ static zend_always_inline zend_bool zend_internal_call_should_throw(zend_functio - - static ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc) - { -+ if (getenv("DD_IGNORE_ARGINFO_ZPP_CHECK")) return; - zend_error(E_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()", - fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "", - fbc->common.scope ? "::" : "", --- -2.41.0 - diff --git a/dockerfiles/ci/buster/php-8.0/Dockerfile b/dockerfiles/ci/buster/php-8.0/Dockerfile deleted file mode 100644 index 38c6571c675..00000000000 --- a/dockerfiles/ci/buster/php-8.0/Dockerfile +++ /dev/null @@ -1,94 +0,0 @@ -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS src -ARG phpTarGzUrl -ARG phpSha256Hash -COPY 0001-Better-support-for-cross-compilation.patch /home/circleci -COPY 0001-Fix-GH-10611-fpm_env_init_main-leaks-environ.patch /home/circleci -COPY php-8.0/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch /home/circleci -COPY php-8.0/0001-Fix-memory-leak-in-zend_wrong_callback_error.patch /home/circleci -COPY php-8.0/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch /home/circleci -RUN set -eux; \ - curl -fsSL -o /tmp/php.tar.gz "${phpTarGzUrl}"; \ - (echo "${phpSha256Hash} /tmp/php.tar.gz" | sha256sum -c -); \ - tar xf /tmp/php.tar.gz -C "${PHP_SRC_DIR}" --strip-components=1; \ - rm -f /tmp/php.tar.gz; \ - cd ${PHP_SRC_DIR}; \ - git apply /home/circleci/0001-Better-support-for-cross-compilation.patch; \ - git apply /home/circleci/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch; \ - git apply /home/circleci/0001-Fix-memory-leak-in-zend_wrong_callback_error.patch; \ - git apply /home/circleci/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch; \ - patch -p1 /home/circleci/0001-Fix-GH-10611-fpm_env_init_main-leaks-environ.patch; \ - # We need to remove the dl() calls from run-tests as some extensions don't properly switch interned string storage for INIs. \ - sed -i 's/\bdl(/(bool)(/' run-tests.php; \ - ./buildconf --force - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS build -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} -ARG TARGETPLATFORM -ARG BUILDPLATFORM -ARG sharedBuild=0 -ENV SHARED_BUILD=${sharedBuild} -# install cross-compiling packages -RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ - sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ - sudo apt update; \ - sudo apt-get install -y --no-install-recommends valgrind:${TARGETPLATFORM#linux/} $(echo $DEVLIBS | sed "s/\(\s\|$\)/:${TARGETPLATFORM#linux/}\1/g"); \ - fi -COPY build-php.sh /home/circleci -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR - -FROM build AS php-debug -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug $PHP_VERSION $SHARED_BUILD -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-nts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR nts $PHP_VERSION $SHARED_BUILD -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-zts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR zts $PHP_VERSION $SHARED_BUILD -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-debug-zts-asan -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug-zts-asan $PHP_VERSION $SHARED_BUILD \ - && mv /tmp/build-php/sapi/cli/php /tmp/build-php/sapi/cli/php-asan -# for reasons the asan build just ... crashes in qemu (or executed via bytecode interpreter). The binary itself however perfectly works on the target platform -# just put a working php binary there to continue installation and be happy, then copy back later. -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug/bin/php /tmp/build-php/sapi/cli/php -RUN set -eux; ln -s $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug; cd /tmp/build-php; touch sapi/cli/php; make install; switch-php debug-zts-asan; -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh -RUN cp /tmp/build-php/sapi/cli/php-asan $PHP_INSTALL_DIR/debug-zts-asan/bin/php - -FROM datadog/dd-trace-ci:buster AS final -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR -COPY --chown=circleci:circleci --from=php-debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug $PHP_INSTALL_DIR/debug -COPY --chown=circleci:circleci --from=php-nts $PHP_INSTALL_DIR/nts $PHP_INSTALL_DIR/nts -COPY --chown=circleci:circleci --from=php-zts $PHP_INSTALL_DIR/zts $PHP_INSTALL_DIR/zts - -USER root - -RUN set -eux; \ - # Enable the apache config \ - echo "LoadModule php_module /usr/lib/apache2/modules/libphp.so" | tee /etc/apache2/mods-enabled/php.load; \ - # Set the default PHP version - switch-php debug; - -# Install Composer -COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer - -COPY welcome /etc/motd -RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd - -USER circleci - -CMD ["php-fpm", "-F"] diff --git a/dockerfiles/ci/buster/php-8.1/0001-Disable-inlining-and-inter-procedure-analyses-for-ze.patch b/dockerfiles/ci/buster/php-8.1/0001-Disable-inlining-and-inter-procedure-analyses-for-ze.patch deleted file mode 100644 index d168eebb505..00000000000 --- a/dockerfiles/ci/buster/php-8.1/0001-Disable-inlining-and-inter-procedure-analyses-for-ze.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 57760217c0cc44c5f3936df3c41162617960e2ae Mon Sep 17 00:00:00 2001 -From: Dmitry Stogov -Date: Tue, 9 Jan 2024 18:05:51 +0100 -Subject: [PATCH] Disable inlining and inter-procedure-analyses for - zend_string_equal_val() function that may be overriden for valgrind (#13099) - -This is a more safely way to fix GH-9068 - -(cherry picked from commit 6339938c7e289cb5a1c0bf8f37d96537301d5477) -Signed-off-by: Bob Weinand ---- - Zend/zend_string.c | 22 +++++++--------------- - 1 file changed, 7 insertions(+), 15 deletions(-) - -diff --git a/Zend/zend_string.c b/Zend/zend_string.c -index c21b4f5d461..afc7325713c 100644 ---- a/Zend/zend_string.c -+++ b/Zend/zend_string.c -@@ -366,6 +366,7 @@ ZEND_API void zend_interned_strings_switch_storage(bool request) - } - } - -+#if defined(__GNUC__) && (defined(__i386__) || (defined(__x86_64__) && !defined(__ILP32__))) - /* Even if we don't build with valgrind support, include the symbol so that valgrind available - * only at runtime will not result in false positives. */ - #ifndef I_REPLACE_SONAME_FNNAME_ZU -@@ -373,29 +374,20 @@ ZEND_API void zend_interned_strings_switch_storage(bool request) - #endif - - /* See GH-9068 */ --#if defined(__GNUC__) && (__GNUC__ >= 11 || defined(__clang__)) && __has_attribute(no_caller_saved_registers) --# define NO_CALLER_SAVED_REGISTERS __attribute__((no_caller_saved_registers)) --# ifndef __clang__ --# pragma GCC push_options --# pragma GCC target ("general-regs-only") --# define POP_OPTIONS --# endif -+#if __has_attribute(noipa) -+# define NOIPA __attribute__((noipa)) - #else --# define NO_CALLER_SAVED_REGISTERS -+# define NOIPA - #endif - --ZEND_API bool ZEND_FASTCALL NO_CALLER_SAVED_REGISTERS I_REPLACE_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1, zend_string *s2) -+ZEND_API bool ZEND_FASTCALL I_REPLACE_SONAME_FNNAME_ZU(NONE,zend_string_equal_val)(zend_string *s1, zend_string *s2) - { - return !memcmp(ZSTR_VAL(s1), ZSTR_VAL(s2), ZSTR_LEN(s1)); - } -- --#ifdef POP_OPTIONS --# pragma GCC pop_options --# undef POP_OPTIONS - #endif - - #if defined(__GNUC__) && defined(__i386__) --ZEND_API bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2) -+ZEND_API zend_never_inline NOIPA bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2) - { - const char *ptr = ZSTR_VAL(s1); - uintptr_t delta = (uintptr_t) s2 - (uintptr_t) s1; -@@ -433,7 +425,7 @@ ZEND_API bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string * - } - - #elif defined(__GNUC__) && defined(__x86_64__) && !defined(__ILP32__) --ZEND_API bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2) -+ZEND_API zend_never_inline NOIPA bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_string *s2) - { - const char *ptr = ZSTR_VAL(s1); - uintptr_t delta = (uintptr_t) s2 - (uintptr_t) s1; --- -2.41.0 - diff --git a/dockerfiles/ci/buster/php-8.1/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch b/dockerfiles/ci/buster/php-8.1/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch deleted file mode 100644 index 00c13009f4a..00000000000 --- a/dockerfiles/ci/buster/php-8.1/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 90936c193e6c95c1b7acf926434ab2e2adca06a4 Mon Sep 17 00:00:00 2001 -From: Bob Weinand -Date: Wed, 7 Aug 2024 22:53:39 +0200 -Subject: [PATCH] Introduce DD_IGNORE_ARGINFO_ZPP_CHECK env var to skip these - assertions in testing - -See e.g. https://github.com/phpredis/phpredis/issues/1869, where phpredis 5 fails these assertions, and it likely will never be fixed there -This allows a simpler approach than having an extra nts-runner just for that test. ---- - Zend/zend_execute.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c -index 5c9a59bb95..8e3c9d0ca7 100644 ---- a/Zend/zend_execute.c -+++ b/Zend/zend_execute.c -@@ -1196,6 +1196,7 @@ ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_d - - ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc) - { -+ if (getenv("DD_IGNORE_ARGINFO_ZPP_CHECK")) return; - zend_error(E_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()", - fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "", - fbc->common.scope ? "::" : "", --- -2.41.0 - diff --git a/dockerfiles/ci/buster/php-8.1/0002-fix-tsrm-jit-aarch64.patch b/dockerfiles/ci/buster/php-8.1/0002-fix-tsrm-jit-aarch64.patch deleted file mode 100644 index cc5383dbc4d..00000000000 --- a/dockerfiles/ci/buster/php-8.1/0002-fix-tsrm-jit-aarch64.patch +++ /dev/null @@ -1,131 +0,0 @@ -From e4d2a3e53aeb94446616860a945b1b3293f4d912 Mon Sep 17 00:00:00 2001 -From: nielsdos <7771979+nielsdos@users.noreply.github.com> -Date: Fri, 12 May 2023 20:04:51 +0200 -Subject: [PATCH] Fix GH-11188: Error when building TSRM in ARM64 - -Although the issue mentioned FreeBSD, this is a broader problem: -the current ARM64 code to load the TLS offset assumes a setup with -the non-default TLS model. This problem can also apply on some -configurations on other platforms. ---- - TSRM/TSRM.c | 11 +++++++- - TSRM/TSRM.h | 3 +++ - ext/opcache/jit/zend_jit_arm64.dasc | 39 +++++++++++++++++++++++++++-- - 3 files changed, 50 insertions(+), 3 deletions(-) - -diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c -index 61871da3fa81c..9770adc926a73 100644 ---- a/TSRM/TSRM.c -+++ b/TSRM/TSRM.c -@@ -777,11 +777,20 @@ TSRM_API size_t tsrm_get_ls_cache_tcb_offset(void) - asm("adrp %0, #__tsrm_ls_cache@TLVPPAGE\n\t" - "ldr %0, [%0, #__tsrm_ls_cache@TLVPPAGEOFF]" - : "=r" (ret)); --# else -+# elif defined(TSRM_TLS_MODEL_DEFAULT) -+ /* Surplus Static TLS space isn't guaranteed. */ -+ ret = 0; -+# elif defined(TSRM_TLS_MODEL_INITIAL_EXEC) -+ asm("adrp %0, :gottprel:_tsrm_ls_cache\n\t" -+ "ldr %0, [%0, #:gottprel_lo12:_tsrm_ls_cache]" -+ : "=r" (ret)); -+# elif defined(TSRM_TLS_MODEL_LOCAL_EXEC) - asm("mov %0, xzr\n\t" - "add %0, %0, #:tprel_hi12:_tsrm_ls_cache, lsl #12\n\t" - "add %0, %0, #:tprel_lo12_nc:_tsrm_ls_cache" - : "=r" (ret)); -+# else -+# error "TSRM TLS model not set" - # endif - return ret; - #else -diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h -index 60b65ca8ec762..1b7c904fdb62c 100644 ---- a/TSRM/TSRM.h -+++ b/TSRM/TSRM.h -@@ -150,10 +150,13 @@ TSRM_API const char *tsrm_api_name(void); - - #if !__has_attribute(tls_model) || defined(__FreeBSD__) || defined(__MUSL__) || defined(__HAIKU__) - # define TSRM_TLS_MODEL_ATTR -+# define TSRM_TLS_MODEL_DEFAULT - #elif __PIC__ - # define TSRM_TLS_MODEL_ATTR __attribute__((tls_model("initial-exec"))) -+# define TSRM_TLS_MODEL_INITIAL_EXEC - #else - # define TSRM_TLS_MODEL_ATTR __attribute__((tls_model("local-exec"))) -+# define TSRM_TLS_MODEL_LOCAL_EXEC - #endif - - #define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1) -diff --git a/ext/opcache/jit/zend_jit_arm64.dasc b/ext/opcache/jit/zend_jit_arm64.dasc -index 910105aa5bbff..f6b34e3baf36d 100644 ---- a/ext/opcache/jit/zend_jit_arm64.dasc -+++ b/ext/opcache/jit/zend_jit_arm64.dasc -@@ -110,6 +110,8 @@ static void* dasm_labels[zend_lb_MAX]; - - #if ZTS - static size_t tsrm_ls_cache_tcb_offset = 0; -+static size_t tsrm_tls_index = 0; -+static size_t tsrm_tls_offset = 0; - # ifdef __APPLE__ - struct TLVDescriptor { - void* (*thunk)(struct TLVDescriptor*); -@@ -117,6 +119,13 @@ struct TLVDescriptor { - uint64_t offset; - }; - typedef struct TLVDescriptor TLVDescriptor; -+# elif defined(__FreeBSD__) -+/* https://github.com/freebsd/freebsd-src/blob/c52ca7dd09066648b1cc40f758289404d68ab886/libexec/rtld-elf/aarch64/reloc.c#L180-L184 */ -+typedef struct TLSDescriptor { -+ void* thunk; -+ int index; -+ size_t offset; -+} TLSDescriptor; - # endif - #endif - -@@ -494,8 +503,14 @@ static bool logical_immediate_p(uint64_t value, uint32_t reg_size) - | MEM_ACCESS_64_WITH_UOFFSET_64 ldr, reg, TMP3, (((TLVDescriptor*)tsrm_ls_cache_tcb_offset)->offset), TMP1 - ||#else - | .long 0xd53bd051 // TODO: hard-coded: mrs TMP3, tpidr_el0 --|| ZEND_ASSERT(tsrm_ls_cache_tcb_offset <= LDR_STR_PIMM64); --| ldr reg, [TMP3, #tsrm_ls_cache_tcb_offset] -+|| if (tsrm_ls_cache_tcb_offset == 0) { -+| ldr TMP3, [TMP3, #0] -+| MEM_ACCESS_64_WITH_UOFFSET_64 ldr, TMP3, TMP3, tsrm_tls_index, TMP1 -+| MEM_ACCESS_64_WITH_UOFFSET_64 ldr, reg, TMP3, tsrm_tls_offset, TMP1 -+|| } else { -+|| ZEND_ASSERT(tsrm_ls_cache_tcb_offset <= LDR_STR_PIMM64); -+| ldr reg, [TMP3, #tsrm_ls_cache_tcb_offset] -+|| } - ||#endif - |.endmacro - -@@ -2754,7 +2769,27 @@ static int zend_jit_setup(void) - - #if ZTS - tsrm_ls_cache_tcb_offset = tsrm_get_ls_cache_tcb_offset(); -+# if defined(__FreeBSD__) -+ if (tsrm_ls_cache_tcb_offset == 0) { -+ TLSDescriptor **where; -+ -+ __asm__( -+ "adrp %0, :tlsdesc:_tsrm_ls_cache\n" -+ "add %0, %0, :tlsdesc_lo12:_tsrm_ls_cache\n" -+ : "=r" (where)); -+ /* See https://github.com/ARM-software/abi-aa/blob/2a70c42d62e9c3eb5887fa50b71257f20daca6f9/aaelf64/aaelf64.rst -+ * section "Relocations for thread-local storage". -+ * The first entry holds a pointer to the variable's TLS descriptor resolver function and the second entry holds -+ * a platform-specific offset or pointer. */ -+ TLSDescriptor *tlsdesc = where[1]; -+ -+ tsrm_tls_offset = tlsdesc->offset; -+ /* Index is offset by 1 on FreeBSD (https://github.com/freebsd/freebsd-src/blob/22ca6db50f4e6bd75a141f57cf953d8de6531a06/lib/libc/gen/tls.c#L88) */ -+ tsrm_tls_index = (tlsdesc->index + 1) * 8; -+ } -+# else - ZEND_ASSERT(tsrm_ls_cache_tcb_offset != 0); -+# endif - #endif - - memset(sp_adj, 0, sizeof(sp_adj)); diff --git a/dockerfiles/ci/buster/php-8.1/Dockerfile b/dockerfiles/ci/buster/php-8.1/Dockerfile deleted file mode 100644 index 57ecd31b087..00000000000 --- a/dockerfiles/ci/buster/php-8.1/Dockerfile +++ /dev/null @@ -1,95 +0,0 @@ -FROM datadog/dd-trace-ci:buster AS base - -ARG phpVersion -ENV PHP_VERSION=${phpVersion} - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS src -ARG phpTarGzUrl -ARG phpSha256Hash -COPY php-8.1/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch /home/circleci -COPY php-8.1/0002-fix-tsrm-jit-aarch64.patch /home/circleci -COPY php-8.1/0001-Disable-inlining-and-inter-procedure-analyses-for-ze.patch /home/circleci -COPY 0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch /home/circleci -RUN set -eux; \ - curl -fsSL -o /tmp/php.tar.gz "${phpTarGzUrl}"; \ - (echo "${phpSha256Hash} /tmp/php.tar.gz" | sha256sum -c -); \ - tar xf /tmp/php.tar.gz -C "${PHP_SRC_DIR}" --strip-components=1; \ - rm -f /tmp/php.tar.gz; \ - cd ${PHP_SRC_DIR}; \ - git apply /home/circleci/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch; \ - git apply /home/circleci/0002-fix-tsrm-jit-aarch64.patch; \ - git apply /home/circleci/0001-Disable-inlining-and-inter-procedure-analyses-for-ze.patch; \ - git apply /home/circleci/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch; \ - # We need to remove the dl() calls from run-tests as some extensions don't properly switch interned string storage for INIs. \ - sed -i 's/\bdl(/(bool)(/' run-tests.php; \ - ./buildconf --force - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS build -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} -ARG TARGETPLATFORM -ARG BUILDPLATFORM -# install cross-compiling packages -RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ - sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ - sudo apt update; \ - sudo apt-get install -y --no-install-recommends valgrind:${TARGETPLATFORM#linux/} $(echo $DEVLIBS | sed "s/\(\s\|$\)/:${TARGETPLATFORM#linux/}\1/g"); \ - fi -COPY build-php.sh /home/circleci -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR - -FROM build AS php-debug -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-nts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR nts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-zts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR zts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-debug-zts-asan -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug-zts-asan $PHP_VERSION \ - && mv /tmp/build-php/sapi/cli/php /tmp/build-php/sapi/cli/php-asan -# for reasons the asan build just ... crashes in qemu (or executed via bytecode interpreter). The binary itself however perfectly works on the target platform -# just put a working php binary there to continue installation and be happy, then copy back later. -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug/bin/php /tmp/build-php/sapi/cli/php -RUN set -eux; ln -s $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug; cd /tmp/build-php; touch sapi/cli/php; make install; switch-php debug-zts-asan; -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh -RUN cp /tmp/build-php/sapi/cli/php-asan $PHP_INSTALL_DIR/debug-zts-asan/bin/php - -FROM base AS final -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR -COPY --chown=circleci:circleci --from=php-debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug $PHP_INSTALL_DIR/debug -COPY --chown=circleci:circleci --from=php-nts $PHP_INSTALL_DIR/nts $PHP_INSTALL_DIR/nts -COPY --chown=circleci:circleci --from=php-zts $PHP_INSTALL_DIR/zts $PHP_INSTALL_DIR/zts - -USER root - -RUN set -eux; \ - # Enable the apache config \ - echo "LoadModule php_module /usr/lib/apache2/modules/libphp.so" | tee /etc/apache2/mods-enabled/php.load; \ - # Set the default PHP version - switch-php debug; - -# Install Composer -COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer - -COPY welcome /etc/motd -RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd - -USER circleci - -CMD ["php-fpm", "-F"] diff --git a/dockerfiles/ci/buster/php-8.2/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch b/dockerfiles/ci/buster/php-8.2/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch deleted file mode 100644 index fa60fbf5fa9..00000000000 --- a/dockerfiles/ci/buster/php-8.2/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 1931d38a5e9234bebae83fa73d8e99a187e05dfb Mon Sep 17 00:00:00 2001 -From: Bob Weinand -Date: Wed, 7 Aug 2024 22:53:39 +0200 -Subject: [PATCH] Introduce DD_IGNORE_ARGINFO_ZPP_CHECK env var to skip these - assertions in testing - -See e.g. https://github.com/phpredis/phpredis/issues/1869, where phpredis 5 fails these assertions, and it likely will never be fixed there -This allows a simpler approach than having an extra nts-runner just for that test. ---- - Zend/zend_execute.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c -index 3de48fb135..6e5a4062e1 100644 ---- a/Zend/zend_execute.c -+++ b/Zend/zend_execute.c -@@ -1237,6 +1237,7 @@ ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_d - - ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc) - { -+ if (getenv("DD_IGNORE_ARGINFO_ZPP_CHECK")) return; - zend_error(E_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()", - fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "", - fbc->common.scope ? "::" : "", --- -2.41.0 - diff --git a/dockerfiles/ci/buster/php-8.2/Dockerfile b/dockerfiles/ci/buster/php-8.2/Dockerfile deleted file mode 100644 index a87de4f885b..00000000000 --- a/dockerfiles/ci/buster/php-8.2/Dockerfile +++ /dev/null @@ -1,93 +0,0 @@ -FROM datadog/dd-trace-ci:buster AS base - -ARG phpVersion -ENV PHP_VERSION=${phpVersion} - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS src -ARG phpTarGzUrl -ARG phpSha256Hash -COPY 0001-Delete-timers-on-fork.patch /home/circleci -COPY 0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch /home/circleci -COPY php-8.2/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch /home/circleci -RUN set -eux; \ - curl -fsSL -o /tmp/php.tar.gz "${phpTarGzUrl}"; \ - (echo "${phpSha256Hash} /tmp/php.tar.gz" | sha256sum -c -); \ - tar xf /tmp/php.tar.gz -C "${PHP_SRC_DIR}" --strip-components=1; \ - rm -f /tmp/php.tar.gz; \ - cd ${PHP_SRC_DIR}; \ - git apply /home/circleci/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch; \ - git apply /home/circleci/0001-Disable-ZEND_RC_MOD_CHECK-while-loading-shared-exten.patch; \ - patch Zend/zend_max_execution_timer.c /home/circleci/0001-Delete-timers-on-fork.patch; \ - # We need to remove the dl() calls from run-tests as some extensions don't properly switch interned string storage for INIs. \ - sed -i 's/\bdl(/(bool)(/' run-tests.php; \ - ./buildconf --force - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS build -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} -ARG TARGETPLATFORM -ARG BUILDPLATFORM -# install cross-compiling packages -RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ - sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ - sudo apt update; \ - sudo apt-get install -y --no-install-recommends valgrind:${TARGETPLATFORM#linux/} $(echo $DEVLIBS | sed "s/\(\s\|$\)/:${TARGETPLATFORM#linux/}\1/g"); \ - fi -COPY build-php.sh /home/circleci -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR - -FROM build AS php-debug -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-nts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR nts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-zts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR zts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-debug-zts-asan -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug-zts-asan $PHP_VERSION \ - && mv /tmp/build-php/sapi/cli/php /tmp/build-php/sapi/cli/php-asan -# for reasons the asan build just ... crashes in qemu (or executed via bytecode interpreter). The binary itself however perfectly works on the target platform -# just put a working php binary there to continue installation and be happy, then copy back later. -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug/bin/php /tmp/build-php/sapi/cli/php -RUN set -eux; ln -s $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug; cd /tmp/build-php; touch sapi/cli/php; make install; switch-php debug-zts-asan; -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh -RUN cp /tmp/build-php/sapi/cli/php-asan $PHP_INSTALL_DIR/debug-zts-asan/bin/php - -FROM base AS final -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR -COPY --chown=circleci:circleci --from=php-debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug $PHP_INSTALL_DIR/debug -COPY --chown=circleci:circleci --from=php-nts $PHP_INSTALL_DIR/nts $PHP_INSTALL_DIR/nts -COPY --chown=circleci:circleci --from=php-zts $PHP_INSTALL_DIR/zts $PHP_INSTALL_DIR/zts - -USER root - -RUN set -eux; \ - # Enable the apache config \ - echo "LoadModule php_module /usr/lib/apache2/modules/libphp.so" | tee /etc/apache2/mods-enabled/php.load; \ - # Set the default PHP version - switch-php debug; - -# Install Composer -COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer - -COPY welcome /etc/motd -RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd - -USER circleci - -CMD ["php-fpm", "-F"] diff --git a/dockerfiles/ci/buster/php-8.3/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch b/dockerfiles/ci/buster/php-8.3/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch deleted file mode 100644 index d7d34ab9373..00000000000 --- a/dockerfiles/ci/buster/php-8.3/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 16d2a319a36e90cf1bd3f0d3f3732c8035e81c02 Mon Sep 17 00:00:00 2001 -From: Bob Weinand -Date: Wed, 7 Aug 2024 22:53:39 +0200 -Subject: [PATCH] Introduce DD_IGNORE_ARGINFO_ZPP_CHECK env var to skip these - assertions in testing - -See e.g. https://github.com/phpredis/phpredis/issues/1869, where phpredis 5 fails these assertions, and it likely will never be fixed there -This allows a simpler approach than having an extra nts-runner just for that test. ---- - Zend/zend_execute.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c -index 8da2d37a25..869c547be0 100644 ---- a/Zend/zend_execute.c -+++ b/Zend/zend_execute.c -@@ -1297,6 +1297,7 @@ ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_d - - ZEND_API ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc) - { -+ if (getenv("DD_IGNORE_ARGINFO_ZPP_CHECK")) return; - zend_error(E_ERROR, "Arginfo / zpp mismatch during call of %s%s%s()", - fbc->common.scope ? ZSTR_VAL(fbc->common.scope->name) : "", - fbc->common.scope ? "::" : "", --- -2.41.0 - diff --git a/dockerfiles/ci/buster/php-8.3/Dockerfile b/dockerfiles/ci/buster/php-8.3/Dockerfile deleted file mode 100644 index fd9b906c5e5..00000000000 --- a/dockerfiles/ci/buster/php-8.3/Dockerfile +++ /dev/null @@ -1,92 +0,0 @@ -FROM datadog/dd-trace-ci:buster AS base - -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV LSAN_OPTIONS="suppressions=/home/circleci/suppr.txt,print_suppressions=0,use_tls=0" - -COPY php-8.3/suppr.txt /home/circleci/suppr.txt - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS src -ARG phpTarGzUrl -ARG phpSha256Hash -COPY php-8.3/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch /home/circleci -RUN set -eux; \ - curl -fsSL -o /tmp/php.tar.gz "${phpTarGzUrl}"; \ - (echo "${phpSha256Hash} /tmp/php.tar.gz" | sha256sum -c -); \ - tar xf /tmp/php.tar.gz -C "${PHP_SRC_DIR}" --strip-components=1; \ - rm -f /tmp/php.tar.gz; \ - cd ${PHP_SRC_DIR}; \ - git apply /home/circleci/0001-Introduce-DD_IGNORE_ARGINFO_ZPP_CHECK-env-var-to-ski.patch; \ - # We need to remove the dl() calls from run-tests as some extensions don't properly switch interned string storage for INIs. \ - sed -i 's/\bdl(/(bool)(/' run-tests.php; \ - ./buildconf --force; - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS build -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} -ARG TARGETPLATFORM -ARG BUILDPLATFORM -# install cross-compiling packages -RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ - sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ - sudo apt update; \ - sudo apt-get install -y --no-install-recommends valgrind:${TARGETPLATFORM#linux/} $(echo $DEVLIBS | sed "s/\(\s\|$\)/:${TARGETPLATFORM#linux/}\1/g"); \ - fi -COPY build-php.sh /home/circleci -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR - -FROM build AS php-debug -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-nts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR nts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-zts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR zts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-debug-zts-asan -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug-zts-asan $PHP_VERSION \ - && mv /tmp/build-php/sapi/cli/php /tmp/build-php/sapi/cli/php-asan -# for reasons the asan build just ... crashes in qemu (or executed via bytecode interpreter). The binary itself however perfectly works on the target platform -# just put a working php binary there to continue installation and be happy, then copy back later. -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug/bin/php /tmp/build-php/sapi/cli/php -RUN set -eux; ln -s $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug; cd /tmp/build-php; touch sapi/cli/php; make install; switch-php debug-zts-asan; -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh -RUN cp /tmp/build-php/sapi/cli/php-asan $PHP_INSTALL_DIR/debug-zts-asan/bin/php - -FROM base AS final -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR -COPY --chown=circleci:circleci --from=php-debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug $PHP_INSTALL_DIR/debug -COPY --chown=circleci:circleci --from=php-nts $PHP_INSTALL_DIR/nts $PHP_INSTALL_DIR/nts -COPY --chown=circleci:circleci --from=php-zts $PHP_INSTALL_DIR/zts $PHP_INSTALL_DIR/zts - -USER root - -RUN set -eux; \ - # Enable the apache config \ - echo "LoadModule php_module /usr/lib/apache2/modules/libphp.so" | tee /etc/apache2/mods-enabled/php.load; \ - # Set the default PHP version - switch-php debug; - -# Install Composer -COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer - -COPY welcome /etc/motd -RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd - -USER circleci - -CMD ["php-fpm", "-F"] diff --git a/dockerfiles/ci/buster/php-8.3/suppr.txt b/dockerfiles/ci/buster/php-8.3/suppr.txt deleted file mode 100644 index 741c68ed250..00000000000 --- a/dockerfiles/ci/buster/php-8.3/suppr.txt +++ /dev/null @@ -1,7 +0,0 @@ -leak:timer_create -# some glibc symbols which leak in glibc itself thanks to use_tls=0 -leak:add_to_global -leak:_dl_map_object_deps -leak:__res_context_send -leak:_dl_make_tlsdesc_dynamic -leak:_dl_catch_exception diff --git a/dockerfiles/ci/buster/php-8.4/Dockerfile b/dockerfiles/ci/buster/php-8.4/Dockerfile deleted file mode 100644 index 25471da0f56..00000000000 --- a/dockerfiles/ci/buster/php-8.4/Dockerfile +++ /dev/null @@ -1,90 +0,0 @@ -FROM datadog/dd-trace-ci:buster AS base - -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV LSAN_OPTIONS="suppressions=/home/circleci/suppr.txt,print_suppressions=0" - -COPY php-8.4/suppr.txt /home/circleci/suppr.txt - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS src -ARG phpTarGzUrl -ARG phpSha256Hash -RUN set -eux; \ - curl -fsSL -o /tmp/php.tar.gz "${phpTarGzUrl}"; \ - (echo "${phpSha256Hash} /tmp/php.tar.gz" | sha256sum -c -); \ - tar xf /tmp/php.tar.gz -C "${PHP_SRC_DIR}" --strip-components=1; \ - rm -f /tmp/php.tar.gz; \ - cd ${PHP_SRC_DIR}; \ - # We need to remove the dl() calls from run-tests as some extensions don't properly switch interned string storage for INIs. \ - sed -i 's/\bdl(/(bool)(/' run-tests.php; \ - ./buildconf --force; - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS build -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} -ARG TARGETPLATFORM -ARG BUILDPLATFORM -# install cross-compiling packages -RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ - sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ - sudo apt update; \ - sudo apt-get install -y --no-install-recommends valgrind:${TARGETPLATFORM#linux/} $(echo $DEVLIBS | sed "s/\(\s\|$\)/:${TARGETPLATFORM#linux/}\1/g"); \ - fi -COPY build-php.sh /home/circleci -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR - -FROM build AS php-debug -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-nts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR nts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-zts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR zts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-debug-zts-asan -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug-zts-asan $PHP_VERSION \ - && mv /tmp/build-php/sapi/cli/php /tmp/build-php/sapi/cli/php-asan -# for reasons the asan build just ... crashes in qemu (or executed via bytecode interpreter). The binary itself however perfectly works on the target platform -# just put a working php binary there to continue installation and be happy, then copy back later. -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug/bin/php /tmp/build-php/sapi/cli/php -RUN set -eux; ln -s $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug; cd /tmp/build-php; touch sapi/cli/php; make install; switch-php debug-zts-asan; -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh -RUN cp /tmp/build-php/sapi/cli/php-asan $PHP_INSTALL_DIR/debug-zts-asan/bin/php - -FROM base AS final -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR -COPY --chown=circleci:circleci --from=php-debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug $PHP_INSTALL_DIR/debug -COPY --chown=circleci:circleci --from=php-nts $PHP_INSTALL_DIR/nts $PHP_INSTALL_DIR/nts -COPY --chown=circleci:circleci --from=php-zts $PHP_INSTALL_DIR/zts $PHP_INSTALL_DIR/zts - -USER root - -RUN set -eux; \ - # Enable the apache config \ - echo "LoadModule php_module /usr/lib/apache2/modules/libphp.so" | tee /etc/apache2/mods-enabled/php.load; \ - # Set the default PHP version - switch-php debug; - -# Install Composer -COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer - -COPY welcome /etc/motd -RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd - -USER circleci - -CMD ["php-fpm", "-F"] diff --git a/dockerfiles/ci/buster/php-8.4/suppr.txt b/dockerfiles/ci/buster/php-8.4/suppr.txt deleted file mode 100644 index 39c643abb53..00000000000 --- a/dockerfiles/ci/buster/php-8.4/suppr.txt +++ /dev/null @@ -1 +0,0 @@ -leak:timer_create diff --git a/dockerfiles/ci/buster/php-8.5/Dockerfile b/dockerfiles/ci/buster/php-8.5/Dockerfile deleted file mode 100644 index 551b6cf72ec..00000000000 --- a/dockerfiles/ci/buster/php-8.5/Dockerfile +++ /dev/null @@ -1,90 +0,0 @@ -FROM datadog/dd-trace-ci:buster AS base - -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV LSAN_OPTIONS="suppressions=/home/circleci/suppr.txt,print_suppressions=0" - -COPY php-8.5/suppr.txt /home/circleci/suppr.txt - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS src -ARG phpTarGzUrl -ARG phpSha256Hash -RUN set -eux; \ - curl -fsSL -o /tmp/php.tar.gz "${phpTarGzUrl}"; \ - (echo "${phpSha256Hash} /tmp/php.tar.gz" | sha256sum -c -); \ - tar xf /tmp/php.tar.gz -C "${PHP_SRC_DIR}" --strip-components=1; \ - rm -f /tmp/php.tar.gz; \ - cd ${PHP_SRC_DIR}; \ - # We need to remove the dl() calls from run-tests as some extensions don't properly switch interned string storage for INIs. \ - sed -i 's/\bdl(/(bool)(/' run-tests.php; \ - ./buildconf --force; - -FROM --platform=$BUILDPLATFORM datadog/dd-trace-ci:buster AS build -ARG phpVersion -ENV PHP_VERSION=${phpVersion} -ENV PHP_INSTALL_DIR=${PHP_INSTALL_DIR} -ARG TARGETPLATFORM -ARG BUILDPLATFORM -# install cross-compiling packages -RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ]; then \ - sudo dpkg --add-architecture ${TARGETPLATFORM#linux/}; \ - sudo apt update; \ - sudo apt-get install -y --no-install-recommends valgrind:${TARGETPLATFORM#linux/} $(echo $DEVLIBS | sed "s/\(\s\|$\)/:${TARGETPLATFORM#linux/}\1/g"); \ - fi -COPY build-php.sh /home/circleci -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR - -FROM build AS php-debug -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-nts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR nts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-zts -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR zts $PHP_VERSION -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh - -FROM build AS php-debug-zts-asan -ARG TARGETPLATFORM -RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR debug-zts-asan $PHP_VERSION \ - && mv /tmp/build-php/sapi/cli/php /tmp/build-php/sapi/cli/php-asan -# for reasons the asan build just ... crashes in qemu (or executed via bytecode interpreter). The binary itself however perfectly works on the target platform -# just put a working php binary there to continue installation and be happy, then copy back later. -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug/bin/php /tmp/build-php/sapi/cli/php -RUN set -eux; ln -s $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug; cd /tmp/build-php; touch sapi/cli/php; make install; switch-php debug-zts-asan; -COPY build-extensions.sh /home/circleci -RUN /home/circleci/build-extensions.sh -RUN cp /tmp/build-php/sapi/cli/php-asan $PHP_INSTALL_DIR/debug-zts-asan/bin/php - -FROM base AS final -COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR -COPY --chown=circleci:circleci --from=php-debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan -COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug $PHP_INSTALL_DIR/debug -COPY --chown=circleci:circleci --from=php-nts $PHP_INSTALL_DIR/nts $PHP_INSTALL_DIR/nts -COPY --chown=circleci:circleci --from=php-zts $PHP_INSTALL_DIR/zts $PHP_INSTALL_DIR/zts - -USER root - -RUN set -eux; \ - # Enable the apache config \ - echo "LoadModule php_module /usr/lib/apache2/modules/libphp.so" | tee /etc/apache2/mods-enabled/php.load; \ - # Set the default PHP version - switch-php debug; - -# Install Composer -COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer - -COPY welcome /etc/motd -RUN sudo sed -i "s/VERSIONS/$(ls $PHP_INSTALL_DIR | xargs)/" /etc/motd - -USER circleci - -CMD ["php-fpm", "-F"] diff --git a/dockerfiles/ci/buster/php-8.5/suppr.txt b/dockerfiles/ci/buster/php-8.5/suppr.txt deleted file mode 100644 index 39c643abb53..00000000000 --- a/dockerfiles/ci/buster/php-8.5/suppr.txt +++ /dev/null @@ -1 +0,0 @@ -leak:timer_create diff --git a/dockerfiles/ci/buster/php-master/Dockerfile b/dockerfiles/ci/buster/php-master/Dockerfile deleted file mode 100644 index 742216627d9..00000000000 --- a/dockerfiles/ci/buster/php-master/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM datadog/dd-trace-ci:buster AS base - -# Set up PHP master branch that can be built by running `install-php-master` -RUN set -eux; \ - git config --global user.email "test@example.com"; \ - git config --global user.name "Test User"; \ - cd $PHP_SRC_DIR; \ - git clone --depth 1 --branch master https://github.com/php/php-src.git master; - -COPY install-php-master /usr/local/bin/ -RUN install-php-master - - -COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer - -COPY welcome /etc/motd - -CMD ["php-fpm", "-F"] diff --git a/dockerfiles/ci/buster/php-master/install-php-master b/dockerfiles/ci/buster/php-master/install-php-master deleted file mode 100755 index 5e13ab8696a..00000000000 --- a/dockerfiles/ci/buster/php-master/install-php-master +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -set -e - -if [ -z "${PHP_SRC_DIR}" ]; then - echo "Please set PHP_SRC_DIR" - exit 1 -fi -if [ -z "${PHP_INSTALL_DIR}" ]; then - echo "Please set PHP_INSTALL_DIR" - exit 1 -fi - -phpVersion=master -srcDir=${PHP_SRC_DIR}/${phpVersion} -installDir=${PHP_INSTALL_DIR}/${phpVersion} - -cd ${srcDir} -git pull --depth=1 --rebase - -sharedConfig=" - --enable-option-checking=fatal \ - --enable-cgi \ - --enable-fpm \ - --enable-ftp \ - --enable-mbstring \ - --enable-opcache \ - --enable-pcntl \ - --enable-phpdbg \ - --enable-sockets \ - --with-curl \ - --with-ffi \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --with-libedit \ - --with-mhash \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-mysql=mysqlnd \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ - --with-pear \ - --with-readline \ - --with-zip \ - --with-zlib -" - -./buildconf --force -./configure \ - ${sharedConfig} \ - --enable-debug \ - --prefix=${installDir}-debug \ - --with-config-file-path=${installDir}-debug \ - --with-config-file-scan-dir=${installDir}-debug/conf.d -# TODO Fix asan builds -# CFLAGS='-fsanitize=address -static-libasan -DZEND_TRACK_ARENA_ALLOC' \ -# LDFLAGS='-fsanitize=address -static-libasan' -make clean -make -j "$((`nproc`+1))" -make install -switch-php ${phpVersion}-debug -mkdir -vp $(php-config --ini-dir) diff --git a/dockerfiles/ci/buster/php-master/welcome b/dockerfiles/ci/buster/php-master/welcome deleted file mode 100644 index 3395f198def..00000000000 --- a/dockerfiles/ci/buster/php-master/welcome +++ /dev/null @@ -1,11 +0,0 @@ - -██████╗ █████╗ ████████╗ █████╗ ██████╗ ██████╗ ██████╗ -██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗██╔═══██╗██╔════╝ -██║ ██║███████║ ██║ ███████║██║ ██║██║ ██║██║ ███╗ -██║ ██║██╔══██║ ██║ ██╔══██║██║ ██║██║ ██║██║ ██║ -██████╔╝██║ ██║ ██║ ██║ ██║██████╔╝╚██████╔╝╚██████╔╝ -╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝ - -To build latest php-src master (as debug) run: - $ install-php-master - diff --git a/dockerfiles/ci/buster/switch-php b/dockerfiles/ci/buster/switch-php deleted file mode 100755 index 5f99103cb58..00000000000 --- a/dockerfiles/ci/buster/switch-php +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -set -e - -phpVersion=$1 - -if [ -z "${phpVersion}" ] || [ ! -f /opt/php/${phpVersion}/bin/php ]; then - echo "Invalid PHP version. Valid versions are:" - ls /opt/php - exit 1 -fi - -sudo ln -sf /opt/php/${phpVersion}/bin/pear /usr/local/bin/pear -sudo ln -sf /opt/php/${phpVersion}/bin/pecl /usr/local/bin/pecl -sudo ln -sf /opt/php/${phpVersion}/bin/phar.phar /usr/local/bin/phar -sudo ln -sf /opt/php/${phpVersion}/bin/php /usr/local/bin/php -sudo ln -sf /opt/php/${phpVersion}/bin/php-cgi /usr/local/bin/php-cgi -sudo ln -sf /opt/php/${phpVersion}/bin/php-config /usr/local/bin/php-config -sudo ln -sf /opt/php/${phpVersion}/bin/phpdbg /usr/local/bin/phpdbg -sudo ln -sf /opt/php/${phpVersion}/bin/phpize /usr/local/bin/phpize -sudo ln -sf /opt/php/${phpVersion}/sbin/php-fpm /usr/local/bin/php-fpm -sudo ln -sf /opt/php/${phpVersion}/lib/libphp.so /usr/lib/libphp.so -sudo ln -sf /opt/php/${phpVersion}/bin/frankenphp /usr/local/bin/frankenphp -if [ "${phpVersion}" != *asan* ]; then - sudo ln -sf /opt/php/${phpVersion}/lib/apache2handler-libphp.so /usr/lib/apache2/modules/libphp.so -fi \ No newline at end of file diff --git a/dockerfiles/ci/buster/welcome b/dockerfiles/ci/buster/welcome deleted file mode 100644 index aaf81a73c64..00000000000 --- a/dockerfiles/ci/buster/welcome +++ /dev/null @@ -1,14 +0,0 @@ - -██████╗ █████╗ ████████╗ █████╗ ██████╗ ██████╗ ██████╗ -██╔══██╗██╔══██╗╚══██╔══╝██╔══██╗██╔══██╗██╔═══██╗██╔════╝ -██║ ██║███████║ ██║ ███████║██║ ██║██║ ██║██║ ███╗ -██║ ██║██╔══██║ ██║ ██╔══██║██║ ██║██║ ██║██║ ██║ -██████╔╝██║ ██║ ██║ ██║ ██║██████╔╝╚██████╔╝╚██████╔╝ -╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═════╝ - -The following PHP versions are supported: - VERSIONS - -To switch PHP versions run: - $ switch-php - diff --git a/dockerfiles/ci/centos/6/CentOS-Base.repo b/dockerfiles/ci/centos/6/CentOS-Base.repo deleted file mode 100644 index 611bf6edfb6..00000000000 --- a/dockerfiles/ci/centos/6/CentOS-Base.repo +++ /dev/null @@ -1,39 +0,0 @@ -[C6.10-base] -name=CentOS-6.10 - Base -baseurl=http://vault.centos.org/6.10/os/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 -enabled=1 -metadata_expire=never - -[C6.10-updates] -name=CentOS-6.10 - Updates -baseurl=http://vault.centos.org/6.10/updates/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 -enabled=1 -metadata_expire=never - -[C6.10-extras] -name=CentOS-6.10 - Extras -baseurl=http://vault.centos.org/6.10/extras/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 -enabled=1 -metadata_expire=never - -[C6.10-contrib] -name=CentOS-6.10 - Contrib -baseurl=http://vault.centos.org/6.10/contrib/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 -enabled=0 -metadata_expire=never - -[C6.10-centosplus] -name=CentOS-6.10 - CentOSPlus -baseurl=http://vault.centos.org/6.10/centosplus/$basearch/ -gpgcheck=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 -enabled=0 -metadata_expire=never diff --git a/dockerfiles/ci/centos/6/CentOS-SCLo-scl-rh.repo b/dockerfiles/ci/centos/6/CentOS-SCLo-scl-rh.repo deleted file mode 100644 index 60d6cb6183b..00000000000 --- a/dockerfiles/ci/centos/6/CentOS-SCLo-scl-rh.repo +++ /dev/null @@ -1,33 +0,0 @@ -# CentOS-SCLo-rh.repo -# -# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more -# information - -[centos-sclo-rh] -name=CentOS-6 - SCLo rh -baseurl=http://vault.centos.org/centos/6/sclo/$basearch/rh/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo - -[centos-sclo-rh-testing] -name=CentOS-6 - SCLo rh Testing -baseurl=http://buildlogs.centos.org/centos/6/sclo/$basearch/rh/ -gpgcheck=0 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo - -[centos-sclo-rh-source] -name=CentOS-6 - SCLo rh Sources -baseurl=http://vault.centos.org/centos/6/sclo/Source/rh/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo - -[centos-sclo-rh-debuginfo] -name=CentOS-6 - SCLo rh Debuginfo -baseurl=http://debuginfo.centos.org/centos/6/sclo/$basearch/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo - diff --git a/dockerfiles/ci/centos/6/CentOS-SCLo-scl.repo b/dockerfiles/ci/centos/6/CentOS-SCLo-scl.repo deleted file mode 100644 index 09c8f8a72ce..00000000000 --- a/dockerfiles/ci/centos/6/CentOS-SCLo-scl.repo +++ /dev/null @@ -1,33 +0,0 @@ -# CentOS-SCLo-sclo.repo -# -# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more -# information - -[centos-sclo-sclo] -name=CentOS-6 - SCLo sclo -baseurl=http://vault.centos.org/centos/6/sclo/$basearch/sclo/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo - -[centos-sclo-sclo-testing] -name=CentOS-6 - SCLo sclo Testing -baseurl=http://buildlogs.centos.org/centos/6/sclo/$basearch/sclo/ -gpgcheck=0 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo - -[centos-sclo-sclo-source] -name=CentOS-6 - SCLo sclo Sources -baseurl=http://vault.centos.org/centos/6/sclo/Source/sclo/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo - -[centos-sclo-sclo-debuginfo] -name=CentOS-6 - SCLo sclo Debuginfo -baseurl=http://debuginfo.centos.org/centos/6/sclo/$basearch/ -gpgcheck=1 -enabled=0 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo - diff --git a/dockerfiles/ci/centos/6/base.Dockerfile b/dockerfiles/ci/centos/6/base.Dockerfile deleted file mode 100644 index fea6c62b03a..00000000000 --- a/dockerfiles/ci/centos/6/base.Dockerfile +++ /dev/null @@ -1,107 +0,0 @@ -FROM centos:6 - -# Letsencrpypt root certificate was crossigned by DST Root CA X3 which expired on 2021-09-30, we now need our own cert -# - details : https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/ -# - x1 root : https://letsencrypt.org/certs/isrgrootx1.pem -# - x3 expired : Copied from old container -COPY isrgrootx1.pem /etc/pki/ca-trust/source/anchors/ -COPY dst-x3-expired.pem /etc/pki/ca-trust/source/blacklist/ -RUN update-ca-trust && update-ca-trust force-enable - -COPY CentOS-Base.repo /etc/yum.repos.d/ - -RUN set -eux; \ - echo 'ip_resolve = IPv4' >>/etc/yum.conf; \ - yum update -y; \ - yum install -y \ - centos-release-scl \ - curl \ - environment-modules \ - gcc \ - gcc-c++ \ - git \ - libedit-devel \ - make \ - openssl-devel \ - pkg-config \ - postgresql-devel \ - readline-devel \ - scl-utils \ - unzip \ - vim \ - xz \ - zlib-devel; - -COPY CentOS-SCLo-scl.repo /etc/yum.repos.d/ -COPY CentOS-SCLo-scl-rh.repo /etc/yum.repos.d/ - -RUN set -eux; \ - yum install -y devtoolset-7; \ - yum clean all; - -ENV SRC_DIR=/usr/local/src - -COPY download-src.sh /root/ -RUN set -eux; \ -# version 1.0.2 of openssl (default version is 1.0.1) required for letsencrypt certificates to continue working - /root/download-src.sh openssl https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz; \ - cd "${SRC_DIR}/openssl"; \ - CFLAGS=-fPIC ./config shared --prefix=/usr --openssldir=/etc/pki/tls && make && make install; \ -# Latest version of m4 required - /root/download-src.sh m4 https://ftpmirror.gnu.org/gnu/m4/m4-1.4.18.tar.gz; \ - cd "${SRC_DIR}/m4"; \ - ./configure && make && make install; \ -# Latest version of autoconf required - /root/download-src.sh autoconf https://ftpmirror.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz; \ - cd "${SRC_DIR}/autoconf"; \ - ./configure && make && make install; \ -# Required: libxml >= 2.9.0 (default version is 2.7.6) - /root/download-src.sh libxml2 http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz; \ - cd "${SRC_DIR}/libxml2"; \ - ./configure --with-python=no; \ - make && make install; \ -# Required: libcurl >= 7.29.0 (default version is 7.19.7) - /root/download-src.sh libcurl https://curl.haxx.se/download/curl-7.72.0.tar.gz; \ - cd "${SRC_DIR}/libcurl"; \ - ./configure && make && make install; \ -# Required: libffi >= 3.0.11 (default version is 3.0.5) - /root/download-src.sh libffi https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz; \ - cd "${SRC_DIR}/libffi"; \ - ./configure && make && make install; \ -# Required: oniguruma (not installed by deafult) - /root/download-src.sh oniguruma https://github.com/kkos/oniguruma/releases/download/v6.9.5_rev1/onig-6.9.5-rev1.tar.gz; \ - cd "${SRC_DIR}/oniguruma"; \ - ./configure && make && make install; \ -# Required: bison >= 3.0.0 (not installed by deafult) - /root/download-src.sh bison https://ftpmirror.gnu.org/gnu/bison/bison-3.7.3.tar.gz; \ - cd "${SRC_DIR}/bison"; \ - ./configure && make && make install; \ -# Required: re2c >= 0.13.4 (not installed by deafult) - /root/download-src.sh re2c https://github.com/skvadrik/re2c/releases/download/2.0.3/re2c-2.0.3.tar.xz; \ - cd "${SRC_DIR}/re2c"; \ - ./configure && make && make install; - -# Required: CMake >= 3.0.2 (default version is 2.8.12.2) -# Required to build libzip from source (has to be a separate RUN layer) -RUN source scl_source enable devtoolset-7; \ - set -eux; \ - /root/download-src.sh cmake https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4.tar.gz; \ - cd "${SRC_DIR}/cmake"; \ - ./bootstrap && make && make install; \ -# Required: libzip >= 0.11 (default version is 0.9) - /root/download-src.sh libzip https://libzip.org/download/libzip-1.7.3.tar.gz; \ - cd "${SRC_DIR}/libzip"; \ - mkdir build && cd build; \ - cmake .. && make && make install; - -RUN echo '#define SECBIT_NO_SETUID_FIXUP (1 << 2)' > '/usr/include/linux/securebits.h' - -ENV PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig" - -ENV PHP_SRC_DIR=/usr/local/src/php -ENV PHP_INSTALL_DIR=/opt/php - -RUN printf "source scl_source enable devtoolset-7" | tee -a /etc/profile.d/zzz-ddtrace.sh /etc/bashrc -ENV BASH_ENV="/etc/profile.d/zzz-ddtrace.sh" - -COPY switch-php /usr/local/bin/ diff --git a/dockerfiles/ci/centos/6/docker-compose.yml b/dockerfiles/ci/centos/6/docker-compose.yml deleted file mode 100644 index 3226b1c0e54..00000000000 --- a/dockerfiles/ci/centos/6/docker-compose.yml +++ /dev/null @@ -1,79 +0,0 @@ -version: '3' - -services: - base: - image: 'datadog/dd-trace-ci:centos-6' - build: - context: . - dockerfile: base.Dockerfile - - php-7.0: - build: - context: . - dockerfile: php7.Dockerfile - args: - phpVersion: "7.0" - phpTarGzUrl: https://www.php.net/distributions/php-7.0.33.tar.gz - phpSha256Hash: d71a6ecb6b13dc53fed7532a7f8f949c4044806f067502f8fb6f9facbb40452a - image: 'datadog/dd-trace-ci:php-7.0_centos-6' - - php-7.1: - build: - context: . - dockerfile: php7.Dockerfile - args: - phpVersion: "7.1" - phpTarGzUrl: https://www.php.net/distributions/php-7.1.33.tar.gz - phpSha256Hash: 0055f368ffefe51d5a4483755bd17475e88e74302c08b727952831c5b2682ea2 - image: 'datadog/dd-trace-ci:php-7.1_centos-6' - - php-7.2: - build: - context: . - dockerfile: php7.Dockerfile - args: - phpVersion: "7.2" - phpTarGzUrl: https://www.php.net/distributions/php-7.2.34.tar.gz - phpSha256Hash: 8b2777c741e83f188d3ca6d8e98ece7264acafee86787298fae57e05d0dddc78 - image: 'datadog/dd-trace-ci:php-7.2_centos-6' - - php-7.3: - build: - context: . - dockerfile: php7.Dockerfile - args: - phpVersion: "7.3" - phpTarGzUrl: https://www.php.net/distributions/php-7.3.33.tar.gz - phpSha256Hash: 9a369c32c6f52036b0a890f290327f148a1904ee66aa56e2c9a7546da6525ec8 - image: 'datadog/dd-trace-ci:php-7.3_centos-6' - - php-7.4: - build: - context: . - dockerfile: php7.Dockerfile - args: - phpVersion: "7.4" - phpTarGzUrl: https://www.php.net/distributions/php-7.4.30.tar.gz - phpSha256Hash: e37ea37e0f79109351ac615da85eb7c2c336101fc5bc802ee79a124a4310dc10 - image: 'datadog/dd-trace-ci:php-7.4_centos-6' - - php-8.0: - build: - context: . - dockerfile: php8.Dockerfile - args: - phpVersion: "8.0" - phpTarGzUrl: https://www.php.net/distributions/php-8.0.21.tar.gz - phpSha256Hash: 2f51f6e90e2e8efd3a20db08f0dd61d7f8d5a9362f8c7325f1ad28ccea5be0ac - image: 'datadog/dd-trace-ci:php-8.0_centos-6' - - php-8.1: - build: - context: . - dockerfile: php8.Dockerfile - args: - phpVersion: "8.1" - phpTarGzUrl: https://www.php.net/distributions/php-8.1.8.tar.gz - phpSha256Hash: 889d910558d2492f7f2236921b9bcde620674c8b684ec02d126060f8ca45dc8d - image: 'datadog/dd-trace-ci:php-8.1_centos-6' - diff --git a/dockerfiles/ci/centos/6/download-src.sh b/dockerfiles/ci/centos/6/download-src.sh deleted file mode 100755 index bac35fb3e8c..00000000000 --- a/dockerfiles/ci/centos/6/download-src.sh +++ /dev/null @@ -1,18 +0,0 @@ -set -e - -if [ -z "$SRC_DIR" ]; then - echo "SRC_DIR must be set" - exit 1 -fi -if [ -z "$1" ] || [ -z "$2" ]; then - echo "Usage: ./download-src.sh " - exit 1 -fi - -name="${1}" -url="${2}" - -mkdir -p "${SRC_DIR}/${name}" -curl -fsSL -o "/tmp/${name}.tar.gz" "${url}" -tar xf "/tmp/${name}.tar.gz" -C "${SRC_DIR}/${name}" --strip-components=1 -rm -f "/tmp/${name}.tar.gz" diff --git a/dockerfiles/ci/centos/6/dst-x3-expired.pem b/dockerfiles/ci/centos/6/dst-x3-expired.pem deleted file mode 100644 index 300cd7dc1b1..00000000000 --- a/dockerfiles/ci/centos/6/dst-x3-expired.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ -MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT -DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow -PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD -Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O -rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq -OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b -xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw -7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD -aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG -SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 -ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr -AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz -R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 -JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo -Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ ------END CERTIFICATE----- \ No newline at end of file diff --git a/dockerfiles/ci/centos/6/isrgrootx1.pem b/dockerfiles/ci/centos/6/isrgrootx1.pem deleted file mode 100644 index b85c8037f6b..00000000000 --- a/dockerfiles/ci/centos/6/isrgrootx1.pem +++ /dev/null @@ -1,31 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw -TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh -cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 -WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu -ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY -MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc -h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ -0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U -A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW -T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH -B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC -B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv -KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn -OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn -jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw -qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI -rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq -hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL -ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ -3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK -NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 -ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur -TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC -jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc -oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq -4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA -mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d -emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= ------END CERTIFICATE----- diff --git a/dockerfiles/ci/centos/6/php-7.0/configure.sh b/dockerfiles/ci/centos/6/php-7.0/configure.sh deleted file mode 100755 index 8a4198766ed..00000000000 --- a/dockerfiles/ci/centos/6/php-7.0/configure.sh +++ /dev/null @@ -1,30 +0,0 @@ -if [ -z "${PHP_SRC_DIR}" ]; then - echo "Please set PHP_SRC_DIR" - exit 1 -fi - -${PHP_SRC_DIR}/configure \ - --enable-option-checking=fatal \ - --enable-cgi \ - --enable-embed \ - --enable-fpm \ - --enable-ftp \ - --enable-mbstring \ - --enable-opcache \ - --enable-phpdbg \ - --enable-sockets \ - --enable-zip \ - --with-curl \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --with-libedit \ - --with-mhash \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-mysql=mysqlnd \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ - --with-pear \ - --with-readline \ - --with-zlib \ - $@ diff --git a/dockerfiles/ci/centos/6/php-7.1/configure.sh b/dockerfiles/ci/centos/6/php-7.1/configure.sh deleted file mode 100755 index 8a4198766ed..00000000000 --- a/dockerfiles/ci/centos/6/php-7.1/configure.sh +++ /dev/null @@ -1,30 +0,0 @@ -if [ -z "${PHP_SRC_DIR}" ]; then - echo "Please set PHP_SRC_DIR" - exit 1 -fi - -${PHP_SRC_DIR}/configure \ - --enable-option-checking=fatal \ - --enable-cgi \ - --enable-embed \ - --enable-fpm \ - --enable-ftp \ - --enable-mbstring \ - --enable-opcache \ - --enable-phpdbg \ - --enable-sockets \ - --enable-zip \ - --with-curl \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --with-libedit \ - --with-mhash \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-mysql=mysqlnd \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ - --with-pear \ - --with-readline \ - --with-zlib \ - $@ diff --git a/dockerfiles/ci/centos/6/php-7.2/configure.sh b/dockerfiles/ci/centos/6/php-7.2/configure.sh deleted file mode 100755 index 8a4198766ed..00000000000 --- a/dockerfiles/ci/centos/6/php-7.2/configure.sh +++ /dev/null @@ -1,30 +0,0 @@ -if [ -z "${PHP_SRC_DIR}" ]; then - echo "Please set PHP_SRC_DIR" - exit 1 -fi - -${PHP_SRC_DIR}/configure \ - --enable-option-checking=fatal \ - --enable-cgi \ - --enable-embed \ - --enable-fpm \ - --enable-ftp \ - --enable-mbstring \ - --enable-opcache \ - --enable-phpdbg \ - --enable-sockets \ - --enable-zip \ - --with-curl \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --with-libedit \ - --with-mhash \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-mysql=mysqlnd \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ - --with-pear \ - --with-readline \ - --with-zlib \ - $@ diff --git a/dockerfiles/ci/centos/6/php-7.3/configure.sh b/dockerfiles/ci/centos/6/php-7.3/configure.sh deleted file mode 100755 index 8a4198766ed..00000000000 --- a/dockerfiles/ci/centos/6/php-7.3/configure.sh +++ /dev/null @@ -1,30 +0,0 @@ -if [ -z "${PHP_SRC_DIR}" ]; then - echo "Please set PHP_SRC_DIR" - exit 1 -fi - -${PHP_SRC_DIR}/configure \ - --enable-option-checking=fatal \ - --enable-cgi \ - --enable-embed \ - --enable-fpm \ - --enable-ftp \ - --enable-mbstring \ - --enable-opcache \ - --enable-phpdbg \ - --enable-sockets \ - --enable-zip \ - --with-curl \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --with-libedit \ - --with-mhash \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-mysql=mysqlnd \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ - --with-pear \ - --with-readline \ - --with-zlib \ - $@ diff --git a/dockerfiles/ci/centos/6/php-7.4/configure.sh b/dockerfiles/ci/centos/6/php-7.4/configure.sh deleted file mode 100755 index 6e2acb7e827..00000000000 --- a/dockerfiles/ci/centos/6/php-7.4/configure.sh +++ /dev/null @@ -1,31 +0,0 @@ -if [ -z "${PHP_SRC_DIR}" ]; then - echo "Please set PHP_SRC_DIR" - exit 1 -fi - -${PHP_SRC_DIR}/configure \ - --enable-option-checking=fatal \ - --enable-cgi \ - --enable-embed \ - --enable-fpm \ - --enable-ftp \ - --enable-mbstring \ - --enable-opcache \ - --enable-phpdbg \ - --enable-sockets \ - --with-curl \ - --with-ffi \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --with-libedit \ - --with-mhash \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-mysql=mysqlnd \ - --with-pear \ - --with-readline \ - --with-zip \ - --with-zlib \ - --without-pdo-sqlite \ - --without-sqlite3 \ - $@ diff --git a/dockerfiles/ci/centos/6/php-8.0/configure.sh b/dockerfiles/ci/centos/6/php-8.0/configure.sh deleted file mode 100755 index 6e2acb7e827..00000000000 --- a/dockerfiles/ci/centos/6/php-8.0/configure.sh +++ /dev/null @@ -1,31 +0,0 @@ -if [ -z "${PHP_SRC_DIR}" ]; then - echo "Please set PHP_SRC_DIR" - exit 1 -fi - -${PHP_SRC_DIR}/configure \ - --enable-option-checking=fatal \ - --enable-cgi \ - --enable-embed \ - --enable-fpm \ - --enable-ftp \ - --enable-mbstring \ - --enable-opcache \ - --enable-phpdbg \ - --enable-sockets \ - --with-curl \ - --with-ffi \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --with-libedit \ - --with-mhash \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-mysql=mysqlnd \ - --with-pear \ - --with-readline \ - --with-zip \ - --with-zlib \ - --without-pdo-sqlite \ - --without-sqlite3 \ - $@ diff --git a/dockerfiles/ci/centos/6/php-8.1/configure.sh b/dockerfiles/ci/centos/6/php-8.1/configure.sh deleted file mode 100755 index 6e2acb7e827..00000000000 --- a/dockerfiles/ci/centos/6/php-8.1/configure.sh +++ /dev/null @@ -1,31 +0,0 @@ -if [ -z "${PHP_SRC_DIR}" ]; then - echo "Please set PHP_SRC_DIR" - exit 1 -fi - -${PHP_SRC_DIR}/configure \ - --enable-option-checking=fatal \ - --enable-cgi \ - --enable-embed \ - --enable-fpm \ - --enable-ftp \ - --enable-mbstring \ - --enable-opcache \ - --enable-phpdbg \ - --enable-sockets \ - --with-curl \ - --with-ffi \ - --with-fpm-user=www-data \ - --with-fpm-group=www-data \ - --with-libedit \ - --with-mhash \ - --with-mysqli=mysqlnd \ - --with-openssl \ - --with-pdo-mysql=mysqlnd \ - --with-pear \ - --with-readline \ - --with-zip \ - --with-zlib \ - --without-pdo-sqlite \ - --without-sqlite3 \ - $@ diff --git a/dockerfiles/ci/centos/6/php7.Dockerfile b/dockerfiles/ci/centos/6/php7.Dockerfile deleted file mode 100644 index a936d128edf..00000000000 --- a/dockerfiles/ci/centos/6/php7.Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -FROM datadog/dd-trace-ci:centos-6 as base - -ARG phpVersion -ENV PHP_INSTALL_DIR_ZTS=${PHP_INSTALL_DIR}/${phpVersion}-zts -ENV PHP_INSTALL_DIR_DEBUG_NTS=${PHP_INSTALL_DIR}/${phpVersion}-debug -ENV PHP_INSTALL_DIR_NTS=${PHP_INSTALL_DIR}/${phpVersion} -ENV PHP_VERSION="${phpVersion}" -COPY php-${phpVersion}/configure.sh /root/ - -# Download and extract PHP source -ARG phpTarGzUrl -ARG phpSha256Hash -RUN set -eux; \ - mkdir -p $PHP_SRC_DIR; \ - mkdir -p $PHP_INSTALL_DIR; \ - curl -fsSL -o /tmp/php.tar.gz "${phpTarGzUrl}"; \ - (echo "${phpSha256Hash} /tmp/php.tar.gz" | sha256sum -c -); \ - tar xf /tmp/php.tar.gz -C "${PHP_SRC_DIR}" --strip-components=1; \ - rm -f /tmp/php.tar.gz; - -FROM base as php-zts -RUN bash -c 'set -eux; \ - mkdir -p /tmp/build-php && cd /tmp/build-php; \ - /root/configure.sh \ - --enable-maintainer-zts \ - --prefix=${PHP_INSTALL_DIR_ZTS} \ - --with-config-file-path=${PHP_INSTALL_DIR_ZTS} \ - --with-config-file-scan-dir=${PHP_INSTALL_DIR_ZTS}/conf.d; \ - make -j "$((`nproc`+1))"; \ - make install; \ - mkdir -p ${PHP_INSTALL_DIR_ZTS}/conf.d;' - -FROM base as php-debug -RUN bash -c 'set -eux; \ - mkdir -p /tmp/build-php && cd /tmp/build-php; \ - /root/configure.sh \ - --enable-debug \ - --prefix=${PHP_INSTALL_DIR_DEBUG_NTS} \ - --with-config-file-path=${PHP_INSTALL_DIR_DEBUG_NTS} \ - --with-config-file-scan-dir=${PHP_INSTALL_DIR_DEBUG_NTS}/conf.d; \ - make -j "$((`nproc`+1))"; \ - make install; \ - mkdir -p ${PHP_INSTALL_DIR_DEBUG_NTS}/conf.d;' - -FROM base as php-nts -RUN bash -c 'set -eux; \ - mkdir -p /tmp/build-php && cd /tmp/build-php; \ - /root/configure.sh \ - --prefix=${PHP_INSTALL_DIR_NTS} \ - --with-config-file-path=${PHP_INSTALL_DIR_NTS} \ - --with-config-file-scan-dir=${PHP_INSTALL_DIR_NTS}/conf.d; \ - make -j "$((`nproc`+1))"; \ - make install; \ - mkdir -p ${PHP_INSTALL_DIR_NTS}/conf.d;' - -FROM base as final -COPY --from=php-zts $PHP_INSTALL_DIR_ZTS $PHP_INSTALL_DIR_ZTS -COPY --from=php-debug $PHP_INSTALL_DIR_DEBUG_NTS $PHP_INSTALL_DIR_DEBUG_NTS -COPY --from=php-nts $PHP_INSTALL_DIR_NTS $PHP_INSTALL_DIR_NTS - -RUN set -eux; \ -# Set the default PHP version - switch-php ${PHP_VERSION}; diff --git a/dockerfiles/ci/centos/6/php8.Dockerfile b/dockerfiles/ci/centos/6/php8.Dockerfile deleted file mode 100644 index b87850153e3..00000000000 --- a/dockerfiles/ci/centos/6/php8.Dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -FROM datadog/dd-trace-ci:centos-6 as base - -ARG phpVersion -ENV PHP_INSTALL_DIR_ZTS=${PHP_INSTALL_DIR}/${phpVersion}-zts -ENV PHP_INSTALL_DIR_DEBUG_NTS=${PHP_INSTALL_DIR}/${phpVersion}-debug -ENV PHP_INSTALL_DIR_NTS=${PHP_INSTALL_DIR}/${phpVersion} -ENV PHP_VERSION=${phpVersion} - -# Download and extract PHP source -ARG phpTarGzUrl -ARG phpSha256Hash -RUN set -eux; \ - mkdir -p $PHP_SRC_DIR; \ - mkdir -p $PHP_INSTALL_DIR; \ - curl -fsSL -o /tmp/php.tar.gz "${phpTarGzUrl}"; \ - (echo "${phpSha256Hash} /tmp/php.tar.gz" | sha256sum -c -); \ - tar xf /tmp/php.tar.gz -C "${PHP_SRC_DIR}" --strip-components=1; \ - rm -f /tmp/php.tar.gz; \ - ${PHP_SRC_DIR}/buildconf --force; - -FROM base as build -COPY php-${PHP_VERSION}/configure.sh /root/ - -FROM build as php-zts -RUN bash -c 'set -eux; \ - mkdir -p /tmp/build-php && cd /tmp/build-php; \ - /root/configure.sh \ - --enable-zts \ - --prefix=${PHP_INSTALL_DIR_ZTS} \ - --with-config-file-path=${PHP_INSTALL_DIR_ZTS} \ - --with-config-file-scan-dir=${PHP_INSTALL_DIR_ZTS}/conf.d; \ - make -j "$((`nproc`+1))"; \ - make install; \ - mkdir -p ${PHP_INSTALL_DIR_ZTS}/conf.d;' - -FROM build as php-debug -RUN bash -c 'set -eux; \ - mkdir -p /tmp/build-php && cd /tmp/build-php; \ - /root/configure.sh \ - --enable-debug \ - --prefix=${PHP_INSTALL_DIR_DEBUG_NTS} \ - --with-config-file-path=${PHP_INSTALL_DIR_DEBUG_NTS} \ - --with-config-file-scan-dir=${PHP_INSTALL_DIR_DEBUG_NTS}/conf.d; \ - make -j "$((`nproc`+1))"; \ - make install; \ - mkdir -p ${PHP_INSTALL_DIR_DEBUG_NTS}/conf.d;' - -FROM build as php-nts -RUN bash -c 'set -eux; \ - mkdir -p /tmp/build-php && cd /tmp/build-php; \ - /root/configure.sh \ - --prefix=${PHP_INSTALL_DIR_NTS} \ - --with-config-file-path=${PHP_INSTALL_DIR_NTS} \ - --with-config-file-scan-dir=${PHP_INSTALL_DIR_NTS}/conf.d; \ - make -j "$((`nproc`+1))"; \ - make install; \ - mkdir -p ${PHP_INSTALL_DIR_NTS}/conf.d;' - -FROM base as final -COPY --from=php-zts $PHP_INSTALL_DIR_ZTS $PHP_INSTALL_DIR_ZTS -COPY --from=php-debug $PHP_INSTALL_DIR_DEBUG_NTS $PHP_INSTALL_DIR_DEBUG_NTS -COPY --from=php-nts $PHP_INSTALL_DIR_NTS $PHP_INSTALL_DIR_NTS - -RUN set -eux; \ -# Set the default PHP version - switch-php ${PHP_VERSION}; diff --git a/dockerfiles/ci/centos/6/switch-php b/dockerfiles/ci/centos/6/switch-php deleted file mode 100755 index eed3b7c30e8..00000000000 --- a/dockerfiles/ci/centos/6/switch-php +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -set -e - -phpVersion=$1 - -if [ -z "${phpVersion}" ] || [ ! -f /opt/php/${phpVersion}/bin/php ]; then - echo "Invalid PHP version. Valid versions are:" - ls /opt/php - exit 1 -fi - -ln -sf /opt/php/${phpVersion}/bin/pear /usr/local/bin/pear -ln -sf /opt/php/${phpVersion}/bin/pecl /usr/local/bin/pecl -ln -sf /opt/php/${phpVersion}/bin/phar.phar /usr/local/bin/phar -ln -sf /opt/php/${phpVersion}/bin/php /usr/local/bin/php -ln -sf /opt/php/${phpVersion}/bin/php-cgi /usr/local/bin/php-cgi -ln -sf /opt/php/${phpVersion}/bin/php-config /usr/local/bin/php-config -ln -sf /opt/php/${phpVersion}/bin/phpdbg /usr/local/bin/phpdbg -ln -sf /opt/php/${phpVersion}/bin/phpize /usr/local/bin/phpize -ln -sf /opt/php/${phpVersion}/sbin/php-fpm /usr/local/bin/php-fpm diff --git a/dockerfiles/ci/centos/7/base.Dockerfile b/dockerfiles/ci/centos/7/base.Dockerfile index 7c697400776..b32ffcceae1 100644 --- a/dockerfiles/ci/centos/7/base.Dockerfile +++ b/dockerfiles/ci/centos/7/base.Dockerfile @@ -134,7 +134,7 @@ RUN set -eux; \ # PHP 8.4+ requires OpenSSL >= 1.1.1 RUN source scl_source enable devtoolset-7; set -ex; \ - /root/download-src.sh openssl https://openssl.org/source/old/1.1.1/openssl-1.1.1w.tar.gz; \ + /root/download-src.sh openssl https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1w/openssl-1.1.1w.tar.gz; \ cd "${SRC_DIR}/openssl"; \ mkdir -v 'build' && cd 'build'; \ ../config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl shared zlib; \ @@ -194,7 +194,7 @@ RUN source scl_source enable devtoolset-7; set -ex; \ ENV PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/openssl/lib/pkgconfig:/usr/local/zlib/lib/pkgconfig:/usr/local/curl/lib/pkgconfig:/usr/local/sqlite3/lib/pkgconfig" # Caution, takes a very long time! Since we have to build one from source, -# I picked LLVM 19, which matches Rust 1.84. +# I picked LLVM 20, which matches Rust 1.87. # Ordinarily we leave sources, but LLVM is 2GiB just for the sources... # Minimum: libclang. Nice-to-have: full toolchain including linker to play # with cross-language link-time optimization. Needs to match rustc -Vv's llvm @@ -211,7 +211,7 @@ RUN yum install -y --nogpgcheck devtoolset-9 \ && cd - \ && rm -fr "${SRC_DIR}/ninja" \ && cd /usr/local/src \ - && git clone --depth 1 -b release/19.x https://github.com/llvm/llvm-project.git \ + && git clone --depth 1 -b release/20.x https://github.com/llvm/llvm-project.git \ && mkdir -vp llvm-project/build \ && cd llvm-project/build \ && cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_TARGETS_TO_BUILD=host -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DLLVM_INCLUDE_TESTS=OFF -DLLVM_ENABLE_BINDINGS=OFF -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON ../llvm \ @@ -226,9 +226,9 @@ RUN yum install -y --nogpgcheck devtoolset-9 \ # rust sha256sum generated locally after verifying it with sha256 -ARG RUST_VERSION="1.84.1" -ARG RUST_SHA256_ARM="be89f6ad9b70cc4b25182ae299f94ab047a713a51fddf95284823c8afe4aef85" -ARG RUST_SHA256_X86="106c89f23ce1c763fcbea8e2714b2ba869bf7af70804813987a4483896398933" +ARG RUST_VERSION="1.87.0" +ARG RUST_SHA256_ARM="2c66e31d774a0dcd4422db74584ebc6362ff3ae90c452caff9d2fb912c821e8d" +ARG RUST_SHA256_X86="1f6f18ce19387c42968a474cf175e67f99280614ded9c752d5d2e37af3204bcd" # Mount a cache into /rust/cargo if you want to pre-fetch packages or something ENV CARGO_HOME=/rust/cargo ENV RUSTUP_HOME=/rust/rustup diff --git a/dockerfiles/ci/centos/7/docker-compose.yml b/dockerfiles/ci/centos/7/docker-compose.yml index fd29fa339a0..e1378570db4 100644 --- a/dockerfiles/ci/centos/7/docker-compose.yml +++ b/dockerfiles/ci/centos/7/docker-compose.yml @@ -95,8 +95,8 @@ services: x-bake: *bake args: phpVersion: "8.2" - phpTarGzUrl: https://www.php.net/distributions/php-8.2.30.tar.gz - phpSha256Hash: "a0fa6673ba4b0c8335fbab08afb7c2e13a3791f2b5a0928c7ad3d7ad872edf26" + phpTarGzUrl: https://www.php.net/distributions/php-8.2.31.tar.gz + phpSha256Hash: "083c2f61cc5f527eb293c4c468a91af46a9678785957e023b2796a9db290d870" image: 'datadog/dd-trace-ci:php-8.2_centos-7' php-8.3: @@ -106,8 +106,8 @@ services: x-bake: *bake args: phpVersion: "8.3" - phpTarGzUrl: https://www.php.net/distributions/php-8.3.30.tar.gz - phpSha256Hash: "e587dc95fb7f62730299fa7b36b6e4f91e6708aaefa2fff68a0098d320c16386" + phpTarGzUrl: https://www.php.net/distributions/php-8.3.31.tar.gz + phpSha256Hash: "4e7baaf0a690e954a20e7ced3dd633ce8cb8094e2b6b612a55e703ecbbdcbf4f" image: 'datadog/dd-trace-ci:php-8.3_centos-7' php-8.4: @@ -117,8 +117,8 @@ services: x-bake: *bake args: phpVersion: "8.4" - phpTarGzUrl: https://www.php.net/distributions/php-8.4.19.tar.gz - phpSha256Hash: "9e862435ffb533dc5b0eb486170a74e5f7c8095e8eb8819a2ff5aad430292a18" + phpTarGzUrl: https://www.php.net/distributions/php-8.4.21.tar.gz + phpSha256Hash: "db96ee0a8e5ee7b73a4913a2aeddc162ba2ef16cd34b9347b5b9a6150e1f8e48" image: 'datadog/dd-trace-ci:php-8.4_centos-7' php-8.5: @@ -128,6 +128,6 @@ services: x-bake: *bake args: phpVersion: "8.5" - phpTarGzUrl: https://www.php.net/distributions/php-8.5.4.tar.gz - phpSha256Hash: "4fef7f44eff3c18e329504cb0d3eb30b41cf54e2db05cb4ebe8b78fc37d38ce1" + phpTarGzUrl: https://www.php.net/distributions/php-8.5.6.tar.gz + phpSha256Hash: "169aaa21c2834b38df8e39169f43bc5bea8d4059a816cfbc59be08fc2bae60cd" image: 'datadog/dd-trace-ci:php-8.5_centos-7' diff --git a/dockerfiles/ci/windows/basetools.Dockerfile b/dockerfiles/ci/windows/basetools.Dockerfile index 1d71c6a5c07..001f9f553e9 100644 --- a/dockerfiles/ci/windows/basetools.Dockerfile +++ b/dockerfiles/ci/windows/basetools.Dockerfile @@ -6,7 +6,7 @@ RUN powershell.exe "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Ne # I really need some sane file editing utilities RUN powershell "Invoke-WebRequest https://ftp.nluug.nl/pub/vim/pc/vim90w32.zip -OutFile /tmp/vim90w32.zip; Expand-Archive /tmp/vim90w32.zip /tmp; move C:\tmp\vim\vim90\tee.exe C:\Windows\tee.exe; move C:\tmp\vim\vim90\vim.exe C:\Windows\vim.exe; move C:\tmp\vim\vim90\xxd.exe C:\Windows\xxd.exe; Remove-Item /tmp/vim90w32.zip; Remove-Item -Recurse C:\tmp\vim" -RUN powershell "Invoke-WebRequest https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile /tmp/rustup-init.exe; cmd /S /C /tmp/rustup-init.exe --profile minimal -y --default-toolchain=1.84.1; Remove-Item /tmp/rustup-init.exe" +RUN powershell "Invoke-WebRequest https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile /tmp/rustup-init.exe; cmd /S /C /tmp/rustup-init.exe --profile minimal -y --default-toolchain=1.87.0; Remove-Item /tmp/rustup-init.exe" RUN choco install -y cmake RUN choco install -y nasm @@ -18,5 +18,9 @@ RUN powershell "[Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\P ARG sdkVersion RUN powershell "cd /tmp; Invoke-WebRequest https://github.com/php/php-sdk-binary-tools/archive/refs/tags/php-sdk-%sdkVersion%.zip -OutFile php-sdk.zip; Expand-Archive php-sdk.zip; move php-sdk\php-sdk-binary-tools-php-sdk-%sdkVersion% /php-sdk; Remove-Item php-sdk; Remove-Item php-sdk.zip" +# Older PHP SDK tags expect Apache indexes to prefix package links with /. +RUN powershell "$config = 'C:\php-sdk\lib\php\libsdk\SDK\Config.php'; $text = [IO.File]::ReadAllText($config).Replace(',/packages-', ',>packages-'); if ($text.Contains(',/packages-')) { throw 'Failed to patch PHP SDK dependency series regex' }; [IO.File]::WriteAllText($config, $text, [System.Text.Encoding]::ASCII)" +# The PHP downloads CDN rejects the SDK's user-agent for some reason. +RUN powershell "$fileOps = 'C:\php-sdk\lib\php\libsdk\SDK\FileOps.php'; $text = [IO.File]::ReadAllText($fileOps); $text = $text -replace '(?m)^\s*curl_setopt\(\$ch, CURLOPT_USERAGENT, Config::getSdkUserAgentName\(\)\);\r?\n?', ''; if ($text.Contains('CURLOPT_USERAGENT')) { throw 'Failed to remove PHP SDK curl user-agent' }; [IO.File]::WriteAllText($fileOps, $text, [System.Text.Encoding]::ASCII)" WORKDIR /php-sdk diff --git a/dockerfiles/ci/windows/docker-compose.yml b/dockerfiles/ci/windows/docker-compose.yml index 6548f22c4fb..2e87bdc12fc 100644 --- a/dockerfiles/ci/windows/docker-compose.yml +++ b/dockerfiles/ci/windows/docker-compose.yml @@ -2,14 +2,6 @@ version: '3.7' services: - vc14-base: - image: datadog/dd-trace-ci:windows-base-vc14 - build: - platforms: - - windows/amd64 - context: . - dockerfile: vc14.Dockerfile - vc15-base: image: datadog/dd-trace-ci:windows-base-vc15 build: @@ -34,17 +26,6 @@ services: context: . dockerfile: vs17.Dockerfile - vc14: - image: datadog/dd-trace-ci:windows-vc14 - build: - platforms: - - windows/amd64 - context: . - dockerfile: basetools.Dockerfile - args: - vsVersion: "vc14" - sdkVersion: "2.1.10" - vc15: image: datadog/dd-trace-ci:windows-vc15 build: @@ -85,10 +66,10 @@ services: - windows/amd64 context: . args: - phpVersion: "8.5.0" + phpVersion: "8.5.6" vsVersion: "vs17" - phpTarGzUrl: https://downloads.php.net/~daniels/php-8.5.0RC3.tar.gz - phpSha256Hash: "937e544d72ee1eb28d2190cadaadf8e5e8d7d8c365b5c1f6a99b4f979a1f3a1b" + 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 @@ -97,10 +78,10 @@ services: - windows/amd64 context: . args: - phpVersion: "8.4.1" + phpVersion: "8.4.21" vsVersion: "vs17" - phpTarGzUrl: https://www.php.net/distributions/php-8.4.1.tar.gz - phpSha256Hash: "c3d1ce4157463ea43004289c01172deb54ce9c5894d8722f4e805461bf9feaec" + 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 @@ -109,10 +90,10 @@ services: - windows/amd64 context: . args: - phpVersion: "8.3.9" + phpVersion: "8.3.31" vsVersion: "vs16" - phpTarGzUrl: https://www.php.net/distributions/php-8.3.9.tar.gz - phpSha256Hash: "f484dec6ee005c83f899af02fc021e1bc3b1d7b3f143ca062ef66b0fcee96566" + 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 @@ -121,10 +102,10 @@ services: - windows/amd64 context: . args: - phpVersion: "8.2.21" + phpVersion: "8.2.31" vsVersion: "vs16" - phpTarGzUrl: https://www.php.net/distributions/php-8.2.21.tar.gz - phpSha256Hash: "0c6323699309a4d2e71057f01bc071b199f240973c349287b667a3ab36a496c6" + 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 @@ -133,10 +114,10 @@ services: - windows/amd64 context: . args: - phpVersion: "8.1.29" + phpVersion: "8.1.32" vsVersion: "vs16" - phpTarGzUrl: https://www.php.net/distributions/php-8.1.29.tar.gz - phpSha256Hash: "8b2609bf1d3173aa38269a9af21532c65f730aadd3051f9aae011eea9e246de5" + 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 @@ -145,10 +126,10 @@ services: - windows/amd64 context: . args: - phpVersion: "8.0.28" + phpVersion: "8.0.30" vsVersion: "vs16" - phpTarGzUrl: https://www.php.net/distributions/php-8.0.28.tar.gz - phpSha256Hash: "7432184eae01e4e8e39f03f80e8ec0ca2c8bfebc56e9a7b983541ca8805df22f" + 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 @@ -185,27 +166,3 @@ services: 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 - build: - platforms: - - windows/amd64 - context: . - args: - 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 - build: - platforms: - - windows/amd64 - context: . - args: - phpVersion: "7.0.33" - vsVersion: "vc14" - phpTarGzUrl: https://www.php.net/distributions/php-7.0.33.tar.gz - phpSha256Hash: d71a6ecb6b13dc53fed7532a7f8f949c4044806f067502f8fb6f9facbb40452a diff --git a/dockerfiles/ci/windows/vc14.Dockerfile b/dockerfiles/ci/windows/vc14.Dockerfile deleted file mode 100644 index 1649c444412..00000000000 --- a/dockerfiles/ci/windows/vc14.Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:1809 - -# https://aka.ms/vs/14/release/vs_buildtools.exe has been removed -ADD vs14_buildtools.exe /tmp/vs_buildtools.exe -RUN /tmp/vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.Net.Component.4.7.SDK --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.17763 diff --git a/dockerfiles/ci/windows/vc15.Dockerfile b/dockerfiles/ci/windows/vc15.Dockerfile index 3c1114c01b9..91d06ec881d 100644 --- a/dockerfiles/ci/windows/vc15.Dockerfile +++ b/dockerfiles/ci/windows/vc15.Dockerfile @@ -2,3 +2,4 @@ FROM mcr.microsoft.com/windows/servercore:1809 ADD https://aka.ms/vs/15/release/vs_buildtools.exe /tmp/vs_buildtools.exe RUN powershell "cmd /S /C /tmp/vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.17763; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\Hostx86'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\lib\onecore'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\lib\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Redist\MSVC\14.16.27012\onecore'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Redist\MSVC\14.16.27012\debug_nonredist\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\arm64'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\arm64'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\arm64'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Testing'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\cppwinrt\'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt\'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\References'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Remote\ARM'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Remote\x86'; Remove-Item -Recurse 'C:\Users\ContainerAdministrator\AppData\Local\Temp\*'" +RUN powershell "$ErrorActionPreference = 'Stop'; $vcvars = 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat'; if (-not (Test-Path $vcvars)) { Write-Error ('vcvarsall.bat not found at ' + $vcvars); exit 3 }; $q = [char]34; $cmd = 'call ' + $q + $vcvars + $q + ' amd64 >NUL && where cl.exe && where link.exe'; cmd /S /C $cmd; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }" diff --git a/dockerfiles/ci/windows/vs14_buildtools.exe b/dockerfiles/ci/windows/vs14_buildtools.exe deleted file mode 100644 index beda411485d..00000000000 Binary files a/dockerfiles/ci/windows/vs14_buildtools.exe and /dev/null differ diff --git a/dockerfiles/ci/windows/vs16.Dockerfile b/dockerfiles/ci/windows/vs16.Dockerfile index 0e7c441c47c..f88f1d341e1 100644 --- a/dockerfiles/ci/windows/vs16.Dockerfile +++ b/dockerfiles/ci/windows/vs16.Dockerfile @@ -2,3 +2,4 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2019 ADD https://aka.ms/vs/16/release/vs_buildtools.exe /tmp/vs_buildtools.exe RUN powershell "cmd /S /C /tmp/vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.19041; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx86'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\onecore'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Redist\MSVC\14.29.30133\onecore'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Redist\MSVC\14.29.30133\debug_nonredist\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\arm64'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\arm64'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm64'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Testing'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt\'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt\'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\References'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Remote\ARM'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Remote\x86'; Remove-Item -Recurse 'C:\Users\ContainerAdministrator\AppData\Local\Temp\*'" +RUN powershell "$ErrorActionPreference = 'Stop'; $vcvars = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat'; if (-not (Test-Path $vcvars)) { Write-Error ('vcvarsall.bat not found at ' + $vcvars); exit 3 }; $q = [char]34; $cmd = 'call ' + $q + $vcvars + $q + ' amd64 >NUL && where cl.exe && where link.exe'; cmd /S /C $cmd; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }" diff --git a/dockerfiles/ci/windows/vs17.Dockerfile b/dockerfiles/ci/windows/vs17.Dockerfile index d28649f84a7..0764b961bb5 100644 --- a/dockerfiles/ci/windows/vs17.Dockerfile +++ b/dockerfiles/ci/windows/vs17.Dockerfile @@ -2,3 +2,4 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2019 ADD https://aka.ms/vs/17/release/vs_buildtools.exe /tmp/vs_buildtools.exe RUN powershell "cmd /S /C /tmp/vs_buildtools.exe --quiet --wait --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.19041; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\bin\Hostx86'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\lib\onecore'; Remove-Item -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\lib\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\arm64'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\arm64'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\arm64'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Testing'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\cppwinrt\'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt\'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\References'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Remote\ARM'; Remove-Item -Recurse 'C:\Program Files (x86)\Windows Kits\10\Remote\x86'; Remove-Item -Recurse 'C:\Users\ContainerAdministrator\AppData\Local\Temp\*'" +RUN powershell "$ErrorActionPreference = 'Stop'; $vcvars = 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat'; if (-not (Test-Path $vcvars)) { Write-Error ('vcvarsall.bat not found at ' + $vcvars); exit 3 }; $q = [char]34; $cmd = 'call ' + $q + $vcvars + $q + ' amd64 >NUL && where cl.exe && where link.exe'; cmd /S /C $cmd; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }" diff --git a/dockerfiles/ci/xfail_tests/8.4.list b/dockerfiles/ci/xfail_tests/8.4.list index 3ef7b4ef41f..65f7991c9a5 100644 --- a/dockerfiles/ci/xfail_tests/8.4.list +++ b/dockerfiles/ci/xfail_tests/8.4.list @@ -12,8 +12,9 @@ Zend/tests/bug72038.phpt Zend/tests/bug75921.phpt Zend/tests/bug78182.phpt Zend/tests/bug81104.phpt -Zend/tests/fibers/gh10496-001.phpt Zend/tests/fibers/destructors_005.phpt +Zend/tests/fibers/gh10496-001.phpt +Zend/tests/fibers/gh19983.phpt Zend/tests/fibers/out-of-memory-in-fiber.phpt Zend/tests/fibers/out-of-memory-in-nested-fiber.phpt Zend/tests/fibers/out-of-memory-in-recursive-fiber.phpt diff --git a/dockerfiles/ci/xfail_tests/8.5.list b/dockerfiles/ci/xfail_tests/8.5.list index 0f467d89fb3..dce97c2e566 100644 --- a/dockerfiles/ci/xfail_tests/8.5.list +++ b/dockerfiles/ci/xfail_tests/8.5.list @@ -13,8 +13,9 @@ Zend/tests/bug72038.phpt Zend/tests/bug75921.phpt Zend/tests/bug78182.phpt Zend/tests/bug81104.phpt -Zend/tests/fibers/gh10496-001.phpt Zend/tests/fibers/destructors_005.phpt +Zend/tests/fibers/gh10496-001.phpt +Zend/tests/fibers/gh19983.phpt Zend/tests/fibers/out-of-memory-in-fiber.phpt Zend/tests/fibers/out-of-memory-in-nested-fiber.phpt Zend/tests/fibers/out-of-memory-in-recursive-fiber.phpt diff --git a/dockerfiles/ci/xfail_tests/README.md b/dockerfiles/ci/xfail_tests/README.md index 03e8903e422..0b39356cae6 100644 --- a/dockerfiles/ci/xfail_tests/README.md +++ b/dockerfiles/ci/xfail_tests/README.md @@ -202,6 +202,10 @@ ddtrace request init hook consumes more than 2 MB of memory and fails too early ddtrace affects the order of destructor execution due to creating span stacks etc. +## `Zend/tests/fibers/gh19983.phpt` + +ddtrace creates a SpanStack per fiber, which will simply recurse too deeply. + ## `Zend/tests/stack_limit/stack_limit_013.phpt` This particular test is very close to the stack limit, and thus sometimes fails to actually exceed the stack limit with ddtrace. diff --git a/dockerfiles/verify_packages/Makefile b/dockerfiles/verify_packages/Makefile index 4e242b9dc24..a4ea058be87 100644 --- a/dockerfiles/verify_packages/Makefile +++ b/dockerfiles/verify_packages/Makefile @@ -19,7 +19,7 @@ $(CENTOS6_PHP_VERSIONS): %.centos6: # 2. From this folder: # - Example alpine: make verify_alpine DOCKER_IMAGE=alpine:3.10 PHP_PACKAGE="php7 php7-fpm" # - Example centos: make verify_centos DOCKER_IMAGE=centos:7 PHP_MAJOR=7 PHP_MINOR=4 -# - Example debian: make verify_debian DOCKER_IMAGE=debian:buster INSTALL_MODE=sury PHP_VERSION=7.4 +# - Example debian: make verify_debian DOCKER_IMAGE=debian:bookworm INSTALL_MODE=sury PHP_VERSION=7.4 verify_alpine: docker-compose run --rm \ -e VERIFY_APACHE=no \ diff --git a/libdatadog b/libdatadog index cea1e44eddd..dd71a87702a 160000 --- a/libdatadog +++ b/libdatadog @@ -1 +1 @@ -Subproject commit cea1e44edddd9124f75d5095f31026904a1f58d8 +Subproject commit dd71a87702aa4ed6c5f09399a72d42eaa98d3cf1 diff --git a/profiling/Cargo.toml b/profiling/Cargo.toml index 62a2e9ab46f..77a8e25bb50 100644 --- a/profiling/Cargo.toml +++ b/profiling/Cargo.toml @@ -3,7 +3,7 @@ name = "datadog-php-profiling" version = "0.0.0" edition = "2021" license = "Apache-2.0" -rust-version = "1.84.1" +rust-version = "1.87.0" [profile.release] panic = "abort" diff --git a/profiling/rust-toolchain.toml b/profiling/rust-toolchain.toml index fcb78ec564f..b8889a3bb3b 100644 --- a/profiling/rust-toolchain.toml +++ b/profiling/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.84.1" +channel = "1.87.0" diff --git a/tooling/bin/build-debug-artifact b/tooling/bin/build-debug-artifact index 135f5392aac..2b8759af0c5 100755 --- a/tooling/bin/build-debug-artifact +++ b/tooling/bin/build-debug-artifact @@ -115,7 +115,7 @@ case "$php_version" in esac # ─── Docker image selection ─────────────────────────────────────────────────── -BOOKWORM_VERSION=6 +BOOKWORM_VERSION=8 if [[ "$libc" == "musl" ]]; then DOCKER_IMAGE="datadog/dd-trace-ci:php-compile-extension-alpine-${php_version}" else @@ -244,7 +244,7 @@ cp tmp/build_extension/modules/ddtrace.so /output/ddtrace.so")" if [[ "$BUILD_PROFILER" == "1" ]]; then PROFILER_SCRIPT="$(_preamble "if [ -f /sbin/apk ] && [ \$(uname -m) = 'aarch64' ]; then - ln -sf ../lib/llvm19/bin/clang /usr/bin/clang + ln -sf ../lib/llvm20/bin/clang /usr/bin/clang fi (cd profiling && CARGO_TARGET_DIR=${HOME_DIR}/tmp/build_profiler cargo build --profile dev) cp ${HOME_DIR}/tmp/build_profiler/debug/libdatadog_php_profiling.so /output/datadog-profiling${EXT_SUFFIX}.so")" diff --git a/tooling/metrics/Makefile b/tooling/metrics/Makefile index 01ecaf47b8a..235f34d56b0 100644 --- a/tooling/metrics/Makefile +++ b/tooling/metrics/Makefile @@ -1,4 +1,4 @@ -# Use this Makefile from within a .-buster development images. +# Use this Makefile from within a .-bookworm development images. TMP_FOLDER := /tmp/sirun RESULTS_FILE := $(TMP_FOLDER)/results.txt