From 435da416c84086a9ac247ca9eeed4e7c7dd6408d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 2 Apr 2022 22:59:21 +0200 Subject: [PATCH 1/2] Assert generated files are up to date in CI --- .github/actions/apt-x64/action.yml | 8 ++++---- .github/actions/verify-templating/action.yml | 11 +++++++++++ .github/workflows/nightly.yml | 5 +++++ .github/workflows/push.yml | 6 ++++++ build/gen_stub.php | 2 +- .../tests/mysqli_pam_sha256_public_key_ini.phpt | 1 + ext/pgsql/tests/80_bug14383.phpt | 4 ++++ ext/standard/basic_functions_arginfo.h | 2 +- 8 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 .github/actions/verify-templating/action.yml diff --git a/.github/actions/apt-x64/action.yml b/.github/actions/apt-x64/action.yml index c21a34534aea8..a5b0db49e8270 100644 --- a/.github/actions/apt-x64/action.yml +++ b/.github/actions/apt-x64/action.yml @@ -59,10 +59,10 @@ runs: libpng-dev \ libfreetype6-dev mkdir /opt/oracle - wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip - unzip instantclient-basiclite-linuxx64.zip - wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip - unzip instantclient-sdk-linuxx64.zip + wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip + unzip instantclient-basiclite-linuxx64.zip && rm instantclient-basiclite-linuxx64.zip + wget -nv https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip + unzip instantclient-sdk-linuxx64.zip && rm instantclient-sdk-linuxx64.zip mv instantclient_*_* /opt/oracle/instantclient # Interferes with libldap2 headers. rm /opt/oracle/instantclient/sdk/include/ldap.h diff --git a/.github/actions/verify-templating/action.yml b/.github/actions/verify-templating/action.yml new file mode 100644 index 0000000000000..320246031d161 --- /dev/null +++ b/.github/actions/verify-templating/action.yml @@ -0,0 +1,11 @@ +name: verify-templating +runs: + using: composite + steps: + - shell: bash + run: | + set -x + scripts/dev/genfiles + Zend/zend_vm_gen.php + build/gen_stub.php -f + git add . -N && git diff --exit-code diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 67259e503b1db..27ae58ea857f6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -93,6 +93,8 @@ jobs: -d opcache.enable_cli=1 -d opcache.jit_buffer_size=16M -d opcache.jit=1205 + - name: Assert generated files are up to date + uses: ./.github/actions/verify-templating MACOS: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -149,3 +151,6 @@ jobs: -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M -d opcache.jit=1205 + - name: Assert generated files are up to date + if: false # TODO scripts/dev/genfiles needs Bison 3.0 + uses: ./.github/actions/verify-templating diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4e2879a8ab517..f508ad5ef8812 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -14,6 +14,7 @@ on: - PHP-8.0 - PHP-8.1 - master + - '**.cipush' pull_request: branches: - '**' @@ -57,6 +58,8 @@ jobs: -d zend_extension=opcache.so -d opcache.enable_cli=1 -d opcache.jit_buffer_size=16M + - name: Assert generated files are up to date + uses: ./.github/actions/verify-templating MACOS_DEBUG_NTS: runs-on: macos-10.15 steps: @@ -84,3 +87,6 @@ jobs: -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M + - name: Assert generated files are up to date + if: false # TODO scripts/dev/genfiles needs Bison 3.0 + uses: ./.github/actions/verify-templating diff --git a/build/gen_stub.php b/build/gen_stub.php index e288a4a7df1aa..d3edf91081a07 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -1801,7 +1801,7 @@ function initPhpParser() { } $isInitialized = true; - $version = "4.9.0"; + $version = "4.13.0"; $phpParserDir = __DIR__ . "/PHP-Parser-$version"; if (!is_dir($phpParserDir)) { installPhpParser($version, $phpParserDir); diff --git a/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt b/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt index 86e27fbaff7d9..e45aff93dd33e 100644 --- a/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt +++ b/ext/mysqli/tests/mysqli_pam_sha256_public_key_ini.phpt @@ -59,6 +59,7 @@ if (strlen($key) != fwrite($fp, $key)) { if (!$link->query("SET @@session.old_passwords=2")) { + @unlink($file); die(sprintf("skip Cannot set @@session.old_passwords=2 [%d] %s", $link->errno, $link->error)); } diff --git a/ext/pgsql/tests/80_bug14383.phpt b/ext/pgsql/tests/80_bug14383.phpt index e9c6093888161..14a241ffa5505 100644 --- a/ext/pgsql/tests/80_bug14383.phpt +++ b/ext/pgsql/tests/80_bug14383.phpt @@ -18,6 +18,10 @@ pg_close($dbh); require_once(__DIR__.'/../../dba/tests/test.inc'); require_once(__DIR__.'/../../dba/tests/dba_handler.inc'); +?> +--CLEAN-- + --EXPECTF-- database handler: %s diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index ac6e4c65aa1a9..8b97a129f6934 100644 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -829,7 +829,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_trim, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, characters, IS_STRING, 0, "\" \\n\\r\\t\\v\\0\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, characters, IS_STRING, 0, "\" \\n\\r\\t\\v\\x00\"") ZEND_END_ARG_INFO() #define arginfo_rtrim arginfo_trim From 0bed2de8f6993f78fa54467cb8f453da2f9c007f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 17 Apr 2022 09:36:01 +0200 Subject: [PATCH 2/2] fix PATH for Bison on MacOS --- .github/actions/verify-templating/action.yml | 1 + .github/workflows/nightly.yml | 1 - .github/workflows/push.yml | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/verify-templating/action.yml b/.github/actions/verify-templating/action.yml index 320246031d161..f80a5dbd6d807 100644 --- a/.github/actions/verify-templating/action.yml +++ b/.github/actions/verify-templating/action.yml @@ -5,6 +5,7 @@ runs: - shell: bash run: | set -x + [[ "$OSTYPE" == "darwin"* ]] && export PATH="/usr/local/opt/bison/bin:$PATH" scripts/dev/genfiles Zend/zend_vm_gen.php build/gen_stub.php -f diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 27ae58ea857f6..ff0e39cf4076c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -152,5 +152,4 @@ jobs: -d opcache.jit_buffer_size=16M -d opcache.jit=1205 - name: Assert generated files are up to date - if: false # TODO scripts/dev/genfiles needs Bison 3.0 uses: ./.github/actions/verify-templating diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f508ad5ef8812..88a2c8a1915bc 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -88,5 +88,4 @@ jobs: -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M - name: Assert generated files are up to date - if: false # TODO scripts/dev/genfiles needs Bison 3.0 uses: ./.github/actions/verify-templating