From 35c01832f897d2b1ae9ec32f15f84e8d2b63ee9e Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 12 Oct 2023 13:19:55 +0200 Subject: [PATCH 01/22] Add PHPSeclib, Psalm and PHPStan to nightly tests --- .github/workflows/nightly.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 04ecbb83c7434..ef40e9033ce85 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -389,6 +389,28 @@ jobs: echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini echo memory_limit=-1 >> /etc/php.d/opcache.ini php -v + - name: Test Psalm + if: matrix.branch.ref != 'PHP-8.0' + run: | + git clone https://github.com/vimeo/psalm --branch=master + cd psalm + git checkout 7428e49b115a2a837aa29cf0fafd0ca902fe2457 + export ASAN_OPTIONS=exitcode=139 + # Needed to avoid overwriting JIT config + export PSALM_ALLOW_XDEBUG=1 + php /usr/bin/composer install --no-progress --ignore-platform-reqs + php ./psalm --no-cache || exit $? + - name: Test PHPStan + if: matrix.branch.ref != 'PHP-8.0' + run: | + git clone https://github.com/phpstan/phpstan-src + cd phpstan-src + git checkout d02cc99d4480a203a2dbe54a5ded2da016266b11 + sed -E 's/phpVersion(.*)max[^)]+/phpVersion\1max(89999/g' conf/parametersSchema.neon -i + php /usr/bin/composer install --no-progress --ignore-platform-reqs + export ASAN_OPTIONS=exitcode=139 + php bin/phpstan clear-result-cache + php bin/phpstan || exit $? - name: Test AMPHP if: matrix.branch.ref != 'PHP-8.0' run: | @@ -475,6 +497,16 @@ jobs: fi done exit $X + - name: Test PHPSeclib + if: always() + run: | + git clone https://github.com/phpseclib/phpseclib --branch=master + cd phpseclib + git checkout 259bd9f1e8af11726ed74acf527c2c046549061b + export ASAN_OPTIONS=exitcode=139 + export PHPSECLIB_ALLOW_JIT=1 + php /usr/bin/composer install --no-progress --ignore-platform-reqs + php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? - name: Test PHPUnit if: always() run: | From 2813621441e742dfe247a8267a5eb4985d378a6b Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 22 Oct 2023 13:43:22 +0200 Subject: [PATCH 02/22] Add JIT check --- .github/jit_check.php | 30 +++++++++++++++++++++++++ .github/workflows/nightly.yml | 42 +++++++++++++++++++++-------------- 2 files changed, 55 insertions(+), 17 deletions(-) create mode 100644 .github/jit_check.php diff --git a/.github/jit_check.php b/.github/jit_check.php new file mode 100644 index 0000000000000..393e2ba12ba04 --- /dev/null +++ b/.github/jit_check.php @@ -0,0 +1,30 @@ + /etc/php.d/opcache.ini echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini + echo opcache.enable=1 >> /etc/php.d/opcache.ini echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini + echo opcache.jit=tracing >> /etc/php.d/opcache.ini echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini @@ -387,30 +389,36 @@ jobs: echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini + echo opcache.jit_blacklist_root_trace=255 >> /etc/php.d/opcache.ini + echo opcache.jit_blacklist_side_trace=255 >> /etc/php.d/opcache.ini + echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini + echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini + echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini + echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini echo memory_limit=-1 >> /etc/php.d/opcache.ini php -v - name: Test Psalm if: matrix.branch.ref != 'PHP-8.0' run: | - git clone https://github.com/vimeo/psalm --branch=master + git clone https://github.com/vimeo/psalm --branch=master --depth 1 cd psalm - git checkout 7428e49b115a2a837aa29cf0fafd0ca902fe2457 + git rev-parse HEAD export ASAN_OPTIONS=exitcode=139 # Needed to avoid overwriting JIT config export PSALM_ALLOW_XDEBUG=1 php /usr/bin/composer install --no-progress --ignore-platform-reqs - php ./psalm --no-cache || exit $? + php $GITHUB_WORKSPACE/.github/jit_check.php ./psalm --no-cache || exit $? - name: Test PHPStan if: matrix.branch.ref != 'PHP-8.0' run: | - git clone https://github.com/phpstan/phpstan-src + git clone https://github.com/phpstan/phpstan-src --depth 1 cd phpstan-src - git checkout d02cc99d4480a203a2dbe54a5ded2da016266b11 + git rev-parse HEAD sed -E 's/phpVersion(.*)max[^)]+/phpVersion\1max(89999/g' conf/parametersSchema.neon -i php /usr/bin/composer install --no-progress --ignore-platform-reqs export ASAN_OPTIONS=exitcode=139 - php bin/phpstan clear-result-cache - php bin/phpstan || exit $? + php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan clear-result-cache + php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan || exit $? - name: Test AMPHP if: matrix.branch.ref != 'PHP-8.0' run: | @@ -423,7 +431,7 @@ jobs: git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs export ASAN_OPTIONS=exitcode=139 - vendor/bin/phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then X=1; fi @@ -440,7 +448,7 @@ jobs: # Hack to disable a test that hangs php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("*/\n public function testSharedGet()", "* @group skip\n */\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);' export ASAN_OPTIONS=exitcode=139 - php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then exit 1 fi @@ -456,7 +464,7 @@ jobs: git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs export ASAN_OPTIONS=exitcode=139 - vendor/bin/phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? if [ $[EXIT_CODE:-0} -gt 128 ]; then X=1; fi @@ -471,7 +479,7 @@ jobs: git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs export ASAN_OPTIONS=exitcode=139 - vendor/bin/phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then exit 1 fi @@ -491,7 +499,7 @@ jobs: export SYMFONY_DEPRECATIONS_HELPER=max[total]=999 X=0 for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do - php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/jit_check.php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then X=1; fi @@ -500,13 +508,13 @@ jobs: - name: Test PHPSeclib if: always() run: | - git clone https://github.com/phpseclib/phpseclib --branch=master + git clone https://github.com/phpseclib/phpseclib --depth 1 cd phpseclib - git checkout 259bd9f1e8af11726ed74acf527c2c046549061b + git rev-parse HEAD export ASAN_OPTIONS=exitcode=139 export PHPSECLIB_ALLOW_JIT=1 php /usr/bin/composer install --no-progress --ignore-platform-reqs - php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? + php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? - name: Test PHPUnit if: always() run: | @@ -515,7 +523,7 @@ jobs: git rev-parse HEAD export ASAN_OPTIONS=exitcode=139 php /usr/bin/composer install --no-progress --ignore-platform-reqs - php ./phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/jit_check.php ./phpunit || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then exit 1 fi @@ -539,7 +547,7 @@ jobs: sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php sed -i 's/yourusernamehere/root/g' wp-tests-config.php sed -i 's/yourpasswordhere/root/g' wp-tests-config.php - php vendor/bin/phpunit || EXIT_CODE=$? + php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? if [ $EXIT_CODE -gt 128 ]; then exit 1 fi From 7d0f0610b44593c58fb9680c16a88d70196c0c00 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sun, 22 Oct 2023 19:43:40 +0200 Subject: [PATCH 03/22] Add infection to testsuite, repeat JIT tests --- .github/actions/test-linux/action.yml | 1 + .github/actions/test-macos/action.yml | 1 + .github/nightly_matrix.php | 15 +++------------ .github/workflows/nightly.yml | 9 +++++++++ ext/standard/tests/dir/bug71542.phpt | 1 + 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml index 1b1edf26cc979..84bdcb693ff6b 100644 --- a/.github/actions/test-linux/action.yml +++ b/.github/actions/test-linux/action.yml @@ -41,6 +41,7 @@ runs: export TEST_PHP_JUNIT=junit.out.xml export STACK_LIMIT_DEFAULTS_CHECK=1 sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ + ${{ inputs.jitType == 'disable' && '' || '--repeat 2' }} -d opcache.jit=${{ inputs.jitType }} \ -d opcache.protect_memory=1 \ -d opcache.jit_buffer_size=64M \ diff --git a/.github/actions/test-macos/action.yml b/.github/actions/test-macos/action.yml index 20a89b53d52ef..b8ecdcce9ef4d 100644 --- a/.github/actions/test-macos/action.yml +++ b/.github/actions/test-macos/action.yml @@ -20,6 +20,7 @@ runs: export TEST_PHP_JUNIT=junit.out.xml export STACK_LIMIT_DEFAULTS_CHECK=1 sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ + ${{ inputs.jitType == 'disable' && '' || '--repeat 2' }} -d opcache.jit=${{ inputs.jitType }} \ -d opcache.protect_memory=1 \ -d opcache.jit_buffer_size=64M \ diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 33a50c55e0271..575193340106f 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -46,26 +46,17 @@ function get_matrix_include(array $branches) { $jobs = []; foreach ($branches as $branch) { $jobs[] = [ - 'name' => '_ASAN_UBSAN', + 'name' => '_ASAN_UBSAN_REPEAT', 'branch' => $branch, 'debug' => true, 'zts' => true, 'configuration_parameters' => "CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address'", 'run_tests_parameters' => '--asan', - 'test_function_jit' => false, + 'timeout_minutes' => 3600, + 'test_function_jit' => true, 'asan' => true, ]; if ($branch['ref'] !== 'PHP-8.0') { - $jobs[] = [ - 'name' => '_REPEAT', - 'branch' => $branch, - 'debug' => true, - 'zts' => false, - 'run_tests_parameters' => '--repeat 2', - 'timeout_minutes' => 360, - 'test_function_jit' => true, - 'asan' => false, - ]; $jobs[] = [ 'name' => '_VARIATION', 'branch' => $branch, diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 814db705bfcfc..cc87eb0e44ec0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -397,6 +397,15 @@ jobs: echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini echo memory_limit=-1 >> /etc/php.d/opcache.ini php -v + - name: Test Infection + if: matrix.branch.ref != 'PHP-8.0' + run: | + git clone https://github.com/infection/infection --branch=master --depth 1 + cd infection + git rev-parse HEAD + export ASAN_OPTIONS=exitcode=139 + php /usr/bin/composer install --no-progress --ignore-platform-reqs + php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || exit $? - name: Test Psalm if: matrix.branch.ref != 'PHP-8.0' run: | diff --git a/ext/standard/tests/dir/bug71542.phpt b/ext/standard/tests/dir/bug71542.phpt index 058b877cc6519..314de403e9cbf 100644 --- a/ext/standard/tests/dir/bug71542.phpt +++ b/ext/standard/tests/dir/bug71542.phpt @@ -2,6 +2,7 @@ Bug #71542 (disk_total_space does not work with relative paths) --FILE-- Date: Sun, 22 Oct 2023 20:02:58 +0200 Subject: [PATCH 04/22] Repeat windows JIT tests too --- .github/scripts/windows/test_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index c997eee5cb7ec..bba165838fe72 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -83,7 +83,7 @@ set OPENSSL_CONF= rem set SSLEAY_CONF= rem prepare for OPcache -if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=100000 -d opcache.jit_max_side_traces=100000 -d opcache.jit_max_exit_counters=100000 -d opcache.jit_hot_loop=1 -d opcache.jit_hot_func=1 -d opcache.jit_hot_return=1 -d opcache.jit_hot_side_exit=1 -d opcache.jit=tracing +if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=64M -d opcache.jit_max_root_traces=100000 -d opcache.jit_max_side_traces=100000 -d opcache.jit_max_exit_counters=100000 -d opcache.jit_hot_loop=1 -d opcache.jit_hot_func=1 -d opcache.jit_hot_return=1 -d opcache.jit_hot_side_exit=1 -d opcache.jit=tracing --repeat 2 rem work-around for failing to dl(mysqli) with OPcache (https://github.com/php/php-src/issues/8508) if "%OPCACHE%" equ "1" set OPCACHE_OPTS=%OPCACHE_OPTS% -d extension=mysqli From 5c129272f161924367e4cc79a3c2e6da3321194c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Sat, 11 Nov 2023 19:28:22 +0100 Subject: [PATCH 05/22] Fix --- .github/actions/test-linux/action.yml | 2 +- .github/actions/test-macos/action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml index bf5b0ba95cefc..ac9b74d97c489 100644 --- a/.github/actions/test-linux/action.yml +++ b/.github/actions/test-linux/action.yml @@ -43,7 +43,7 @@ runs: export TEST_PHP_JUNIT=junit.out.xml export STACK_LIMIT_DEFAULTS_CHECK=1 sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ - ${{ inputs.jitType == 'disable' && '' || '--repeat 2' }} + ${{ inputs.jitType == 'disable' && '' || '--repeat 2' }} \ -d opcache.jit=${{ inputs.jitType }} \ -d opcache.protect_memory=1 \ -d opcache.jit_buffer_size=64M \ diff --git a/.github/actions/test-macos/action.yml b/.github/actions/test-macos/action.yml index 713b03260169d..6620599e85d14 100644 --- a/.github/actions/test-macos/action.yml +++ b/.github/actions/test-macos/action.yml @@ -20,7 +20,7 @@ runs: export TEST_PHP_JUNIT=junit.out.xml export STACK_LIMIT_DEFAULTS_CHECK=1 sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ - ${{ inputs.jitType == 'disable' && '' || '--repeat 2' }} + ${{ inputs.jitType == 'disable' && '' || '--repeat 2' }} \ -d opcache.jit=${{ inputs.jitType }} \ -d opcache.protect_memory=1 \ -d opcache.jit_buffer_size=64M \ From 1d97fcfa3dbc68e3ff45cc96ead1df8d34d03bd7 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 15 Nov 2023 14:39:10 +0100 Subject: [PATCH 06/22] Add phpseclib, Psalm, PHPStan nightly tests --- .github/jit_check.php | 30 ++++ .github/nightly.php | 258 ++++++++++++++++++++++++++++++++++ .github/workflows/nightly.yml | 112 +++++++-------- 3 files changed, 345 insertions(+), 55 deletions(-) create mode 100644 .github/jit_check.php create mode 100644 .github/nightly.php diff --git a/.github/jit_check.php b/.github/jit_check.php new file mode 100644 index 0000000000000..50f3ac9ec3839 --- /dev/null +++ b/.github/jit_check.php @@ -0,0 +1,30 @@ +&1"), $result, $code); + $result = implode("\n", $result); + if ($code) { + printMutex("An error occurred while executing $cmd (status $code, extra info $extra): $result"); + die(1); + } + return $result; +} + +$parallel = (int) ($argv[1] ?? 0); +$parallel = $parallel ?: ((int)`nproc`); +$parallel = $parallel ?: 8; + +$repos = []; + +$repos["phpunit"] = [ + "https://github.com/sebastianbergmann/phpunit.git", + "main", + null, + ["./phpunit"], + 1 +]; + +$repos["wordpress"] = [ + "https://github.com/WordPress/wordpress-develop.git", + "", + function (): void { + $f = file_get_contents('wp-tests-config-sample.php'); + $f = str_replace('youremptytestdbnamehere', 'test', $f); + $f = str_replace('yourusernamehere', 'root', $f); + $f = str_replace('yourpasswordhere', 'root', $f); + file_put_contents('wp-tests-config.php', $f); + }, + ["vendor/bin/phpunit"], + 1 +]; + +foreach (['amp', 'cache', 'dns', 'file', 'http', 'parallel', 'parser', 'pipeline', 'process', 'serialization', 'socket', 'sync', 'websocket-client', 'websocket-server'] as $repo) { + $repos["amphp-$repo"] = ["https://github.com/amphp/$repo.git", "", null, ["vendor/bin/phpunit"], 1]; +} + +$repos["laravel"] = [ + "https://github.com/laravel/framework.git", + "master", + function (): void { + $c = file_get_contents("tests/Filesystem/FilesystemTest.php"); + $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('skip')]\n public function testSharedGet()", $c); + file_put_contents("tests/Filesystem/FilesystemTest.php", $c); + }, + ["vendor/bin/phpunit", "--exclude-group", "skip"], + 1 +]; + +foreach (['async', 'cache', 'child-process', 'datagram', 'dns', 'event-loop', 'promise', 'promise-stream', 'promise-timer', 'stream'] as $repo) { + $repos["reactphp-$repo"] = ["https://github.com/reactphp/$repo.git", "", null, ["vendor/bin/phpunit"], 1]; +} + +$repos["revolt"] = ["https://github.com/revoltphp/event-loop.git", "", null, ["vendor/bin/phpunit"], 2]; + +$repos["symfony"] = [ + "https://github.com/symfony/symfony.git", + "", + function (): void { + e("php ./phpunit install"); + + // Test causes a heap-buffer-overflow but I cannot reproduce it locally... + $c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); + $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); + file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c); + // Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668 + $c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); + $c = str_replace("*/\n public function testCastNonTrailingCharPointer()", "* @group skip\n */\n public function testCastNonTrailingCharPointer()", $c); + file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c); + }, + function (): iterable { + $it = new RecursiveDirectoryIterator("src/Symfony"); + /** @var SplFileInfo $file */ + foreach(new RecursiveIteratorIterator($it) as $file) { + if ($file->getBasename() == 'phpunit.xml.dist') { + yield [ + getcwd()."/phpunit", + dirname($file->getRealPath()), + "--exclude-group", + "tty,benchmark,intl-data,transient", + "--exclude-group", + "skip" + ]; + } + } + }, + 1 +]; + +$finalStatus = 0; +$parentPids = []; + +$waitOne = function () use (&$finalStatus, &$parentPids): void { + $res = pcntl_wait($status); + if ($res === -1) { + printMutex("An error occurred while waiting with waitpid!"); + $finalStatus = $finalStatus ?: 1; + return; + } + if (!isset($parentPids[$res])) { + printMutex("Unknown PID $res returned!"); + $finalStatus = $finalStatus ?: 1; + return; + } + $desc = $parentPids[$res]; + unset($parentPids[$res]); + if (pcntl_wifexited($status)) { + $status = pcntl_wexitstatus($status); + printMutex("Child task $desc exited with status $status"); + if ($status !== 0) { + $finalStatus = $status; + } + } elseif (pcntl_wifstopped($status)) { + $status = pcntl_wstopsig($status); + printMutex("Child task $desc stopped by signal $status"); + $finalStatus = 1; + } elseif (pcntl_wifsignaled($status)) { + $status = pcntl_wtermsig($status); + printMutex("Child task $desc terminated by signal $status"); + $finalStatus = 1; + } +}; + +$waitAll = function () use ($waitOne, &$parentPids): void { + while ($parentPids) { + $waitOne(); + } +}; + +printMutex("Cloning repos..."); + +foreach ($repos as $dir => [$repo, $branch, $prepare, $command, $repeat]) { + $pid = pcntl_fork(); + if ($pid) { + $parentPids[$pid] = "clone $dir"; + continue; + } + + chdir(sys_get_temp_dir()); + if ($branch) { + $branch = "--branch $branch"; + } + e("git clone $repo $branch --depth 1 $dir"); + + exit(0); +} + +$waitAll(); + +printMutex("Done cloning repos!"); + +printMutex("Preparing repos (max $parallel processes)..."); +foreach ($repos as $dir => [$repo, $branch, $prepare, $command, $repeat]) { + chdir(sys_get_temp_dir()."/$dir"); + $rev = e("git rev-parse HEAD", $dir); + + $pid = pcntl_fork(); + if ($pid) { + $parentPids[$pid] = "prepare $dir ($rev)"; + if (count($parentPids) >= $parallel) { + $waitOne(); + } + continue; + } + + e("composer i --ignore-platform-reqs", $dir); + if ($prepare) { + $prepare(); + } + + exit(0); +} +$waitAll(); + +printMutex("Done preparing repos!"); + +printMutex("Running tests (max $parallel processes)..."); +foreach ($repos as $dir => [$repo, $branch, $prepare, $command, $repeat]) { + chdir(sys_get_temp_dir()."/$dir"); + $rev = e("git rev-parse HEAD", $dir); + + if ($command instanceof Closure) { + $commands = iterator_to_array($command()); + } else { + $commands = [$command]; + } + + foreach ($commands as $idx => $cmd) { + $cmd = array_merge([ + 'php', + '--repeat', + $repeat, + '-f', + __DIR__.'/jit_check.php', + ], $cmd); + + $cmdStr = implode(" ", $cmd); + + $pid = pcntl_fork(); + if ($pid) { + $parentPids[$pid] = "test $dir ($rev): $cmdStr"; + if (count($parentPids) >= $parallel) { + $waitOne(); + } + continue; + } + + $output = sys_get_temp_dir()."/out_{$dir}_$idx.txt"; + + $p = proc_open($cmd, [ + ["pipe", "r"], + ["file", $output, "a"], + ["file", $output, "a"] + ], $pipes, sys_get_temp_dir()."/$dir"); + + if ($p === false) { + printMutex("Failure starting $cmdStr"); + exit(1); + } + + $final = 0; + $status = proc_close($p); + if ($status !== 0) { + if ($status > 128) { + $final = $status; + } + printMutex( + "$dir ($rev): $cmdStr terminated with status $status:".PHP_EOL + .file_get_contents($output).PHP_EOL + ); + } + + exit($final); + } +} + +$waitAll(); + +printMutex("All done!"); + +die($finalStatus); diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f945ec23c9e3e..ae3cfd1893ccd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -79,11 +79,13 @@ jobs: - name: Test uses: ./.github/actions/test-linux with: + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} runTestsParameters: >- ${{ matrix.run_tests_parameters }} - name: Test Tracing JIT uses: ./.github/actions/test-linux with: + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT jitType: tracing runTestsParameters: >- ${{ matrix.run_tests_parameters }} @@ -92,6 +94,7 @@ jobs: - name: Test OpCache uses: ./.github/actions/test-linux with: + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache runTestsParameters: >- ${{ matrix.run_tests_parameters }} -d zend_extension=opcache.so @@ -102,6 +105,7 @@ jobs: if: matrix.test_function_jit uses: ./.github/actions/test-linux with: + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT jitType: function runTestsParameters: >- ${{ matrix.run_tests_parameters }} @@ -221,9 +225,12 @@ jobs: run: sudo make install - name: Test uses: ./.github/actions/test-macos + with: + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} - name: Test Tracing JIT uses: ./.github/actions/test-macos with: + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT jitType: tracing runTestsParameters: >- -d zend_extension=opcache.so @@ -232,6 +239,7 @@ jobs: - name: Test OpCache uses: ./.github/actions/test-macos with: + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 @@ -239,6 +247,7 @@ jobs: - name: Test Function JIT uses: ./.github/actions/test-macos with: + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT jitType: function runTestsParameters: >- -d zend_extension=opcache.so @@ -333,54 +342,62 @@ jobs: echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini - - name: Test Laravel + echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_exit_counters=100000 >> /etc/php.d/opcache.ini + echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini + echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini + echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini + echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini + echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini + echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini + echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini + echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini + echo memory_limit=-1 >> /etc/php.d/opcache.ini + php -v + + - name: Test multiple libraries and frameworks in parallel if: matrix.branch.ref != 'PHP-8.0' run: | - git clone https://github.com/laravel/framework.git --branch=master --depth=1 - cd framework - git rev-parse HEAD - php /usr/bin/composer install --no-progress --ignore-platform-reqs - # Hack to disable a test that hangs - php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);' + sudo prlimit --pid $$ --nofile=1048576:1048576 + + php $GITHUB_WORKSPACE/.github/nightly.php || exit $? + + - name: Test PHPSeclib + if: always() + run: | + git clone https://github.com/phpseclib/phpseclib --branch=master + cd phpseclib + git checkout 259bd9f1e8af11726ed74acf527c2c046549061b export ASAN_OPTIONS=exitcode=139 - php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? - if [ $EXIT_CODE -gt 128 ]; then - exit 1 - fi - - name: Test Symfony - if: matrix.branch.ref != 'PHP-8.0' + export PHPSECLIB_ALLOW_JIT=1 + php /usr/bin/composer install --no-progress --ignore-platform-reqs + php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? + + - name: Test Psalm run: | - git clone https://github.com/symfony/symfony.git --depth=1 - cd symfony + git clone https://github.com/vimeo/psalm --depth 1 + cd psalm git rev-parse HEAD - php /usr/bin/composer install --no-progress --ignore-platform-reqs - php ./phpunit install - # Test causes a heap-buffer-overflow but I cannot reproduce it locally... - php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);' - # Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668 - php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("*/\n public function testCastNonTrailingCharPointer()", "* @group skip\n */\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);' export ASAN_OPTIONS=exitcode=139 - export SYMFONY_DEPRECATIONS_HELPER=max[total]=999 - X=0 - for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do - php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? - if [ $EXIT_CODE -gt 128 ]; then - X=1; - fi - done - exit $X - - name: Test PHPUnit - if: always() + # Needed to avoid overwriting JIT config + export PSALM_ALLOW_XDEBUG=1 + php /usr/bin/composer install --no-progress --ignore-platform-reqs + php $GITHUB_WORKSPACE/.github/jit_check.php ./psalm --no-cache || exit $? + + - name: Test PHPStan + if: matrix.branch.ref != 'PHP-8.2' run: | - git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1 - cd phpunit + git clone https://github.com/phpstan/phpstan-src --depth 1 + cd phpstan-src git rev-parse HEAD - export ASAN_OPTIONS=exitcode=139 + sed -E 's/phpVersion(.*)max[^)]+/phpVersion\1max(89999/g' conf/parametersSchema.neon -i php /usr/bin/composer install --no-progress --ignore-platform-reqs - php ./phpunit || EXIT_CODE=$? - if [ $EXIT_CODE -gt 128 ]; then - exit 1 - fi + sed -i 's/public const IS/public const int IS/g' vendor/ondrejmirtes/better-reflection/src/Reflection/Adapter/*php + export ASAN_OPTIONS=exitcode=139 + php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan clear-result-cache + php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan || exit $? + - name: 'Symfony Preloading' if: matrix.branch.ref != 'PHP-8.0' run: | @@ -389,22 +406,7 @@ jobs: git rev-parse HEAD sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php php -d opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php public/index.php - - name: Test Wordpress - if: always() - run: | - git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1 - cd wordpress - git rev-parse HEAD - export ASAN_OPTIONS=exitcode=139 - php /usr/bin/composer install --no-progress --ignore-platform-reqs - cp wp-tests-config-sample.php wp-tests-config.php - sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php - sed -i 's/yourusernamehere/root/g' wp-tests-config.php - sed -i 's/yourpasswordhere/root/g' wp-tests-config.php - php vendor/bin/phpunit || EXIT_CODE=$? - if [ $EXIT_CODE -gt 128 ]; then - exit 1 - fi + - name: Notify Slack if: failure() uses: ./.github/actions/notify-slack From 1bb6a1bb523bbee14bb6fae671482b60b3968b60 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 1 Feb 2024 11:17:37 +0100 Subject: [PATCH 07/22] Add infection to matrix --- .github/nightly.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/nightly.php b/.github/nightly.php index cbb973d030c4e..c18d636e59b38 100644 --- a/.github/nightly.php +++ b/.github/nightly.php @@ -34,6 +34,14 @@ function e(string $cmd, string $extra = ''): string { 1 ]; +$repos["infection"] = [ + "https://github.com/infection/infection", + "master", + null, + ["vendor/bin/phpunit"], + 1 +]; + $repos["wordpress"] = [ "https://github.com/WordPress/wordpress-develop.git", "", From 12b8a63776e7c0b3e940f5c5c271145f52511249 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 1 Feb 2024 11:22:19 +0100 Subject: [PATCH 08/22] Bump config --- .github/workflows/nightly.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7b61ffdb6fbf2..50a6534c26237 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -340,8 +340,10 @@ jobs: - name: Enable Opcache and JIT run: | echo zend_extension=opcache.so > /etc/php.d/opcache.ini + echo opcache.enable=1 >> /etc/php.d/opcache.ini echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini + echo opcache.jit=tracing >> /etc/php.d/opcache.ini echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini From 8f64c9e1703481f70aff7c6d7283e8107d36e54e Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 1 Feb 2024 11:25:39 +0100 Subject: [PATCH 09/22] Cleanup --- .github/jit_check.php | 30 ------ .github/nightly_matrix.php | 81 ++++++++------- .github/workflows/nightly.yml | 180 +++++++++++++++------------------- 3 files changed, 124 insertions(+), 167 deletions(-) delete mode 100644 .github/jit_check.php diff --git a/.github/jit_check.php b/.github/jit_check.php deleted file mode 100644 index 393e2ba12ba04..0000000000000 --- a/.github/jit_check.php +++ /dev/null @@ -1,30 +0,0 @@ - 'master', 'ref' => 'master', 'version' => ['major' => 8, 'minor' => 4]], + ['name' => 'PHP-8.3', 'ref' => 'PHP-8.3', 'version' => ['major' => 8, 'minor' => 3]], + ['name' => 'PHP-8.2', 'ref' => 'PHP-8.2', 'version' => ['major' => 8, 'minor' => 2]], + ['name' => 'PHP-8.1', 'ref' => 'PHP-8.1', 'version' => ['major' => 8, 'minor' => 1]], +]; function get_branch_commit_cache_file_path(): string { return dirname(__DIR__) . '/branch-commit-cache.json'; } -function get_branch_matrix(array $branches) { - $result = array_map(function ($branch) { - $branch_key = strtoupper(str_replace('.', '', $branch)); - return [ - 'name' => $branch_key, - 'ref' => $branch, - ]; - }, $branches); - - return $result; -} - function get_branches() { $branch_commit_cache_file = get_branch_commit_cache_file_path(); $branch_commit_map = []; @@ -27,47 +20,54 @@ function get_branches() { $changed_branches = []; foreach (BRANCHES as $branch) { - $previous_commit_hash = $branch_commit_map[$branch] ?? null; - $current_commit_hash = trim(shell_exec('git rev-parse origin/' . $branch)); + $previous_commit_hash = $branch_commit_map[$branch['ref']] ?? null; + $current_commit_hash = trim(shell_exec('git rev-parse origin/' . $branch['ref'])); if ($previous_commit_hash !== $current_commit_hash) { $changed_branches[] = $branch; } - $branch_commit_map[$branch] = $current_commit_hash; + $branch_commit_map[$branch['ref']] = $current_commit_hash; } file_put_contents($branch_commit_cache_file, json_encode($branch_commit_map)); - return get_branch_matrix($changed_branches); + return $changed_branches; } function get_matrix_include(array $branches) { $jobs = []; foreach ($branches as $branch) { $jobs[] = [ - 'name' => '_ASAN_UBSAN_REPEAT', + 'name' => '_ASAN_UBSAN', 'branch' => $branch, 'debug' => true, 'zts' => true, 'configuration_parameters' => "CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address'", - 'run_tests_parameters' => '--asan', - 'timeout_minutes' => 3600, - 'test_function_jit' => true, + 'run_tests_parameters' => '--asan --repeat 2', + 'test_function_jit' => false, 'asan' => true, ]; - if ($branch['ref'] !== 'PHP-8.0') { - $jobs[] = [ - 'name' => '_VARIATION', - 'branch' => $branch, - 'debug' => true, - 'zts' => true, - 'configuration_parameters' => "CFLAGS='-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1'", - 'timeout_minutes' => 360, - 'test_function_jit' => true, - 'asan' => false, - ]; - } + $jobs[] = [ + 'name' => '_REPEAT', + 'branch' => $branch, + 'debug' => true, + 'zts' => false, + 'run_tests_parameters' => '--repeat 2', + 'timeout_minutes' => 360, + 'test_function_jit' => true, + 'asan' => false, + ]; + $jobs[] = [ + 'name' => '_VARIATION', + 'branch' => $branch, + 'debug' => true, + 'zts' => true, + 'configuration_parameters' => "CFLAGS='-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1 -DZEND_VERIFY_TYPE_INFERENCE'", + 'timeout_minutes' => 360, + 'test_function_jit' => true, + 'asan' => false, + ]; } return $jobs; } @@ -91,14 +91,27 @@ function get_windows_matrix_include(array $branches) { return $jobs; } +function get_current_version(): array { + $file = dirname(__DIR__) . '/main/php_version.h'; + $content = file_get_contents($file); + preg_match('(^#define PHP_MAJOR_VERSION (?\d+)$)m', $content, $matches); + $major = $matches['num']; + preg_match('(^#define PHP_MINOR_VERSION (?\d+)$)m', $content, $matches); + $minor = $matches['num']; + return ['major' => $major, 'minor' => $minor]; +} + $trigger = $argv[1] ?? 'schedule'; $attempt = (int) ($argv[2] ?? 1); $discard_cache = ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch'; if ($discard_cache) { @unlink(get_branch_commit_cache_file_path()); } +$branch = $argv[3] ?? 'master'; -$branches = get_branches(); +$branches = $branch === 'master' + ? get_branches() + : [['name' => strtoupper($branch), 'ref' => $branch, 'version' => get_current_version()]]; $matrix_include = get_matrix_include($branches); $windows_matrix_include = get_windows_matrix_include($branches); diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5deb78f0cc4fe..d00ca74e184fb 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -32,7 +32,7 @@ jobs: nightly- - name: Generate Matrix id: set-matrix - run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" + run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.head_ref || github.ref_name }}" - name: Notify Slack if: failure() uses: ./.github/actions/notify-slack @@ -48,6 +48,15 @@ jobs: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: test + firebird: + image: jacobalberty/firebird + ports: + - 3050:3050 + env: + ISC_PASSWORD: test + FIREBIRD_DATABASE: test.fdb + FIREBIRD_USER: test + FIREBIRD_PASSWORD: test strategy: fail-fast: false matrix: @@ -60,7 +69,7 @@ jobs: zts: [true, false] include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.matrix-include) }} name: "${{ matrix.branch.name }}_LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: ubuntu-${{ ((matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && !matrix.asan) && '22.04' || '20.04' }} + runs-on: ubuntu-${{ (matrix.branch.version.minor >= 3 && !matrix.asan) && '22.04' || '20.04' }} steps: - name: git checkout uses: actions/checkout@v4 @@ -99,6 +108,7 @@ jobs: testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} runTestsParameters: >- ${{ matrix.run_tests_parameters }} + idleCpu: ${{ matrix.asan && 'true' || 'false' }} - name: Test Tracing JIT uses: ./.github/actions/test-linux with: @@ -147,7 +157,7 @@ jobs: name: "${{ matrix.branch.name }}_LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" runs-on: ubuntu-latest container: - image: ubuntu:${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }} + image: ubuntu:${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }} services: mysql: image: mysql:8 @@ -224,7 +234,7 @@ jobs: debug: [true, false] zts: [true, false] name: "${{ matrix.branch.name }}_MACOS_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: macos-12 + runs-on: macos-${{ matrix.branch.version.minor >= 4 && '13' || '12' }} steps: - name: git checkout uses: actions/checkout@v4 @@ -287,6 +297,15 @@ jobs: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: test + firebird: + image: jacobalberty/firebird + ports: + - 3050:3050 + env: + ISC_PASSWORD: test + FIREBIRD_DATABASE: test.fdb + FIREBIRD_USER: test + FIREBIRD_PASSWORD: test runs-on: ubuntu-22.04 steps: - name: git checkout @@ -330,9 +349,16 @@ jobs: fail-fast: false matrix: branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} - name: "${{ matrix.branch.name }}_COMMUNITY" - runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }} + type: ['asan', 'verify_type_inference'] + # These branches don't include type verification + exclude: + - { branch: { name: 'PHP-8.1', ref: 'PHP-8.1', major: 8, minor: 1 }, type: 'verify_type_inference' } + - { branch: { name: 'PHP-8.2', ref: 'PHP-8.2', major: 8, minor: 2 }, type: 'verify_type_inference' } + - { branch: { name: 'PHP-8.3', ref: 'PHP-8.3', major: 8, minor: 3 }, type: 'verify_type_inference' } + name: "${{ matrix.branch.name }}_COMMUNITY_${{ matrix.type }}" + runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }} env: + ASAN_OPTIONS: exitcode=139 UBSAN_OPTIONS: print_stacktrace=1 USE_ZEND_ALLOC: 0 USE_TRACKED_ALLOC: 1 @@ -346,11 +372,11 @@ jobs: - name: ./configure uses: ./.github/actions/configure-x64 with: + # CFLAGS removes O2, so we have to add it again... configurationParameters: >- - --enable-debug --enable-zts - CFLAGS='-fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC' - LDFLAGS='-fsanitize=undefined,address' + ${{ matrix.type == 'asan' && '--enable-debug CFLAGS="-fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address"' || '' }} + ${{ matrix.type == 'verify_type_inference' && 'CFLAGS="-DZEND_VERIFY_TYPE_INFERENCE -O2"' || '' }} - name: make run: make -j$(/usr/bin/nproc) >/dev/null - name: make install @@ -360,12 +386,20 @@ jobs: sudo service mysql start mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" mysql -uroot -proot -e "SET GLOBAL local_infile = true" - - name: Enable Opcache and JIT + - name: Enable Opcache run: | + echo memory_limit=-1 >> /etc/php.d/opcache.ini echo zend_extension=opcache.so > /etc/php.d/opcache.ini echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini echo opcache.enable=1 >> /etc/php.d/opcache.ini echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini + echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini + echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini + echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini + echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini + - name: Enable JIT + if: matrix.type != 'verify_type_inference' + run: | echo opcache.jit=tracing >> /etc/php.d/opcache.ini echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini @@ -375,47 +409,8 @@ jobs: echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini - echo opcache.jit_blacklist_root_trace=255 >> /etc/php.d/opcache.ini - echo opcache.jit_blacklist_side_trace=255 >> /etc/php.d/opcache.ini - echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini - echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini - echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini - echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini - echo memory_limit=-1 >> /etc/php.d/opcache.ini php -v - - name: Test Infection - if: matrix.branch.ref != 'PHP-8.0' - run: | - git clone https://github.com/infection/infection --branch=master --depth 1 - cd infection - git rev-parse HEAD - export ASAN_OPTIONS=exitcode=139 - php /usr/bin/composer install --no-progress --ignore-platform-reqs - php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || exit $? - - name: Test Psalm - if: matrix.branch.ref != 'PHP-8.0' - run: | - git clone https://github.com/vimeo/psalm --branch=master --depth 1 - cd psalm - git rev-parse HEAD - export ASAN_OPTIONS=exitcode=139 - # Needed to avoid overwriting JIT config - export PSALM_ALLOW_XDEBUG=1 - php /usr/bin/composer install --no-progress --ignore-platform-reqs - php $GITHUB_WORKSPACE/.github/jit_check.php ./psalm --no-cache || exit $? - - name: Test PHPStan - if: matrix.branch.ref != 'PHP-8.0' - run: | - git clone https://github.com/phpstan/phpstan-src --depth 1 - cd phpstan-src - git rev-parse HEAD - sed -E 's/phpVersion(.*)max[^)]+/phpVersion\1max(89999/g' conf/parametersSchema.neon -i - php /usr/bin/composer install --no-progress --ignore-platform-reqs - export ASAN_OPTIONS=exitcode=139 - php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan clear-result-cache - php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan || exit $? - name: Test AMPHP - if: matrix.branch.ref != 'PHP-8.0' run: | repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server" X=0 @@ -425,8 +420,7 @@ jobs: cd "amphp-$repository" git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs - export ASAN_OPTIONS=exitcode=139 - php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? + vendor/bin/phpunit || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then X=1; fi @@ -434,21 +428,18 @@ jobs: done exit $X - name: Test Laravel - if: matrix.branch.ref != 'PHP-8.0' run: | git clone https://github.com/laravel/framework.git --branch=master --depth=1 cd framework git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs # Hack to disable a test that hangs - php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("*/\n public function testSharedGet()", "* @group skip\n */\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);' - export ASAN_OPTIONS=exitcode=139 - php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? + php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);' + php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then exit 1 fi - name: Test ReactPHP - if: matrix.branch.ref != 'PHP-8.0' run: | repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream" X=0 @@ -458,8 +449,7 @@ jobs: cd "reactphp-$repository" git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs - export ASAN_OPTIONS=exitcode=139 - php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? + vendor/bin/phpunit || EXIT_CODE=$? if [ $[EXIT_CODE:-0} -gt 128 ]; then X=1; fi @@ -467,19 +457,16 @@ jobs: done exit $X - name: Test Revolt PHP - if: matrix.branch.ref != 'PHP-8.0' run: | git clone https://github.com/revoltphp/event-loop.git --depth=1 cd event-loop git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-reqs - export ASAN_OPTIONS=exitcode=139 - php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? + vendor/bin/phpunit || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then exit 1 fi - name: Test Symfony - if: matrix.branch.ref != 'PHP-8.0' run: | git clone https://github.com/symfony/symfony.git --depth=1 cd symfony @@ -490,40 +477,27 @@ jobs: php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);' # Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668 php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("*/\n public function testCastNonTrailingCharPointer()", "* @group skip\n */\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);' - export ASAN_OPTIONS=exitcode=139 export SYMFONY_DEPRECATIONS_HELPER=max[total]=999 X=0 for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do - php $GITHUB_WORKSPACE/.github/jit_check.php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? + php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then X=1; fi done exit $X - - name: Test PHPSeclib - if: always() - run: | - git clone https://github.com/phpseclib/phpseclib --depth 1 - cd phpseclib - git rev-parse HEAD - export ASAN_OPTIONS=exitcode=139 - export PHPSECLIB_ALLOW_JIT=1 - php /usr/bin/composer install --no-progress --ignore-platform-reqs - php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? - name: Test PHPUnit if: always() run: | git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1 cd phpunit git rev-parse HEAD - export ASAN_OPTIONS=exitcode=139 php /usr/bin/composer install --no-progress --ignore-platform-reqs - php $GITHUB_WORKSPACE/.github/jit_check.php ./phpunit || EXIT_CODE=$? + php ./phpunit || EXIT_CODE=$? if [ ${EXIT_CODE:-0} -gt 128 ]; then exit 1 fi - name: 'Symfony Preloading' - if: matrix.branch.ref != 'PHP-8.0' run: | php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-reqs cd symfony_demo @@ -536,13 +510,12 @@ jobs: git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1 cd wordpress git rev-parse HEAD - export ASAN_OPTIONS=exitcode=139 php /usr/bin/composer install --no-progress --ignore-platform-reqs cp wp-tests-config-sample.php wp-tests-config.php sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php sed -i 's/yourusernamehere/root/g' wp-tests-config.php sed -i 's/yourpasswordhere/root/g' wp-tests-config.php - php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/phpunit || EXIT_CODE=$? + php vendor/bin/phpunit || EXIT_CODE=$? if [ $EXIT_CODE -gt 128 ]; then exit 1 fi @@ -561,12 +534,21 @@ jobs: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: test + firebird: + image: jacobalberty/firebird + ports: + - 3050:3050 + env: + ISC_PASSWORD: test + FIREBIRD_DATABASE: test.fdb + FIREBIRD_USER: test + FIREBIRD_PASSWORD: test strategy: fail-fast: false matrix: branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} name: "${{ matrix.branch.name }}_OPCACHE_VARIATION" - runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }} + runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }} steps: - name: git checkout uses: actions/checkout@v4 @@ -642,7 +624,7 @@ jobs: matrix: branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} name: "${{ matrix.branch.name }}_MSAN" - runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }} + runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }} steps: - name: git checkout uses: actions/checkout@v4 @@ -695,7 +677,7 @@ jobs: --enable-memory-sanitizer \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ - ${{ matrix.branch.ref != 'PHP-8.0' && '--enable-dl-test=shared' || '' }} + --enable-dl-test=shared - name: make run: make -j$(/usr/bin/nproc) >/dev/null - name: make install @@ -739,10 +721,8 @@ jobs: fail-fast: false matrix: branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} - exclude: - - branch: { name: 'PHP-80', ref: 'PHP-8.0' } name: "${{ matrix.branch.name }}_LIBMYSQLCLIENT" - runs-on: ubuntu-${{ (matrix.branch.ref == 'PHP-8.3' || matrix.branch.ref == 'master') && '22.04' || '20.04' }} + runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }} steps: - name: git checkout uses: actions/checkout@v4 @@ -758,30 +738,23 @@ jobs: mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" # Ensure local_infile tests can run. mysql -uroot -proot -e "SET GLOBAL local_infile = true" - # Does not support caching_sha2_auth :( - # - name: Build mysql-5.6 - # uses: ./.github/actions/build-libmysqlclient - # with: - # libmysql: mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz - # - name: Test mysql-5.6 - # uses: ./.github/actions/test-libmysqlclient - - name: Build mysql-5.7 + - name: Build mysql-8.0 uses: ./.github/actions/build-libmysqlclient with: - libmysql: mysql-5.7.41-linux-glibc2.12-x86_64.tar.gz + configurationParameters: --enable-werror + libmysql: mysql-8.0.35-linux-glibc2.28-x86_64.tar.xz withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} - - name: Test mysql-5.7 + - name: Test mysql-8.0 uses: ./.github/actions/test-libmysqlclient with: withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} - - name: Build mysql-8.0 + - name: Build mysql-8.2 uses: ./.github/actions/build-libmysqlclient with: - # FIXME: There are new warnings - # configurationParameters: --enable-werror - libmysql: mysql-8.0.33-linux-glibc2.12-x86_64.tar.xz + configurationParameters: --enable-werror + libmysql: mysql-8.2.0-linux-glibc2.28-x86_64.tar.xz withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} - - name: Test mysql-8.0 + - name: Test mysql-8.2 uses: ./.github/actions/test-libmysqlclient with: withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} @@ -819,13 +792,13 @@ jobs: repository: php-memcached-dev/php-memcached path: memcached - name: git checkout redis + # Currently fails to build + if: false uses: actions/checkout@v4 with: repository: phpredis/phpredis path: redis - name: git checkout xdebug - # Currently breaks due to a PHP <=8.3 version check - if: false uses: actions/checkout@v4 with: repository: xdebug/xdebug @@ -880,13 +853,14 @@ jobs: ./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config make -j$(/usr/bin/nproc) - name: build redis + # Currently fails to build + if: false run: | cd redis /opt/php/bin/phpize ./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config make -j$(/usr/bin/nproc) - name: build xdebug - if: false run: | cd xdebug /opt/php/bin/phpize From 590323ccc818e19e52ee016458d82951ef742e1d Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 2 Feb 2024 18:24:37 +0100 Subject: [PATCH 10/22] Parallelize nightly tests and add more community libraries --- .github/jit_check.php | 30 ++++ .github/nightly.php | 266 ++++++++++++++++++++++++++++++++++ .github/workflows/nightly.yml | 128 +++++----------- 3 files changed, 331 insertions(+), 93 deletions(-) create mode 100644 .github/jit_check.php create mode 100644 .github/nightly.php diff --git a/.github/jit_check.php b/.github/jit_check.php new file mode 100644 index 0000000000000..50f3ac9ec3839 --- /dev/null +++ b/.github/jit_check.php @@ -0,0 +1,30 @@ +&1"), $result, $code); + $result = implode("\n", $result); + if ($code) { + printMutex("An error occurred while executing $cmd (status $code, extra info $extra): $result"); + die(1); + } + return $result; +} + +$parallel = (int) ($argv[1] ?? 0); +$parallel = $parallel ?: ((int)`nproc`); +$parallel = $parallel ?: 8; + +$repos = []; + +$repos["phpunit"] = [ + "https://github.com/sebastianbergmann/phpunit.git", + "main", + null, + ["./phpunit"], + 1 +]; + +$repos["infection"] = [ + "https://github.com/infection/infection", + "master", + null, + ["vendor/bin/phpunit"], + 1 +]; + +$repos["wordpress"] = [ + "https://github.com/WordPress/wordpress-develop.git", + "", + function (): void { + $f = file_get_contents('wp-tests-config-sample.php'); + $f = str_replace('youremptytestdbnamehere', 'test', $f); + $f = str_replace('yourusernamehere', 'root', $f); + $f = str_replace('yourpasswordhere', 'root', $f); + file_put_contents('wp-tests-config.php', $f); + }, + ["vendor/bin/phpunit"], + 1 +]; + +foreach (['amp', 'cache', 'dns', 'file', 'http', 'parallel', 'parser', 'pipeline', 'process', 'serialization', 'socket', 'sync', 'websocket-client', 'websocket-server'] as $repo) { + $repos["amphp-$repo"] = ["https://github.com/amphp/$repo.git", "", null, ["vendor/bin/phpunit"], 1]; +} + +$repos["laravel"] = [ + "https://github.com/laravel/framework.git", + "master", + function (): void { + $c = file_get_contents("tests/Filesystem/FilesystemTest.php"); + $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('skip')]\n public function testSharedGet()", $c); + file_put_contents("tests/Filesystem/FilesystemTest.php", $c); + }, + ["vendor/bin/phpunit", "--exclude-group", "skip"], + 1 +]; + +foreach (['async', 'cache', 'child-process', 'datagram', 'dns', 'event-loop', 'promise', 'promise-stream', 'promise-timer', 'stream'] as $repo) { + $repos["reactphp-$repo"] = ["https://github.com/reactphp/$repo.git", "", null, ["vendor/bin/phpunit"], 1]; +} + +$repos["revolt"] = ["https://github.com/revoltphp/event-loop.git", "", null, ["vendor/bin/phpunit"], 2]; + +$repos["symfony"] = [ + "https://github.com/symfony/symfony.git", + "", + function (): void { + e("php ./phpunit install"); + + // Test causes a heap-buffer-overflow but I cannot reproduce it locally... + $c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); + $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); + file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c); + // Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668 + $c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); + $c = str_replace("*/\n public function testCastNonTrailingCharPointer()", "* @group skip\n */\n public function testCastNonTrailingCharPointer()", $c); + file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c); + }, + function (): iterable { + $it = new RecursiveDirectoryIterator("src/Symfony"); + /** @var SplFileInfo $file */ + foreach(new RecursiveIteratorIterator($it) as $file) { + if ($file->getBasename() == 'phpunit.xml.dist') { + yield [ + getcwd()."/phpunit", + dirname($file->getRealPath()), + "--exclude-group", + "tty,benchmark,intl-data,transient", + "--exclude-group", + "skip" + ]; + } + } + }, + 1 +]; + +$finalStatus = 0; +$parentPids = []; + +$waitOne = function () use (&$finalStatus, &$parentPids): void { + $res = pcntl_wait($status); + if ($res === -1) { + printMutex("An error occurred while waiting with waitpid!"); + $finalStatus = $finalStatus ?: 1; + return; + } + if (!isset($parentPids[$res])) { + printMutex("Unknown PID $res returned!"); + $finalStatus = $finalStatus ?: 1; + return; + } + $desc = $parentPids[$res]; + unset($parentPids[$res]); + if (pcntl_wifexited($status)) { + $status = pcntl_wexitstatus($status); + printMutex("Child task $desc exited with status $status"); + if ($status !== 0) { + $finalStatus = $status; + } + } elseif (pcntl_wifstopped($status)) { + $status = pcntl_wstopsig($status); + printMutex("Child task $desc stopped by signal $status"); + $finalStatus = 1; + } elseif (pcntl_wifsignaled($status)) { + $status = pcntl_wtermsig($status); + printMutex("Child task $desc terminated by signal $status"); + $finalStatus = 1; + } +}; + +$waitAll = function () use ($waitOne, &$parentPids): void { + while ($parentPids) { + $waitOne(); + } +}; + +printMutex("Cloning repos..."); + +foreach ($repos as $dir => [$repo, $branch, $prepare, $command, $repeat]) { + $pid = pcntl_fork(); + if ($pid) { + $parentPids[$pid] = "clone $dir"; + continue; + } + + chdir(sys_get_temp_dir()); + if ($branch) { + $branch = "--branch $branch"; + } + e("git clone $repo $branch --depth 1 $dir"); + + exit(0); +} + +$waitAll(); + +printMutex("Done cloning repos!"); + +printMutex("Preparing repos (max $parallel processes)..."); +foreach ($repos as $dir => [$repo, $branch, $prepare, $command, $repeat]) { + chdir(sys_get_temp_dir()."/$dir"); + $rev = e("git rev-parse HEAD", $dir); + + $pid = pcntl_fork(); + if ($pid) { + $parentPids[$pid] = "prepare $dir ($rev)"; + if (count($parentPids) >= $parallel) { + $waitOne(); + } + continue; + } + + e("composer i --ignore-platform-reqs", $dir); + if ($prepare) { + $prepare(); + } + + exit(0); +} +$waitAll(); + +printMutex("Done preparing repos!"); + +printMutex("Running tests (max $parallel processes)..."); +foreach ($repos as $dir => [$repo, $branch, $prepare, $command, $repeat]) { + chdir(sys_get_temp_dir()."/$dir"); + $rev = e("git rev-parse HEAD", $dir); + + if ($command instanceof Closure) { + $commands = iterator_to_array($command()); + } else { + $commands = [$command]; + } + + foreach ($commands as $idx => $cmd) { + $cmd = array_merge([ + 'php', + '--repeat', + $repeat, + '-f', + __DIR__.'/jit_check.php', + ], $cmd); + + $cmdStr = implode(" ", $cmd); + + $pid = pcntl_fork(); + if ($pid) { + $parentPids[$pid] = "test $dir ($rev): $cmdStr"; + if (count($parentPids) >= $parallel) { + $waitOne(); + } + continue; + } + + $output = sys_get_temp_dir()."/out_{$dir}_$idx.txt"; + + $p = proc_open($cmd, [ + ["pipe", "r"], + ["file", $output, "a"], + ["file", $output, "a"] + ], $pipes, sys_get_temp_dir()."/$dir"); + + if ($p === false) { + printMutex("Failure starting $cmdStr"); + exit(1); + } + + $final = 0; + $status = proc_close($p); + if ($status !== 0) { + if ($status > 128) { + $final = $status; + } + printMutex( + "$dir ($rev): $cmdStr terminated with status $status:".PHP_EOL + .file_get_contents($output).PHP_EOL + ); + } + + exit($final); + } +} + +$waitAll(); + +printMutex("All done!"); + +die($finalStatus); diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e55f5d9bb16f0..a2e34443f79d5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -409,93 +409,49 @@ jobs: echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini php -v - - name: Test AMPHP + + - name: Test multiple libraries and frameworks in parallel + if: matrix.branch.ref != 'PHP-8.0' run: | - repositories="amp cache dns file http parallel parser pipeline process serialization socket sync websocket-client websocket-server" - X=0 - for repository in $repositories; do - printf "Testing amp/%s\n" "$repository" - git clone "https://github.com/amphp/$repository.git" "amphp-$repository" --depth 1 - cd "amphp-$repository" - git rev-parse HEAD - php /usr/bin/composer install --no-progress --ignore-platform-reqs - vendor/bin/phpunit || EXIT_CODE=$? - if [ ${EXIT_CODE:-0} -gt 128 ]; then - X=1; - fi - cd .. - done - exit $X - - name: Test Laravel + sudo prlimit --pid $$ --nofile=1048576:1048576 + + php $GITHUB_WORKSPACE/.github/nightly.php || exit $? + + - name: Test PHPSeclib + if: always() run: | - git clone https://github.com/laravel/framework.git --branch=master --depth=1 - cd framework - git rev-parse HEAD + git clone https://github.com/phpseclib/phpseclib --branch=master + cd phpseclib + git checkout 259bd9f1e8af11726ed74acf527c2c046549061b + export ASAN_OPTIONS=exitcode=139 + export PHPSECLIB_ALLOW_JIT=1 php /usr/bin/composer install --no-progress --ignore-platform-reqs - # Hack to disable a test that hangs - php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);' - php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$? - if [ ${EXIT_CODE:-0} -gt 128 ]; then - exit 1 - fi - - name: Test ReactPHP - run: | - repositories="async cache child-process datagram dns event-loop promise promise-stream promise-timer stream" - X=0 - for repository in $repositories; do - printf "Testing reactphp/%s\n" "$repository" - git clone "https://github.com/reactphp/$repository.git" "reactphp-$repository" --depth 1 - cd "reactphp-$repository" - git rev-parse HEAD - php /usr/bin/composer install --no-progress --ignore-platform-reqs - vendor/bin/phpunit || EXIT_CODE=$? - if [ $[EXIT_CODE:-0} -gt 128 ]; then - X=1; - fi - cd .. - done - exit $X - - name: Test Revolt PHP + php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? + + - name: Test Psalm run: | - git clone https://github.com/revoltphp/event-loop.git --depth=1 - cd event-loop + git clone https://github.com/vimeo/psalm --depth 1 + cd psalm git rev-parse HEAD + export ASAN_OPTIONS=exitcode=139 + # Needed to avoid overwriting JIT config + export PSALM_ALLOW_XDEBUG=1 php /usr/bin/composer install --no-progress --ignore-platform-reqs - vendor/bin/phpunit || EXIT_CODE=$? - if [ ${EXIT_CODE:-0} -gt 128 ]; then - exit 1 - fi - - name: Test Symfony + php $GITHUB_WORKSPACE/.github/jit_check.php ./psalm --no-cache || exit $? + + - name: Test PHPStan + if: matrix.branch.ref != 'PHP-8.2' run: | - git clone https://github.com/symfony/symfony.git --depth=1 - cd symfony + git clone https://github.com/phpstan/phpstan-src --depth 1 + cd phpstan-src git rev-parse HEAD + sed -E 's/phpVersion(.*)max[^)]+/phpVersion\1max(89999/g' conf/parametersSchema.neon -i php /usr/bin/composer install --no-progress --ignore-platform-reqs - php ./phpunit install - # Test causes a heap-buffer-overflow but I cannot reproduce it locally... - php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);' - # Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668 - php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("*/\n public function testCastNonTrailingCharPointer()", "* @group skip\n */\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);' - export SYMFONY_DEPRECATIONS_HELPER=max[total]=999 - X=0 - for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do - php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$? - if [ ${EXIT_CODE:-0} -gt 128 ]; then - X=1; - fi - done - exit $X - - name: Test PHPUnit - if: always() - run: | - git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1 - cd phpunit - git rev-parse HEAD - php /usr/bin/composer install --no-progress --ignore-platform-reqs - php ./phpunit || EXIT_CODE=$? - if [ ${EXIT_CODE:-0} -gt 128 ]; then - exit 1 - fi + sed -i 's/public const IS/public const int IS/g' vendor/ondrejmirtes/better-reflection/src/Reflection/Adapter/*php + export ASAN_OPTIONS=exitcode=139 + php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan clear-result-cache + php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan || exit $? + - name: 'Symfony Preloading' run: | php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-reqs @@ -503,21 +459,7 @@ jobs: git rev-parse HEAD sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php php -d opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php public/index.php - - name: Test Wordpress - if: always() - run: | - git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1 - cd wordpress - git rev-parse HEAD - php /usr/bin/composer install --no-progress --ignore-platform-reqs - cp wp-tests-config-sample.php wp-tests-config.php - sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php - sed -i 's/yourusernamehere/root/g' wp-tests-config.php - sed -i 's/yourpasswordhere/root/g' wp-tests-config.php - php vendor/bin/phpunit || EXIT_CODE=$? - if [ $EXIT_CODE -gt 128 ]; then - exit 1 - fi + - name: Notify Slack if: failure() uses: ./.github/actions/notify-slack From 2727ab9dc549a9a2a914bf26671d192f4606c0cc Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 2 Feb 2024 18:59:06 +0100 Subject: [PATCH 11/22] Bump --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a2e34443f79d5..8c02d1d0ca615 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -400,7 +400,7 @@ jobs: if: matrix.type != 'verify_type_inference' run: | echo opcache.jit=tracing >> /etc/php.d/opcache.ini - echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini + echo opcache.jit_buffer_size=128M >> /etc/php.d/opcache.ini echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini echo opcache.jit_max_exit_counters=100000 >> /etc/php.d/opcache.ini From d3eca11a12426babcac8e3f1a781707b83f00bbe Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 2 Feb 2024 18:59:44 +0100 Subject: [PATCH 12/22] Bump --- .github/workflows/nightly.yml | 690 +--------------------------------- 1 file changed, 1 insertion(+), 689 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8c02d1d0ca615..9c4da71921af0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -39,308 +39,6 @@ jobs: uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} - LINUX_X64: - needs: GENERATE_MATRIX - if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} - services: - postgres: - image: postgres - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: test - firebird: - image: jacobalberty/firebird - ports: - - 3050:3050 - env: - ISC_PASSWORD: test - FIREBIRD_DATABASE: test.fdb - FIREBIRD_USER: test - FIREBIRD_PASSWORD: test - strategy: - fail-fast: false - matrix: - branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} - configuration_parameters: [''] - debug: [true, false] - name: [''] - run_tests_parameters: [''] - test_function_jit: [true] - zts: [true, false] - include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.matrix-include) }} - name: "${{ matrix.branch.name }}_LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: ubuntu-${{ (matrix.branch.version.minor >= 3 && !matrix.asan) && '22.04' || '20.04' }} - steps: - - name: git checkout - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch.ref }} - - name: Create MSSQL container - uses: ./.github/actions/setup-mssql - - name: Create Oracle container - uses: ./.github/actions/setup-oracle - - name: apt - uses: ./.github/actions/apt-x64 - - name: System info - run: | - echo "::group::Show host CPU info" - lscpu - echo "::endgroup::" - echo "::group::Show installed package versions" - dpkg -l - echo "::endgroup::" - - name: ./configure - uses: ./.github/actions/configure-x64 - with: - configurationParameters: >- - ${{ matrix.configuration_parameters }} - --${{ matrix.debug && 'enable' || 'disable' }}-debug - --${{ matrix.zts && 'enable' || 'disable' }}-zts - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux - - name: Setup - uses: ./.github/actions/setup-x64 - - name: Test - uses: ./.github/actions/test-linux - with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} - runTestsParameters: >- - ${{ matrix.run_tests_parameters }} - idleCpu: ${{ matrix.asan && 'true' || 'false' }} - - name: Test Tracing JIT - uses: ./.github/actions/test-linux - with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT - jitType: tracing - runTestsParameters: >- - ${{ matrix.run_tests_parameters }} - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Test OpCache - uses: ./.github/actions/test-linux - with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache - runTestsParameters: >- - ${{ matrix.run_tests_parameters }} - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Test Function JIT - # ASAN frequently timeouts. Each test run takes ~90 minutes, we can - # avoid running into the 6 hour timeout by skipping the function JIT. - if: matrix.test_function_jit - uses: ./.github/actions/test-linux - with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT - jitType: function - runTestsParameters: >- - ${{ matrix.run_tests_parameters }} - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Verify generated files are up to date - uses: ./.github/actions/verify-generated-files - - name: Notify Slack - if: failure() - uses: ./.github/actions/notify-slack - with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} - LINUX_X32: - needs: GENERATE_MATRIX - if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} - strategy: - fail-fast: false - matrix: - branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} - debug: [true, false] - zts: [true, false] - name: "${{ matrix.branch.name }}_LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: ubuntu-latest - container: - image: ubuntu:${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }} - services: - mysql: - image: mysql:8 - ports: - - 3306:3306 - env: - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: root - steps: - - name: git checkout - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch.ref }} - - name: apt - uses: ./.github/actions/apt-x32 - - name: System info - run: | - echo "::group::Show host CPU info" - lscpu - echo "::endgroup::" - echo "::group::Show installed package versions" - dpkg -l - echo "::endgroup::" - - name: ./configure - uses: ./.github/actions/configure-x32 - with: - configurationParameters: >- - --${{ matrix.debug && 'enable' || 'disable' }}-debug - --${{ matrix.zts && 'enable' || 'disable' }}-zts - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux-x32 - - name: Test - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - ${{ matrix.run_tests_parameters }} - - name: Test Tracing JIT - uses: ./.github/actions/test-linux - with: - jitType: tracing - runTestsParameters: >- - ${{ matrix.run_tests_parameters }} - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Test OpCache - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - ${{ matrix.run_tests_parameters }} - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Test Function JIT - uses: ./.github/actions/test-linux - with: - jitType: function - runTestsParameters: >- - ${{ matrix.run_tests_parameters }} - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Notify Slack - if: failure() - uses: ./.github/actions/notify-slack - with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} - MACOS: - needs: GENERATE_MATRIX - if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} - strategy: - fail-fast: false - matrix: - include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.macos-matrix-include) }} - name: "${{ matrix.branch.name }}_MACOS_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: macos-${{ matrix.os }} - steps: - - name: git checkout - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch.ref }} - - name: brew - uses: ./.github/actions/brew - - name: ./configure - uses: ./.github/actions/configure-macos - with: - configurationParameters: >- - --${{ matrix.debug && 'enable' || 'disable' }}-debug - --${{ matrix.zts && 'enable' || 'disable' }}-zts - - name: make - run: |- - export PATH="$(brew --prefix)/opt/bison/bin:$PATH" - make -j$(sysctl -n hw.logicalcpu) >/dev/null - - name: make install - run: sudo make install - - name: Test - uses: ./.github/actions/test-macos - with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} - - name: Test Tracing JIT - uses: ./.github/actions/test-macos - with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT - jitType: tracing - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Test OpCache - uses: ./.github/actions/test-macos - with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Test Function JIT - uses: ./.github/actions/test-macos - with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT - jitType: function - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Verify generated files are up to date - uses: ./.github/actions/verify-generated-files - - name: Notify Slack - if: failure() - uses: ./.github/actions/notify-slack - with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} - COVERAGE_DEBUG_NTS: - if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch' - services: - postgres: - image: postgres - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: test - firebird: - image: jacobalberty/firebird - ports: - - 3050:3050 - env: - ISC_PASSWORD: test - FIREBIRD_DATABASE: test.fdb - FIREBIRD_USER: test - FIREBIRD_PASSWORD: test - runs-on: ubuntu-22.04 - steps: - - name: git checkout - uses: actions/checkout@v4 - - name: Create MSSQL container - uses: ./.github/actions/setup-mssql - - name: apt - uses: ./.github/actions/apt-x64 - - name: Install gcovr - run: sudo -H pip install gcovr - - name: ./configure - uses: ./.github/actions/configure-x64 - with: - configurationParameters: --enable-debug --disable-zts --enable-gcov - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux - - name: Setup - uses: ./.github/actions/setup-x64 - # We only test with OpCache, the difference in coverage is negligible - - name: Test OpCache - uses: ./.github/actions/test-linux - with: - jitType: tracing - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Upload Test Coverage to Codecov.io - if: always() - run: bash <(curl -s https://codecov.io/bash) - - name: Notify Slack - if: failure() - uses: ./.github/actions/notify-slack - with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} COMMUNITY: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -464,390 +162,4 @@ jobs: if: failure() uses: ./.github/actions/notify-slack with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} - OPCACHE_VARIATION: - needs: GENERATE_MATRIX - if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} - services: - postgres: - image: postgres - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: test - firebird: - image: jacobalberty/firebird - ports: - - 3050:3050 - env: - ISC_PASSWORD: test - FIREBIRD_DATABASE: test.fdb - FIREBIRD_USER: test - FIREBIRD_PASSWORD: test - strategy: - fail-fast: false - matrix: - branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} - name: "${{ matrix.branch.name }}_OPCACHE_VARIATION" - runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }} - steps: - - name: git checkout - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch.ref }} - - name: Create MSSQL container - uses: ./.github/actions/setup-mssql - - name: Create Oracle container - uses: ./.github/actions/setup-oracle - - name: apt - uses: ./.github/actions/apt-x64 - - name: ./configure - uses: ./.github/actions/configure-x64 - with: - configurationParameters: >- - --enable-debug --disable-zts - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux - - name: Setup - uses: ./.github/actions/setup-x64 - - name: Test File Cache (prime shm) - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - --file-cache-prime - - name: Test File Cache (prime shm, use shm) - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - --file-cache-use - - name: Test File Cache (prime shm, use file) - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - --file-cache-use - -d opcache.file_cache_only=1 - - name: Test File Cache Only (prime) - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - --file-cache-prime - -d opcache.file_cache_only=1 - - name: Test File Cache Only (use) - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - --file-cache-use - -d opcache.file_cache_only=1 - - name: Verify generated files are up to date - uses: ./.github/actions/verify-generated-files - - name: Notify Slack - if: failure() - uses: ./.github/actions/notify-slack - with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} - MSAN: - needs: GENERATE_MATRIX - if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} - strategy: - fail-fast: false - matrix: - branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} - name: "${{ matrix.branch.name }}_MSAN" - runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }} - steps: - - name: git checkout - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch.ref }} - - name: apt - uses: ./.github/actions/apt-x64 - - name: ./configure - run: | - export CC=clang - export CXX=clang++ - export CFLAGS="-DZEND_TRACK_ARENA_ALLOC" - ./buildconf --force - # msan requires all used libraries to be instrumented, - # so we should avoiding linking against anything but libc here - ./configure \ - --enable-debug \ - --enable-zts \ - --enable-option-checking=fatal \ - --prefix=/usr \ - --without-sqlite3 \ - --without-pdo-sqlite \ - --without-libxml \ - --disable-dom \ - --disable-simplexml \ - --disable-xml \ - --disable-xmlreader \ - --disable-xmlwriter \ - --without-pcre-jit \ - --disable-opcache-jit \ - --enable-phpdbg \ - --enable-fpm \ - --with-pdo-mysql=mysqlnd \ - --with-mysqli=mysqlnd \ - --disable-mysqlnd-compression-support \ - --without-pear \ - --enable-exif \ - --enable-sysvsem \ - --enable-sysvshm \ - --enable-shmop \ - --enable-pcntl \ - --enable-mbstring \ - --disable-mbregex \ - --enable-sockets \ - --enable-bcmath \ - --enable-calendar \ - --enable-ftp \ - --enable-zend-test \ - --enable-werror \ - --enable-memory-sanitizer \ - --with-config-file-path=/etc \ - --with-config-file-scan-dir=/etc/php.d \ - --enable-dl-test=shared - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - run: | - sudo make install - sudo mkdir -p /etc/php.d - sudo chmod 777 /etc/php.d - echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini - echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini - - name: Setup - run: | - set -x - sudo service mysql start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - # Ensure local_infile tests can run. - mysql -uroot -proot -e "SET GLOBAL local_infile = true" - sudo locale-gen de_DE - - name: Test - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - --msan - - name: Test Opcache - uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - --msan - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - - name: Verify generated files are up to date - uses: ./.github/actions/verify-generated-files - - name: Notify Slack - if: failure() - uses: ./.github/actions/notify-slack - with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} - LIBMYSQLCLIENT: - needs: GENERATE_MATRIX - if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} - strategy: - fail-fast: false - matrix: - branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} - name: "${{ matrix.branch.name }}_LIBMYSQLCLIENT" - runs-on: ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }} - steps: - - name: git checkout - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch.ref }} - - name: apt - run: | - sudo apt-get update -y | true - sudo apt install bison re2c - - name: Setup - run: | - sudo service mysql start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - # Ensure local_infile tests can run. - mysql -uroot -proot -e "SET GLOBAL local_infile = true" - - name: Build mysql-8.0 - uses: ./.github/actions/build-libmysqlclient - with: - configurationParameters: --enable-werror - libmysql: mysql-8.0.35-linux-glibc2.28-x86_64.tar.xz - withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} - - name: Test mysql-8.0 - uses: ./.github/actions/test-libmysqlclient - with: - withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} - - name: Build mysql-8.2 - uses: ./.github/actions/build-libmysqlclient - with: - configurationParameters: --enable-werror - libmysql: mysql-8.2.0-linux-glibc2.28-x86_64.tar.xz - withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} - - name: Test mysql-8.2 - uses: ./.github/actions/test-libmysqlclient - with: - withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} - - name: Verify generated files are up to date - uses: ./.github/actions/verify-generated-files - - name: Notify Slack - if: failure() - uses: ./.github/actions/notify-slack - with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} - PECL: - if: github.repository_owner == 'php' || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-22.04 - env: - CC: ccache gcc - CXX: ccache g++ - steps: - - name: git checkout PHP - uses: actions/checkout@v4 - with: - path: php - - name: git checkout apcu - uses: actions/checkout@v4 - with: - repository: krakjoe/apcu - path: apcu - - name: git checkout imagick - uses: actions/checkout@v4 - with: - repository: Imagick/imagick - path: imagick - - name: git checkout memcached - uses: actions/checkout@v4 - with: - repository: php-memcached-dev/php-memcached - path: memcached - - name: git checkout redis - # Currently fails to build - if: false - uses: actions/checkout@v4 - with: - repository: phpredis/phpredis - path: redis - - name: git checkout xdebug - uses: actions/checkout@v4 - with: - repository: xdebug/xdebug - path: xdebug - - name: git checkout yaml - uses: actions/checkout@v4 - with: - repository: php/pecl-file_formats-yaml - path: yaml - - name: apt - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - ccache \ - libmemcached-dev \ - bison \ - re2c - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: "${{github.job}}-${{hashFiles('php/main/php_version.h')}}" - append-timestamp: false - - name: build PHP - run: | - cd php - ./buildconf --force - ./configure \ - --enable-option-checking=fatal \ - --prefix=/opt/php \ - --enable-cli \ - --disable-all \ - --enable-session \ - --enable-werror - make -j$(/usr/bin/nproc) - sudo make install - - name: build apcu - run: | - cd apcu - /opt/php/bin/phpize - ./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config - make -j$(/usr/bin/nproc) - - name: build imagick - run: | - cd imagick - /opt/php/bin/phpize - ./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config - make -j$(/usr/bin/nproc) - - name: build memcached - run: | - cd memcached - /opt/php/bin/phpize - ./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config - make -j$(/usr/bin/nproc) - - name: build redis - # Currently fails to build - if: false - run: | - cd redis - /opt/php/bin/phpize - ./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config - make -j$(/usr/bin/nproc) - - name: build xdebug - run: | - cd xdebug - /opt/php/bin/phpize - ./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config - make -j$(/usr/bin/nproc) - - name: build yaml - run: | - cd yaml - /opt/php/bin/phpize - ./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config - make -j$(/usr/bin/nproc) - - name: Notify Slack - if: failure() - uses: ./.github/actions/notify-slack - with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} - WINDOWS: - needs: GENERATE_MATRIX - if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} - strategy: - fail-fast: false - matrix: - include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }} - name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: windows-2019 - env: - PHP_BUILD_CACHE_BASE_DIR: C:\build-cache - PHP_BUILD_OBJ_DIR: C:\obj - PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk - PHP_BUILD_SDK_BRANCH: php_downloads_server_migration_v1 - PHP_BUILD_CRT: vs16 - PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }} - THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}" - INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}" - PARALLEL: -j2 - OPCACHE: "${{ matrix.opcache && '1' || '0' }}" - steps: - - name: git config - run: git config --global core.autocrlf false && git config --global core.eol lf - - name: git checkout - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch.ref }} - - name: Setup - uses: ./.github/actions/setup-windows - - name: Build - run: .github/scripts/windows/build.bat - - name: Test - run: .github/scripts/windows/test.bat + token: ${{ secrets.ACTION_MONITORING_SLACK }} \ No newline at end of file From 9626b10559ec697b3a2abcdd4ad49bf3f777ec0e Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 2 Feb 2024 19:37:37 +0100 Subject: [PATCH 13/22] Bump --- .github/workflows/nightly.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9c4da71921af0..f33d27c306689 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -83,6 +83,8 @@ jobs: sudo service mysql start mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" mysql -uroot -proot -e "SET GLOBAL local_infile = true" + git fetch origin + git checkout master .github/jit_check.php .github/nightly.php - name: Enable Opcache run: | echo memory_limit=-1 >> /etc/php.d/opcache.ini @@ -108,13 +110,6 @@ jobs: echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini php -v - - name: Test multiple libraries and frameworks in parallel - if: matrix.branch.ref != 'PHP-8.0' - run: | - sudo prlimit --pid $$ --nofile=1048576:1048576 - - php $GITHUB_WORKSPACE/.github/nightly.php || exit $? - - name: Test PHPSeclib if: always() run: | @@ -127,6 +122,7 @@ jobs: php $GITHUB_WORKSPACE/.github/jit_check.php vendor/bin/paratest --verbose --configuration=tests/phpunit.xml --runner=WrapperRunner || exit $? - name: Test Psalm + if: always() run: | git clone https://github.com/vimeo/psalm --depth 1 cd psalm @@ -138,6 +134,7 @@ jobs: php $GITHUB_WORKSPACE/.github/jit_check.php ./psalm --no-cache || exit $? - name: Test PHPStan + if: always() if: matrix.branch.ref != 'PHP-8.2' run: | git clone https://github.com/phpstan/phpstan-src --depth 1 @@ -150,6 +147,13 @@ jobs: php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan clear-result-cache php $GITHUB_WORKSPACE/.github/jit_check.php bin/phpstan || exit $? + - name: Test multiple libraries and frameworks in parallel + if: matrix.branch.ref != 'PHP-8.0' + run: | + sudo prlimit --pid $$ --nofile=1048576:1048576 + + php $GITHUB_WORKSPACE/.github/nightly.php || exit $? + - name: 'Symfony Preloading' run: | php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-reqs @@ -162,4 +166,4 @@ jobs: if: failure() uses: ./.github/actions/notify-slack with: - token: ${{ secrets.ACTION_MONITORING_SLACK }} \ No newline at end of file + token: ${{ secrets.ACTION_MONITORING_SLACK }} From 826e8a3565f9c95a390465cd5bc0c21fda272bcd Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 2 Feb 2024 19:41:34 +0100 Subject: [PATCH 14/22] Fix --- .github/workflows/nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f33d27c306689..bd064eeca4067 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -134,7 +134,6 @@ jobs: php $GITHUB_WORKSPACE/.github/jit_check.php ./psalm --no-cache || exit $? - name: Test PHPStan - if: always() if: matrix.branch.ref != 'PHP-8.2' run: | git clone https://github.com/phpstan/phpstan-src --depth 1 From 3c9739d1ff1cdbad60c50b1cf5ff86a2f844741b Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 2 Feb 2024 20:09:11 +0100 Subject: [PATCH 15/22] Fix --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index bd064eeca4067..946bd2bfa2d1f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -84,7 +84,7 @@ jobs: mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" mysql -uroot -proot -e "SET GLOBAL local_infile = true" git fetch origin - git checkout master .github/jit_check.php .github/nightly.php + git checkout origin/master .github/jit_check.php .github/nightly.php - name: Enable Opcache run: | echo memory_limit=-1 >> /etc/php.d/opcache.ini From c853e322e75a4ef1f58930a607b985e490fa8089 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 2 Feb 2024 20:11:59 +0100 Subject: [PATCH 16/22] Fix --- .github/workflows/nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 946bd2bfa2d1f..6c7b92488a7f4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -97,7 +97,6 @@ jobs: echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini - name: Enable JIT - if: matrix.type != 'verify_type_inference' run: | echo opcache.jit=tracing >> /etc/php.d/opcache.ini echo opcache.jit_buffer_size=128M >> /etc/php.d/opcache.ini From 64ad8733c2e43453c2af8cea1a554bc0be6eb815 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 13 Nov 2024 12:24:29 +0000 Subject: [PATCH 17/22] Add --enable-rtld-deepbind configure flag --- Zend/zend_portability.h | 2 +- configure.ac | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 945f4a1e2713a..af1044db00939 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -164,7 +164,7 @@ # if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT) # define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT) -# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(memory_sanitizer) +# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(memory_sanitizer) && defined(PHP_USE_RTLD_DEEPBIND) # define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND) # else # define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL) diff --git a/configure.ac b/configure.ac index 8792c80b30536..0e05f075f9c1d 100644 --- a/configure.ac +++ b/configure.ac @@ -922,6 +922,23 @@ if test "$PHP_RTLD_NOW" = "yes"; then AC_DEFINE(PHP_USE_RTLD_NOW, 1, [ Use dlopen with RTLD_NOW instead of RTLD_LAZY ]) fi +if test "$PHP_SAPI" = "apache2handler"; then + PHP_RTLD_DEEPBIND_DEFAULT=yes +else + PHP_RTLD_DEEPBIND_DEFAULT=no +fi + +PHP_ARG_ENABLE([rtld-deepbind], + [whether to dlopen extensions with RTLD_DEEPBIND], + [AS_HELP_STRING([--enable-rtld-deepbind], + [Use dlopen with RTLD_DEEPBIND])], + [$PHP_RTLD_DEEPBIND_DEFAULT], + [$PHP_RTLD_DEEPBIND_DEFAULT]) + +if test "$PHP_RTLD_DEEPBIND" = "yes"; then + AC_DEFINE(PHP_USE_RTLD_DEEPBIND, 1, [ Use dlopen with RTLD_DEEPBIND ]) +fi + PHP_ARG_WITH([layout], [layout of installed files], [AS_HELP_STRING([--with-layout=TYPE], From 030d1a4a81468978da250f8eda1d734095b8261c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 13 Nov 2024 15:39:51 +0000 Subject: [PATCH 18/22] Bump --- .github/nightly.php | 2 +- .github/workflows/nightly.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/nightly.php b/.github/nightly.php index c18d636e59b38..c504e49d2237d 100644 --- a/.github/nightly.php +++ b/.github/nightly.php @@ -212,7 +212,7 @@ function (): iterable { foreach ($commands as $idx => $cmd) { $cmd = array_merge([ - 'php', + PHP_BINARY, '--repeat', $repeat, '-f', diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6606c5017cff8..d6c3573d9b9d7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -496,7 +496,6 @@ jobs: run: | git clone https://github.com/phpseclib/phpseclib --branch=master cd phpseclib - git checkout 259bd9f1e8af11726ed74acf527c2c046549061b export ASAN_OPTIONS=exitcode=139 export PHPSECLIB_ALLOW_JIT=1 php /usr/bin/composer install --no-progress --ignore-platform-reqs From 40d54218503d16cf8151507d92e80bf17b02cede Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 13 Nov 2024 15:42:16 +0000 Subject: [PATCH 19/22] Bump --- .github/workflows/nightly.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d6c3573d9b9d7..6c8c1e12d0fe3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -462,7 +462,6 @@ jobs: run: | echo memory_limit=-1 >> /etc/php.d/opcache.ini echo zend_extension=opcache.so > /etc/php.d/opcache.ini - echo opcache.enable=1 >> /etc/php.d/opcache.ini echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini echo opcache.enable=1 >> /etc/php.d/opcache.ini echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini @@ -475,9 +474,12 @@ jobs: run: | echo opcache.jit=tracing >> /etc/php.d/opcache.ini echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini - echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini - echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini - echo opcache.jit_max_exit_counters=100000 >> /etc/php.d/opcache.ini + echo opcache.jit_prof_threshold=0.000000001 >> /etc/php.d/opcache.ini + echo opcache.jit_max_root_traces=10000000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_side_traces=10000000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_exit_counters=10000000 >> /etc/php.d/opcache.ini + echo opcache.jit_blacklist_root_trace=255 >> /etc/php.d/opcache.ini + echo opcache.jit_blacklist_side_trace=255 >> /etc/php.d/opcache.ini echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini From 495749a784501e5818e657d24209fbd4f36d3dc0 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 13 Nov 2024 15:49:33 +0000 Subject: [PATCH 20/22] Bump --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e0a5ef4ac6b37..e40b65bbd8c8d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -125,7 +125,7 @@ jobs: CFLAGS="-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address" run_tests_parameters: '--asan --repeat 2' - test_function_jit: false + test_function_jit: true asan: true - name: _REPEAT debug: true From 103fd829f90cf3c9222c49b3f61afd3945d34da5 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Wed, 13 Nov 2024 16:02:03 +0000 Subject: [PATCH 21/22] bump --- .github/workflows/nightly.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e40b65bbd8c8d..462ac47bbd133 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -475,9 +475,9 @@ jobs: echo opcache.jit=tracing >> /etc/php.d/opcache.ini echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini echo opcache.jit_prof_threshold=0.000000001 >> /etc/php.d/opcache.ini - echo opcache.jit_max_root_traces=10000000 >> /etc/php.d/opcache.ini - echo opcache.jit_max_side_traces=10000000 >> /etc/php.d/opcache.ini - echo opcache.jit_max_exit_counters=10000000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_side_traces=100000 >> /etc/php.d/opcache.ini + echo opcache.jit_max_exit_counters=100000 >> /etc/php.d/opcache.ini echo opcache.jit_blacklist_root_trace=255 >> /etc/php.d/opcache.ini echo opcache.jit_blacklist_side_trace=255 >> /etc/php.d/opcache.ini echo opcache.jit_hot_loop=1 >> /etc/php.d/opcache.ini From 1f40a4c6df62c3a6c56245900f3afa1f882cad4c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Fri, 15 Nov 2024 16:16:05 +0000 Subject: [PATCH 22/22] Improve tests --- run-tests.php | 1 + 1 file changed, 1 insertion(+) diff --git a/run-tests.php b/run-tests.php index 7ab158bce5c5c..e123dee9ee859 100755 --- a/run-tests.php +++ b/run-tests.php @@ -299,6 +299,7 @@ function main(): void 'opcache.jit_max_root_traces=100000', 'opcache.jit_max_side_traces=100000', 'opcache.jit_max_exit_counters=100000', + 'opcache.jit_prof_threshold=0.000000001', 'opcache.protect_memory=1', 'zend.assertions=1', 'zend.exception_ignore_args=0',