Skip to content

Commit 13d44b8

Browse files
Merge branch 'master' into florian/fix-allocs
2 parents 446ec2d + 4a26042 commit 13d44b8

File tree

211 files changed

+178489
-501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+178489
-501
lines changed

.github/workflows/prof_asan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
php-version: [8.3, 8.4]
1212
container:
13-
image: datadog/dd-trace-ci:php-${{matrix.php-version}}_bookworm-5
13+
image: datadog/dd-trace-ci:php-${{matrix.php-version}}_bookworm-6
1414
# https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
1515
options: --user root --privileged
1616

.github/workflows/prune-stale.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Prune
2+
on:
3+
schedule:
4+
- cron: '0 3 1 * *'
5+
workflow_dispatch:
6+
7+
jobs:
8+
prune:
9+
name: Prune
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
steps:
15+
- name: Prune
16+
uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
17+
with:
18+
days-before-stale: 180
19+
stale-pr-message: 'This pull request has been marked as stale because it has not had activity in the past half year. It will be closed in 7 days if no further activity occurs. Feel free to reopen it if you are still working on it.'
20+
close-pr-message: 'This pull request has been closed because it has not had activity over the past half year. Feel free to reopen it if you are still working on it.'
21+
stale-issue-message: 'This issue has been marked as stale because it has not had activity in the past half year. It will be closed in 7 days if no further activity occurs. Feel free to reopen it if you are still working on it.'
22+
close-issue-message: 'This issue has been closed because it has not had activity over the past half year. Feel free to reopen it if you are still working on it.'
23+
stale-pr-label: 'tag: stale'
24+
operations-per-run: 50

.gitlab/generate-appsec.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"test appsec extension":
6969
stage: test
7070
extends: .appsec_test
71-
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-5
71+
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-6
7272
variables:
7373
KUBERNETES_CPU_REQUEST: 3
7474
KUBERNETES_MEMORY_REQUEST: 3Gi
@@ -142,6 +142,16 @@
142142

143143
TERM=dumb ./gradlew $targets --info -Pbuildscan --scan
144144
TERM=dumb ./gradlew saveCaches --info
145+
after_script:
146+
- mkdir -p "${CI_PROJECT_DIR}/artifacts"
147+
- find appsec/tests/integration/build/test-results -name "*.xml" -exec cp --parents '{}' "${CI_PROJECT_DIR}/artifacts/" \;
148+
- .gitlab/upload-junit-to-datadog.sh "test.source.file:appsec"
149+
artifacts:
150+
reports:
151+
junit: "artifacts/**/test-results/**/TEST-*.xml"
152+
paths:
153+
- "artifacts/"
154+
when: "always"
145155
cache:
146156
- key: "appsec int test cache"
147157
paths:
@@ -150,7 +160,7 @@
150160
"appsec code coverage":
151161
stage: test
152162
extends: .appsec_test
153-
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.3_bookworm-5
163+
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.3_bookworm-6
154164
variables:
155165
KUBERNETES_CPU_REQUEST: 3
156166
KUBERNETES_MEMORY_REQUEST: 3Gi
@@ -253,7 +263,7 @@
253263
"appsec lint":
254264
stage: test
255265
extends: .appsec_test
256-
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.3_bookworm-5
266+
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.3_bookworm-6
257267
variables:
258268
KUBERNETES_CPU_REQUEST: 3
259269
KUBERNETES_MEMORY_REQUEST: 9Gi
@@ -275,7 +285,7 @@
275285
"test appsec helper asan":
276286
stage: test
277287
extends: .appsec_test
278-
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-5
288+
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-6
279289
variables:
280290
KUBERNETES_CPU_REQUEST: 3
281291
KUBERNETES_MEMORY_REQUEST: 3Gi
@@ -301,7 +311,7 @@
301311
#"fuzz appsec helper":
302312
# stage: test
303313
# extends: .appsec_test
304-
# image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-5
314+
# image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-6
305315
# variables:
306316
# KUBERNETES_CPU_REQUEST: 3
307317
# KUBERNETES_MEMORY_REQUEST: 5Gi

.gitlab/generate-package.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
$asan_build_platforms = [
4949
[
5050
"triplet" => "x86_64-unknown-linux-gnu",
51-
"image_template" => "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-%s_bookworm-5",
51+
"image_template" => "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-%s_bookworm-6",
5252
"arch" => "amd64",
5353
"host_os" => "linux-gnu",
5454
],
5555
[
5656
"triplet" => "aarch64-unknown-linux-gnu",
57-
"image_template" => "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-%s_bookworm-5",
57+
"image_template" => "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-%s_bookworm-6",
5858
"arch" => "arm64",
5959
"host_os" => "linux-gnu",
6060
]
@@ -282,7 +282,7 @@
282282

283283
"pecl build":
284284
stage: tracing
285-
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-7.4_bookworm-5"
285+
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-7.4_bookworm-6"
286286
tags: [ "arch:amd64" ]
287287
needs: [ "prepare code" ]
288288
script:
@@ -332,7 +332,7 @@
332332
<?php foreach ($arch_targets as $arch): ?>
333333
"aggregate tracing extension: [<?= $arch ?>]":
334334
stage: tracing
335-
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-7.4_bookworm-5"
335+
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-7.4_bookworm-6"
336336
tags: [ "arch:amd64" ]
337337
script: ls ./
338338
variables:
@@ -1084,7 +1084,7 @@
10841084

10851085
"pecl tests":
10861086
stage: verify
1087-
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_VERSION}_bookworm-5"
1087+
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_VERSION}_bookworm-6"
10881088
tags: [ "arch:amd64" ]
10891089
services:
10901090
- !reference [.services, request-replayer]
@@ -1235,7 +1235,7 @@
12351235
variables:
12361236
VALGRIND: false
12371237
ARCH: "<?= $arch ?>"
1238-
CONTAINER_SUFFIX: bookworm-5
1238+
CONTAINER_SUFFIX: bookworm-6
12391239
needs:
12401240
- job: "package loader: [<?= $arch ?>]"
12411241
artifacts: true

.gitlab/generate-profiler.php

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,29 @@
4545

4646
- '# NTS'
4747
- command -v switch-php && switch-php "${PHP_MAJOR_MINOR}"
48-
- cargo build --profile profiler-release --all-features
49-
- (cd tests; php run-tests.php -d "extension=/mnt/ramdisk/cargo/profiler-release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt")
48+
- cargo build --profile profiler-release
49+
- mkdir -p "${CI_PROJECT_DIR}/artifacts/profiler-tests"
50+
- (cd tests; TEST_PHP_JUNIT="${CI_PROJECT_DIR}/artifacts/profiler-tests/nts-results.xml" php run-tests.php -d "extension=/mnt/ramdisk/cargo/profiler-release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt")
5051

5152
- touch build.rs #make sure `build.rs` gets executed after `switch-php` call
5253

5354
- '# ZTS'
5455
- command -v switch-php && switch-php "${PHP_MAJOR_MINOR}-zts"
55-
- cargo build --profile profiler-release --all-features
56-
- (cd tests; php run-tests.php -d "extension=/mnt/ramdisk/cargo/profiler-release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt")
56+
- cargo build --profile profiler-release
57+
- (cd tests; TEST_PHP_JUNIT="${CI_PROJECT_DIR}/artifacts/profiler-tests/zts-results.xml" php run-tests.php -d "extension=/mnt/ramdisk/cargo/profiler-release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt")
58+
after_script:
59+
- .gitlab/upload-junit-to-datadog.sh "test.source.file:profiling"
60+
artifacts:
61+
reports:
62+
junit: "artifacts/profiler-tests/*.xml"
63+
paths:
64+
- "artifacts/"
65+
when: "always"
5766

5867
"clippy NTS":
5968
stage: test
6069
tags: [ "arch:amd64" ]
61-
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-5
70+
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-6
6271
variables:
6372
KUBERNETES_CPU_REQUEST: 5
6473
KUBERNETES_MEMORY_REQUEST: 3Gi
@@ -74,3 +83,17 @@
7483
- sed -i -e "s/crate-type.*$/crate-type = [\"rlib\"]/g" Cargo.toml
7584
- cargo clippy --all-targets --all-features -- -D warnings -Aunknown-lints
7685

86+
"Cargo test":
87+
stage: test
88+
tags: [ "arch:amd64" ]
89+
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-8.5_bookworm-5
90+
variables:
91+
KUBERNETES_CPU_REQUEST: 5
92+
KUBERNETES_MEMORY_REQUEST: 3Gi
93+
KUBERNETES_MEMORY_LIMIT: 4Gi
94+
# CARGO_TARGET_DIR: /mnt/ramdisk/cargo # ramdisk??
95+
libdir: /tmp/datadog-profiling
96+
script:
97+
- switch-php nts # not compatible with debug
98+
- cd profiling
99+
- cargo test --all-features

.gitlab/generate-shared.php

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,55 @@
2121
- IMAGE:
2222
- "datadog/dd-trace-ci:centos-7"
2323
- "datadog/dd-trace-ci:php-compile-extension-alpine"
24-
- "datadog/dd-trace-ci:bookworm-5"
24+
- "datadog/dd-trace-ci:bookworm-6"
2525
script:
2626
- if [ -f "/opt/libuv/lib/pkgconfig/libuv.pc" ]; then export PKG_CONFIG_PATH="/opt/libuv/lib/pkgconfig:$PKG_CONFIG_PATH"; fi
2727
- if [ -d "/opt/catch2" ]; then export CMAKE_PREFIX_PATH=/opt/catch2; fi
2828
- mkdir -p tmp/build_php_components_asan && cd tmp/build_php_components_asan
2929
- cmake $([ -f "/etc/debian_version" ] && echo "-DCMAKE_TOOLCHAIN_FILE=../../cmake/asan.cmake") -DCMAKE_BUILD_TYPE=Debug -DDATADOG_PHP_TESTING=ON ../../components
3030
- make -j all
31-
- make test
31+
- mkdir -p "${CI_PROJECT_DIR}/artifacts"
32+
- make test ARGS="--output-junit ${CI_PROJECT_DIR}/artifacts/components-asan-results.xml --output-on-failure"
3233
after_script:
3334
- mkdir -p tmp/artifacts
34-
- cp tmp/build_php_components_asan/Testing/Temporary/LastTest.log tmp/artifacts/LastTestUBSan.log
35+
- cp tmp/build_php_components_asan/Testing/Temporary/LastTest.log tmp/artifacts/LastTestASan.log
36+
- .gitlab/upload-junit-to-datadog.sh "test.source.file:components-rs"
3537
artifacts:
38+
reports:
39+
junit: "artifacts/*-results.xml"
3640
paths:
3741
- tmp/artifacts
42+
- artifacts
43+
when: "always"
3844

3945
"C components UBSAN":
4046
tags: [ "arch:amd64" ]
4147
stage: test
42-
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-5"
48+
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:bookworm-6"
4349
needs: []
4450
script:
4551
- if [ -f "/opt/libuv/lib/pkgconfig/libuv.pc" ]; then export PKG_CONFIG_PATH="/opt/libuv/lib/pkgconfig:$PKG_CONFIG_PATH"; fi
4652
- mkdir -p tmp/build_php_components_ubsan && cd tmp/build_php_components_ubsan
4753
- CMAKE_PREFIX_PATH=/opt/catch2 cmake -DCMAKE_TOOLCHAIN_FILE=../../cmake/ubsan.cmake -DCMAKE_BUILD_TYPE=Debug -DDATADOG_PHP_TESTING=ON ../../components
4854
- make -j all
49-
- make test ARGS="--output-on-failure --repeat until-fail:10" # channel is non-deterministic, so run tests a few more times. At the moment, Catch2 tests are not automatically adding labels, so run all tests instead of just channel's: https://github.com/catchorg/Catch2/issues/1590
55+
- mkdir -p "${CI_PROJECT_DIR}/artifacts"
56+
- make test ARGS="--output-junit ${CI_PROJECT_DIR}/artifacts/components-ubsan-results.xml --output-on-failure --repeat until-fail:10" # channel is non-deterministic, so run tests a few more times. At the moment, Catch2 tests are not automatically adding labels, so run all tests instead of just channel's: https://github.com/catchorg/Catch2/issues/1590
5057
after_script:
5158
- mkdir -p tmp/artifacts
52-
- cp tmp/build_php_components_ubsan/Testing/Temporary/LastTest.log tmp/artifacts/LastTestASan.log
59+
- cp tmp/build_php_components_ubsan/Testing/Temporary/LastTest.log tmp/artifacts/LastTestUBSan.log
60+
- .gitlab/upload-junit-to-datadog.sh "test.source.file:components-rs"
5361
artifacts:
62+
reports:
63+
junit: "artifacts/*-results.xml"
5464
paths:
5565
- tmp/artifacts
66+
- artifacts
67+
when: "always"
5668

5769
"Build & Test Tea":
5870
tags: [ "arch:amd64" ]
5971
stage: build
60-
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-5"
72+
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-6"
6173
parallel:
6274
matrix:
6375
- PHP_MAJOR_MINOR: *no_asan_minor_major_targets
@@ -67,20 +79,26 @@
6779
script:
6880
- sh .gitlab/build-tea.sh $SWITCH_PHP_VERSION
6981
- cd tmp/build-tea-${SWITCH_PHP_VERSION}
70-
- make test
82+
- mkdir -p "${CI_PROJECT_DIR}/artifacts"
83+
- make test ARGS="--output-junit ${CI_PROJECT_DIR}/artifacts/tea-${SWITCH_PHP_VERSION}-results.xml --output-on-failure"
7184
- grep -e "=== Total [0-9]+ memory leaks detected ===" Testing/Temporary/LastTest.log && exit 1 || true
7285
after_script:
7386
- mkdir -p tmp/artifacts/
74-
- cp tmp/build-tea-${SWITCH_PHP_VERSION}/Testing/Temporary/LastTest.log tmp/artifacts/LastTestASan.log
87+
- cp tmp/build-tea-${SWITCH_PHP_VERSION}/Testing/Temporary/LastTest.log tmp/artifacts/LastTest.log
88+
- .gitlab/upload-junit-to-datadog.sh "test.source.file:zend_abstract_interface"
7589
artifacts:
90+
reports:
91+
junit: "artifacts/*-results.xml"
7692
paths:
7793
- tmp/tea
7894
- tmp/artifacts
95+
- artifacts
96+
when: "always"
7997

8098
.tea_test:
8199
tags: [ "arch:amd64" ]
82100
stage: test
83-
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-5"
101+
image: "registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-6"
84102
interruptible: true
85103
rules:
86104
- if: $CI_COMMIT_BRANCH == "master"
@@ -89,9 +107,14 @@
89107
after_script:
90108
- mkdir -p tmp/artifacts
91109
- cp tmp/build*/Testing/Temporary/LastTest.log tmp/artifacts/LastTest.log
110+
- .gitlab/upload-junit-to-datadog.sh "test.source.file:zend_abstract_interface"
92111
artifacts:
112+
reports:
113+
junit: "artifacts/*-results.xml"
93114
paths:
94115
- tmp/artifacts
116+
- artifacts
117+
when: "always"
95118

96119
<?php
97120
foreach ($all_minor_major_targets as $major_minor):
@@ -118,7 +141,8 @@
118141
- mkdir -p tmp/build_zai && cd tmp/build_zai
119142
- CMAKE_PREFIX_PATH=/opt/catch2 Tea_ROOT=../../tmp/tea/<?= $switch_php_version ?> cmake <?= $toolchain ?> -DCMAKE_BUILD_TYPE=Debug -DBUILD_ZAI_TESTING=ON -DPhpConfig_ROOT=$(php-config --prefix) ../../zend_abstract_interface
120143
- make -j all
121-
- make test
144+
- mkdir -p "${CI_PROJECT_DIR}/artifacts"
145+
- make test ARGS="--output-junit ${CI_PROJECT_DIR}/artifacts/zai-<?= $major_minor ?>-<?= $switch_php_version ?>-results.xml --output-on-failure"
122146
- grep -e "=== Total [0-9]+ memory leaks detected ===" Testing/Temporary/LastTest.log && exit 1 || true
123147
<?php
124148
endforeach;

0 commit comments

Comments
 (0)