Skip to content

Commit 87adbc2

Browse files
committed
Enable helper-rust by default also on PHP 8.4
1 parent 557740f commit 87adbc2

6 files changed

Lines changed: 13 additions & 14 deletions

File tree

.gitlab/generate-appsec.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@
192192
- test7.4-release
193193
- test8.1-release
194194
- test8.3-debug
195-
- test8.4-release-zts
196195

197196
"helper-rust build and test":
198197
stage: test

appsec/src/extension/configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern bool runtime_config_first_init;
2828

2929
#define DD_BASE(path) "/opt/datadog-php/" path
3030

31-
#if PHP_VERSION_ID >= 80500
31+
#if PHP_VERSION_ID >= 80400
3232
#define DD_APPSEC_HELPER_RUST_REDIRECTION_DEFAULT "true"
3333
#else
3434
#define DD_APPSEC_HELPER_RUST_REDIRECTION_DEFAULT "false"

appsec/tests/integration/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,8 @@ def runMainTask = { String phpVersion, String variant ->
636636
dependsOn 'buildHelperRustWithCoverage'
637637
} else if (project.hasProperty('useHelperRust')) {
638638
dependsOn 'buildHelperRust'
639-
} else if (phpVersion == '8.5') {
640-
// PHP 8.5+ uses Rust helper by default via DD_APPSEC_HELPER_RUST_REDIRECTION
639+
} else if (phpVersion in ['8.4', '8.5']) {
640+
// PHP 8.4+ uses Rust helper by default via DD_APPSEC_HELPER_RUST_REDIRECTION
641641
dependsOn 'buildHelperRust'
642642
}
643643
}
@@ -714,8 +714,8 @@ def runMainTask = { String phpVersion, String variant ->
714714
dependsOn 'buildHelperRustWithCoverage'
715715
} else if (project.hasProperty('useHelperRust')) {
716716
dependsOn 'buildHelperRust'
717-
} else if (phpVersion == '8.5') {
718-
// PHP 8.5+ uses Rust helper by default via DD_APPSEC_HELPER_RUST_REDIRECTION
717+
} else if (phpVersion in ['8.4', '8.5']) {
718+
// PHP 8.4+ uses Rust helper by default via DD_APPSEC_HELPER_RUST_REDIRECTION
719719
dependsOn 'buildHelperRust'
720720
}
721721

appsec/tests/integration/src/main/groovy/com/datadog/appsec/php/docker/AppSecContainer.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ class AppSecContainer<SELF extends AppSecContainer<SELF>> extends GenericContain
494494
} else {
495495
// Mount helper-rust volume so enable_extensions.sh can copy the binary
496496
// for the redirection mechanism (DD_APPSEC_HELPER_RUST_REDIRECTION
497-
// defaults to true on PHP 8.5+)
497+
// defaults to true on PHP 8.4+)
498498
addVolumeMount('php-helper-rust', '/helper-rust')
499499
}
500500

appsec/tests/integration/src/test/groovy/com/datadog/appsec/php/integration/CommonTests.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -875,22 +875,22 @@ trait CommonTests {
875875
assert resp.statusCode() == 200
876876
def content = resp.body().text
877877

878-
if (TestParams.phpVersionAtLeast('8.5')) {
878+
if (TestParams.phpVersionAtLeast('8.4')) {
879879
assert content.contains('Yes (Rust)') :
880-
"PHP >= 8.5 should use Rust helper by default"
880+
"PHP >= 8.4 should use Rust helper by default"
881881
} else {
882882
assert content.contains('Yes (C++)') :
883-
"PHP < 8.5 should use C++ helper by default"
883+
"PHP < 8.4 should use C++ helper by default"
884884
}
885885
}
886886

887887
Span span = trace.first()
888-
if (TestParams.phpVersionAtLeast('8.5')) {
888+
if (TestParams.phpVersionAtLeast('8.4')) {
889889
assert span.meta."_dd.appsec.helper_runtime" == 'rust' :
890-
"PHP >= 8.5 should report helper_runtime=rust in span"
890+
"PHP >= 8.4 should report helper_runtime=rust in span"
891891
} else {
892892
assert span.meta."_dd.appsec.helper_runtime" == null :
893-
"PHP < 8.5 should not set helper_runtime span tag"
893+
"PHP < 8.4 should not set helper_runtime span tag"
894894
}
895895
}
896896
}

tooling/generate-supported-configurations.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ extract_c_supported_configurations() {
394394
#define DD_SIDECAR_TRACE_SENDER_DEFAULT false
395395
#endif
396396
#undef DD_APPSEC_HELPER_RUST_REDIRECTION_DEFAULT
397-
#if PHP_VERSION_ID >= 80500
397+
#if PHP_VERSION_ID >= 80400
398398
#define DD_APPSEC_HELPER_RUST_REDIRECTION_DEFAULT "true"
399399
#else
400400
#define DD_APPSEC_HELPER_RUST_REDIRECTION_DEFAULT "false"

0 commit comments

Comments
 (0)