From 36de002cc62feb01527cc348e9c2ca9f94d4e43e 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] Verify generated files are up to date in CI Closes GH-8295 --- .github/actions/apt-x64/action.yml | 8 ++++---- .github/actions/verify-generated-files/action.yml | 12 ++++++++++++ .github/workflows/nightly.yml | 4 ++++ .github/workflows/push.yml | 4 ++++ 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, 31 insertions(+), 6 deletions(-) create mode 100644 .github/actions/verify-generated-files/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-generated-files/action.yml b/.github/actions/verify-generated-files/action.yml new file mode 100644 index 0000000000000..02ca79160b0d7 --- /dev/null +++ b/.github/actions/verify-generated-files/action.yml @@ -0,0 +1,12 @@ +name: Verify generated files are up to date +runs: + using: composite + steps: + - 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 + git add . -N && git diff --exit-code diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 67259e503b1db..4d347323e89b3 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: Verify generated files are up to date + uses: ./.github/actions/verify-generated-files MACOS: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} @@ -149,3 +151,5 @@ jobs: -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M -d opcache.jit=1205 + - name: Verify generated files are up to date + uses: ./.github/actions/verify-generated-files diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4e2879a8ab517..4a1619ab5d106 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -57,6 +57,8 @@ jobs: -d zend_extension=opcache.so -d opcache.enable_cli=1 -d opcache.jit_buffer_size=16M + - name: Verify generated files are up to date + uses: ./.github/actions/verify-generated-files MACOS_DEBUG_NTS: runs-on: macos-10.15 steps: @@ -84,3 +86,5 @@ jobs: -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M + - name: Verify generated files are up to date + uses: ./.github/actions/verify-generated-files 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