From 25c09939029d8fc1b954ad8e13a394ffdcb27bf0 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 28 Oct 2024 15:56:53 +0100 Subject: [PATCH] Backport CI fixes to security branches Closes GH-16469 Working towards GH-16286 commit e0db221143b808d97bc3a44e9f0968c6308794b4 Author: Ilija Tovilo Date: Fri Oct 25 22:48:20 2024 +0200 Move CFLAGS into ./configure command for consistency commit 8ad67768250d181cd7fef30e0c866625bbd8ac94 Author: Ilija Tovilo Date: Fri Oct 25 22:47:03 2024 +0200 Also upgrade nightly to macOS 13 commit 58a88ccb9f652adbd13e8c2b5186fb31213f0789 Author: Ilija Tovilo Date: Wed Oct 23 19:07:59 2024 +0200 Fix call to dc[n]gettext in tests with 0 $category This causes a segfault on PHP-8.1 commit 611af05c50685acbb22f0f9d18dd37234c3546f1 Author: Ilija Tovilo Date: Fri Dec 8 13:36:52 2023 +0100 [skip ci] Skip intermittently failing curl test on macOS The test fails with "CURL ERROR: 56". I will create an issue for it shortly. commit ec745178bbded22830046d2ba3458120b778c21f Author: Ilija Tovilo Date: Wed Oct 23 19:05:32 2024 +0200 Backport parts of 9999a0c for gettext See 9999a0cb757344974889a6f548727de6f2c3c10d commit 5ce703496f4c9f0e95cc26af60f6abe62efde1d4 Author: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun Jul 28 14:34:26 2024 +0200 Fix CI failure on macOS after Curl update commit 714a3e707113510fb82bd507e9fd6f92954ca753 Author: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat Jul 27 16:09:50 2024 +0200 Fix CI failure after Curl update (#15124) commit 4f2eb921b9b3f3f68ff84605afb77dbd00829a44 Author: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu May 23 22:20:37 2024 +0200 Fix GH-14307: Test curl_basic_024 fails with curl 8.8.0 Curl changed the behaviour, from the changelog: - lib: make protocol handlers store scheme name lowercase curl/curl@c294f9c From the docs: "The returned scheme might be upper or lowercase. Do comparisons case insensitively." Closes GH-14312. commit 251195b41bea35f356bdd2bfc3623da38dafa3e8 Author: Ayesh Karunaratne Date: Thu Feb 1 02:03:55 2024 +0700 ext/curl: Fix failing tests due to string changes in libcurl 8.6.0 Upstream libcurl 8.6.0 contains a change[^1] that caused a test failure. This fixes it by updating the test's `EXPECTF` to use a regex to account for both string patterns. [^1]: https://github.com/curl/curl/commit/45cf4755e71f#diff-a8a54563608f8155973318f4ddb61d7328dab512b8ff2b5cc48cc76979d4204cL1683 Closes GH-13293. commit fc5d83f2b147d10d3f20aa96d9425b69d15b1b39 Author: Christoph M. Becker Date: Wed Oct 16 22:46:20 2024 +0200 Prepare for necessary move to macOS 13 GH will remove macOS 12 runner images as of December 3rd, so we prepare for that. Besides the obvious need to change the runner, we also suppress a couple of warnings, because otherwise the build would fail due to `-Werror`. --- .github/actions/configure-macos/action.yml | 1 + .github/workflows/nightly.yml | 2 +- .github/workflows/push.yml | 2 +- Zend/tests/arginfo_zpp_mismatch.inc | 3 +++ ext/curl/tests/bug77946.phpt | 2 +- ext/curl/tests/curl_basic_024.phpt | 4 ++-- ext/curl/tests/curl_setopt_ssl.phpt | 1 + ext/gettext/tests/dcngettext.phpt | 4 ++-- ext/standard/tests/file/bug52820.phpt | 8 ++++---- 9 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/actions/configure-macos/action.yml b/.github/actions/configure-macos/action.yml index 317d705645985..650efcfee8810 100644 --- a/.github/actions/configure-macos/action.yml +++ b/.github/actions/configure-macos/action.yml @@ -20,6 +20,7 @@ runs: export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig" ./buildconf --force ./configure \ + CFLAGS="-Wno-strict-prototypes -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion" \ --enable-option-checking=fatal \ --prefix=/usr/local \ --enable-fpm \ diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index f945ec23c9e3e..d05df1bf74320 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -199,7 +199,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-13 steps: - name: git checkout uses: actions/checkout@v4 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 0e0de633de286..8bce17224eb2c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -97,7 +97,7 @@ jobs: uses: ./.github/actions/verify-generated-files MACOS_DEBUG_NTS: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - runs-on: macos-12 + runs-on: macos-13 steps: - name: git checkout uses: actions/checkout@v4 diff --git a/Zend/tests/arginfo_zpp_mismatch.inc b/Zend/tests/arginfo_zpp_mismatch.inc index 023bfefa5d501..27fa16547802e 100644 --- a/Zend/tests/arginfo_zpp_mismatch.inc +++ b/Zend/tests/arginfo_zpp_mismatch.inc @@ -29,6 +29,9 @@ function skipFunction($function): bool { || $function === 'posix_setrlimit' || $function === 'sapi_windows_generate_ctrl_event' || $function === 'imagegrabscreen' + // PHP-8.1 only + || $function === 'dcgettext' + || $function === 'dcngettext' ) { return true; } diff --git a/ext/curl/tests/bug77946.phpt b/ext/curl/tests/bug77946.phpt index 8b1e70675554f..7b836187d6bfb 100644 --- a/ext/curl/tests/bug77946.phpt +++ b/ext/curl/tests/bug77946.phpt @@ -34,4 +34,4 @@ curl_multi_close($mh); --EXPECTF-- int(1) int(1) -string(%d) "Protocol %Sunknown%S not supported or disabled in libcurl" +string(%d) "Protocol %Sunknown%S %rnot supported( or disabled in libcurl)?%r" diff --git a/ext/curl/tests/curl_basic_024.phpt b/ext/curl/tests/curl_basic_024.phpt index b16bfed03835f..84216bde308eb 100644 --- a/ext/curl/tests/curl_basic_024.phpt +++ b/ext/curl/tests/curl_basic_024.phpt @@ -25,7 +25,7 @@ var_dump(0 === curl_getinfo($ch, CURLINFO_PROXY_SSL_VERIFYRESULT)); var_dump(curl_getinfo($ch, CURLINFO_SCHEME)); curl_close($ch); ?> ---EXPECT-- +--EXPECTF-- bool(true) bool(true) -string(4) "HTTP" +string(4) "%r(HTTP|http)%r" diff --git a/ext/curl/tests/curl_setopt_ssl.phpt b/ext/curl/tests/curl_setopt_ssl.phpt index 52ff95ab34bcf..2e28466a84057 100644 --- a/ext/curl/tests/curl_setopt_ssl.phpt +++ b/ext/curl/tests/curl_setopt_ssl.phpt @@ -8,6 +8,7 @@ if (!function_exists("proc_open")) die("skip no proc_open"); exec('openssl version', $out, $code); if ($code > 0) die("skip couldn't locate openssl binary"); if (PHP_OS_FAMILY === 'Windows') die('skip not for Windows'); +if (PHP_OS_FAMILY === 'Darwin') die('skip Fails intermittently on macOS'); $curl_version = curl_version(); if ($curl_version['version_number'] < 0x074700) { die("skip: blob options not supported for curl < 7.71.0"); diff --git a/ext/gettext/tests/dcngettext.phpt b/ext/gettext/tests/dcngettext.phpt index 715281ec8296b..2f356b1cf0c6a 100644 --- a/ext/gettext/tests/dcngettext.phpt +++ b/ext/gettext/tests/dcngettext.phpt @@ -11,10 +11,10 @@ if (!function_exists("dcngettext")) die("skip dcngettext() doesn't exist"); var_dump(dcngettext(1,1,1,1,1)); var_dump(dcngettext("test","test","test",1,1)); -var_dump(dcngettext("test","test","test",0,0)); +var_dump(dcngettext("test","test","test",0,1)); var_dump(dcngettext("test","test","test",-1,-1)); var_dump(dcngettext("","","",1,1)); -var_dump(dcngettext("","","",0,0)); +var_dump(dcngettext("","","",0,1)); echo "Done\n"; ?> diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt index ff816178cef67..2d3cedad87944 100644 --- a/ext/standard/tests/file/bug52820.phpt +++ b/ext/standard/tests/file/bug52820.phpt @@ -46,21 +46,21 @@ echo "\nDone.\n"; temp stream \(close after\): About to rewind! (\* processing: file:\/\/\/i_dont_exist\/\n)?\* Couldn't open file \/i_dont_exist\/ -\* Closing connection( -?\d+)? +\* [Cc]losing connection( #?-?\d+)? memory stream \(close after\): About to rewind! (\* processing: file:\/\/\/i_dont_exist\/\n)?\* Couldn't open file \/i_dont_exist\/ -\* Closing connection( -?\d+)? +\* [Cc]losing connection( #?-?\d+)? temp stream \(leak\): About to rewind! (\* processing: file:\/\/\/i_dont_exist\/\n)?\* Couldn't open file \/i_dont_exist\/ -\* Closing connection( -?\d+)? +\* [Cc]losing connection( #?-?\d+)? memory stream \(leak\): About to rewind! (\* processing: file:\/\/\/i_dont_exist\/\n)?\* Couldn't open file \/i_dont_exist\/ -\* Closing connection( -?\d+)? +\* [Cc]losing connection( #?-?\d+)? Done\.