From 8241576f4f26ab4d5623b6508fa495ff3ecf36d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 12 Nov 2022 18:48:02 +0100 Subject: [PATCH 01/16] FOR REBASE copy .github/scripts/windows/* from PHP 8.0 --- .github/scripts/windows/build_task.bat | 5 +++- .github/scripts/windows/test_task.bat | 32 ++++---------------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index 61e3042fadd28..91fedae855374 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -51,6 +51,9 @@ if %errorlevel% neq 0 exit /b 3 if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS% +set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_firebird,ldap,imap,ftp +if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache + set CFLAGS=/W1 /WX cmd /c configure.bat ^ @@ -61,7 +64,7 @@ cmd /c configure.bat ^ --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^ --with-php-build=%DEPS_DIR% ^ %ADD_CONF% ^ - --disable-test-ini + --with-test-ini-ext-exclude=%EXT_EXCLUDE_FROM_TEST% if %errorlevel% neq 0 exit /b 3 nmake /NOLOGO diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 39f0eb07c048a..a97731a6ddd33 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -62,10 +62,8 @@ rem set OPENSSL_CONF=%OPENSSLDIR%\openssl.cnf set OPENSSL_CONF= rem set SSLEAY_CONF= -rem prepare for OPcache +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=16M -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 rem prepare for enchant mkdir C:\usr\local\lib\enchant-2 @@ -91,39 +89,19 @@ if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\en_US.aff" ( mkdir %LOCALAPPDATA%\enchant\hunspell copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\* %LOCALAPPDATA%\enchant\hunspell -set PHP_BUILD_DIR=%PHP_BUILD_OBJ_DIR%\Release -if "%THREAD_SAFE%" equ "1" set PHP_BUILD_DIR=%PHP_BUILD_DIR%_TS - -mkdir %PHP_BUILD_DIR%\test_file_cache -rem generate php.ini -echo extension_dir=%PHP_BUILD_DIR% > %PHP_BUILD_DIR%\php.ini -echo opcache.file_cache=%PHP_BUILD_DIR%\test_file_cache >> %PHP_BUILD_DIR%\php.ini -if "%OPCACHE%" equ "1" echo zend_extension=php_opcache.dll >> %PHP_BUILD_DIR%\php.ini -rem work-around for some spawned PHP processes requiring OpenSSL -echo extension=php_openssl.dll >> %PHP_BUILD_DIR%\php.ini - -rem remove ext dlls for which tests are not supported -for %%i in (imap ldap oci8_12c pdo_firebird pdo_oci snmp) do ( - del %PHP_BUILD_DIR%\php_%%i.dll -) - -set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe +set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_OBJ_DIR%\Release +if "%THREAD_SAFE%" equ "1" set TEST_PHPDBG_EXECUTABLE=%TEST_PHPDBG_EXECUTABLE%_TS +set TEST_PHPDBG_EXECUTABLE=%TEST_PHPDBG_EXECUTABLE%\phpdbg.exe mkdir c:\tests_tmp set TEST_PHP_JUNIT=c:\junit.out.xml cd "%APPVEYOR_BUILD_FOLDER%" -nmake test TESTS="%OPCACHE_OPTS% -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp --bless %PARALLEL%" +nmake test TESTS="%OPCACHE_OPTS% -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" set EXIT_CODE=%errorlevel% appveyor PushArtifact %TEST_PHP_JUNIT% -if %EXIT_CODE% GEQ 1 ( - git checkout ext\pgsql\tests\config.inc - git diff > bless_tests.patch - appveyor PushArtifact bless_tests.patch -) - exit /b %EXIT_CODE% From 2201f219a7cb323803a0acef929251db483ce793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 27 Apr 2022 17:46:53 +0200 Subject: [PATCH 02/16] Migrate Windows CI to Github Actions I. --- .appveyor.yml | 3 -- .github/scripts/windows/build.bat | 40 ++++++++------------------ .github/scripts/windows/build_task.bat | 5 ++++ .github/scripts/windows/test.bat | 12 ++++---- .github/scripts/windows/test_task.bat | 7 ++++- buildconf.bat | 1 + win32/build/configure.bat | 1 + win32/build/phpize.bat | 1 + 8 files changed, 31 insertions(+), 39 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7567578af258d..3fcb381dc7257 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,9 +11,6 @@ skip_commits: - UPGRADING - UPGRADING.INTERNALS -cache: - - c:\build-cache - environment: PHP_BUILD_CACHE_BASE_DIR: c:\build-cache PHP_BUILD_OBJ_DIR: c:\obj diff --git a/.github/scripts/windows/build.bat b/.github/scripts/windows/build.bat index cb85f605c610e..6e4c999e5ac85 100644 --- a/.github/scripts/windows/build.bat +++ b/.github/scripts/windows/build.bat @@ -1,44 +1,28 @@ @echo off +if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" ( + echo for CI only + exit /b 3 +) + set SDK_REMOTE=https://github.com/php/php-sdk-binary-tools.git set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH% set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat -if not exist "%PHP_BUILD_CACHE_BASE_DIR%" ( - echo Creating %PHP_BUILD_CACHE_BASE_DIR% - mkdir "%PHP_BUILD_CACHE_BASE_DIR%" -) - -if not exist "%PHP_BUILD_OBJ_DIR%" ( - echo Creating %PHP_BUILD_OBJ_DIR% - mkdir "%PHP_BUILD_OBJ_DIR%" -) +mkdir "%PHP_BUILD_CACHE_BASE_DIR%" +mkdir "%PHP_BUILD_OBJ_DIR%" -if not exist "%SDK_RUNNER%" ( - if exist "%PHP_BUILD_CACHE_SDK_DIR%" rmdir /s /q "%PHP_BUILD_CACHE_SDK_DIR%" -) - -if not exist "%PHP_BUILD_CACHE_SDK_DIR%" ( - echo Cloning remote SDK repository - git clone --branch %SDK_BRANCH% %SDK_REMOTE% --depth 1 "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1 -) +echo Cloning remote SDK repository +git clone -q --branch %SDK_BRANCH% %SDK_REMOTE% --depth 1 "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1 for /f "tokens=*" %%a in ('type %PHP_BUILD_CACHE_SDK_DIR%\VERSION') do set GOT_SDK_VER=%%a echo Got SDK version %GOT_SDK_VER% if NOT "%GOT_SDK_VER%" == "%PHP_BUILD_SDK_BRANCH:~8%" ( echo Switching to the configured SDK version %SDK_BRANCH:~8% echo Fetching remote SDK repository - git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1 + git -q --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin echo Checkout SDK repository branch - git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH% + git -q --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH% ) -if not exist "%SDK_RUNNER%" ( - echo "%SDK_RUNNER%" doesn't exist - exit /b 3 -) - -cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\.github\scripts\windows\build_task.bat -if %errorlevel% neq 0 exit /b 3 - -exit /b 0 +cmd /c %SDK_RUNNER% -t .github\scripts\windows\build_task.bat diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index 91fedae855374..48830eacc5f6f 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -1,5 +1,10 @@ @echo off +if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" ( + echo for CI only + exit /b 3 +) + if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL if %errorlevel% neq 0 exit /b 3 if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL diff --git a/.github/scripts/windows/test.bat b/.github/scripts/windows/test.bat index f51a14b9dc64c..586100b9e55d9 100644 --- a/.github/scripts/windows/test.bat +++ b/.github/scripts/windows/test.bat @@ -1,12 +1,10 @@ @echo off -set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat -if not exist "%SDK_RUNNER%" ( - echo "%SDK_RUNNER%" doesn't exist - exit /b 3 +if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" ( + echo for CI only + exit /b 3 ) -cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\.github\scripts\windows\test_task.bat -if %errorlevel% neq 0 exit /b 3 +set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat -exit /b 0 +cmd /c %SDK_RUNNER% -t .github\scripts\windows\test_task.bat diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index a97731a6ddd33..1374c31862cf6 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -1,5 +1,10 @@ @echo off +if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" ( + echo for CI only + exit /b 3 +) + set NO_INTERACTION=1 set REPORT_EXIT_STATUS=1 set SKIP_IO_CAPTURE_TESTS=1 @@ -98,7 +103,7 @@ mkdir c:\tests_tmp set TEST_PHP_JUNIT=c:\junit.out.xml cd "%APPVEYOR_BUILD_FOLDER%" -nmake test TESTS="%OPCACHE_OPTS% -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" +nmake test TESTS="%OPCACHE_OPTS% -q --offline -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" set EXIT_CODE=%errorlevel% diff --git a/buildconf.bat b/buildconf.bat index 004d36f42c085..fa73a4f590494 100644 --- a/buildconf.bat +++ b/buildconf.bat @@ -1,4 +1,5 @@ @echo off + cscript /nologo /e:jscript win32\build\buildconf.js %* SET PHP_BUILDCONF_PATH=%~dp0 copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul diff --git a/win32/build/configure.bat b/win32/build/configure.bat index 8adefd8c96c27..8c9b16007c60e 100644 --- a/win32/build/configure.bat +++ b/win32/build/configure.bat @@ -1,2 +1,3 @@ @echo off + cscript /nologo /e:jscript configure.js %* diff --git a/win32/build/phpize.bat b/win32/build/phpize.bat index 266473325899f..0e90fef72c925 100644 --- a/win32/build/phpize.bat +++ b/win32/build/phpize.bat @@ -1,4 +1,5 @@ @echo off + SET PHP_BUILDCONF_PATH=%~dp0 cscript /nologo /e:jscript %PHP_BUILDCONF_PATH%\script\phpize.js %* IF NOT EXIST configure.bat ( From cf9f6eb51807bfd813ace79feb88461ac5d86f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 27 Apr 2022 11:42:12 +0200 Subject: [PATCH 03/16] Migrate Windows CI to Github Actions II. --- .appveyor.yml | 46 +++++-------- .github/scripts/windows/build_task.bat | 65 ++++++++++--------- .github/scripts/windows/test_task.bat | 90 +++++++++++++------------- .github/workflows/push.yml | 32 +++++++++ 4 files changed, 128 insertions(+), 105 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 3fcb381dc7257..8de3e4d77a1d5 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -12,41 +12,27 @@ skip_commits: - UPGRADING.INTERNALS environment: - 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-sdk-2.2.0 - PHP_BUILD_CRT: vs16 - # ext and env setup for tests - #MYSQL_TEST_PASSWD: Password12! - #MYSQL_TEST_USER: root - #PDO_MYSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=root password=Password12!" - #PDO_MYSQL_TEST_USER: root - #PDO_MYSQL_TEST_PASS: Password12! - #PGSQL_TEST_CONNSTR: "host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!" - #PDO_PGSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=postgres password=Password12!" - #build permutations - matrix: - - THREAD_SAFE: 0 - OPCACHE: 0 - PARALLEL: -j2 - - THREAD_SAFE: 1 - OPCACHE: 1 - PARALLEL: -j2 - INTRINSICS: AVX2 + 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-sdk-2.2.0 + PHP_BUILD_CRT: vs16 + matrix: + - THREAD_SAFE: "" + - THREAD_SAFE: 1 + INTRINSICS: AVX2 services: - # the setup scripts have to be touched, once some other db version is used - - mysql - - postgresql101 - - mssql2017 + - mysql + - postgresql101 + - mssql2017 platform: - - x64 - #- x86 + - x64 + #- x86 build_script: - - .github\scripts\windows\build.bat + - .github\scripts\windows\build.bat test_script: - - .github\scripts\windows\test.bat + - .github\scripts\windows\test.bat diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index 48830eacc5f6f..c71f033414e42 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -5,30 +5,34 @@ if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" ( exit /b 3 ) -if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL -if %errorlevel% neq 0 exit /b 3 -if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" ( + rmdir /s /q C:\cygwin >NUL 2>NUL + if %errorlevel% neq 0 exit /b 3 + rmdir /s /q C:\cygwin64 >NUL 2>NUL + if %errorlevel% neq 0 exit /b 3 + rmdir /s /q C:\mingw >NUL 2>NUL + if %errorlevel% neq 0 exit /b 3 + rmdir /s /q C:\mingw-w64 >NUL 2>NUL + if %errorlevel% neq 0 exit /b 3 + rmdir /s /q C:\msys64 >NUL 2>NUL + if %errorlevel% neq 0 exit /b 3 + rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL + if %errorlevel% neq 0 exit /b 3 + rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL + if %errorlevel% neq 0 exit /b 3 + rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL + if %errorlevel% neq 0 exit /b 3 + rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL + if %errorlevel% neq 0 exit /b 3 +) +if /i "%GITHUB_ACTIONS%" equ "True" ( + rem rmdir takes several minutes rename instead only + ren "C:\msys64" "C:\trash-msys64" + if %errorlevel% neq 0 exit /b 3 +) +del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL if %errorlevel% neq 0 exit /b 3 - -cd /D %APPVEYOR_BUILD_FOLDER% +del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL if %errorlevel% neq 0 exit /b 3 if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" ( @@ -53,13 +57,17 @@ if %errorlevel% neq 0 exit /b 3 cmd /c buildconf.bat --force if %errorlevel% neq 0 exit /b 3 -if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts +if "%THREAD_SAFE%" equ "" set ADD_CONF=%ADD_CONF% --disable-zts if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS% set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_firebird,ldap,imap,ftp -if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache +if "%OPCACHE%" equ "" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache -set CFLAGS=/W1 /WX +if "%PLATFORM%" == "x86" ( + set CFLAGS=/W1 +) else ( + set CFLAGS=/W1 /WX +) cmd /c configure.bat ^ --enable-snapshot-build ^ @@ -72,7 +80,4 @@ cmd /c configure.bat ^ --with-test-ini-ext-exclude=%EXT_EXCLUDE_FROM_TEST% if %errorlevel% neq 0 exit /b 3 -nmake /NOLOGO -if %errorlevel% neq 0 exit /b 3 - -exit /b 0 +nmake /NOLOGO /S diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 1374c31862cf6..51f187c6602c6 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -22,42 +22,47 @@ if not exist "%DEPS_DIR%" ( exit /b 3 ) -rem setup MySQL related exts -set MYSQL_PWD=Password12! -set MYSQL_TEST_PASSWD=%MYSQL_PWD% -set MYSQL_TEST_USER=root -set MYSQL_TEST_HOST=127.0.0.1 -set MYSQL_TEST_PORT=3306 -set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% -set PDO_MYSQL_TEST_PASS=%MYSQL_PWD% -set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% -set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% -set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test -"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" -if %errorlevel% neq 0 exit /b 3 - -rem setup PostgreSQL related exts -set PGUSER=postgres -set PGPASSWORD=Password12! -rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12! -echo ^ >> "./ext/pgsql/tests/config.inc" -set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD% -"C:\Program Files\PostgreSQL\10\bin\createdb.exe" test -if %errorlevel% neq 0 exit /b 3 - -rem setup ODBC related exts -set ODBC_TEST_USER=sa -set ODBC_TEST_PASS=Password12! -set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=(local)\SQL2017;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% -set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% +if /i "%APPVEYOR%" equ "True" ( + rem setup MySQL related exts + set MYSQL_PWD=Password12! + set MYSQL_TEST_PASSWD=%MYSQL_PWD% + set MYSQL_TEST_USER=root + set MYSQL_TEST_HOST=127.0.0.1 + set MYSQL_TEST_PORT=3306 + set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% + set PDO_MYSQL_TEST_PASS=%MYSQL_PWD% + set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% + set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% + set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test + "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" + if %errorlevel% neq 0 exit /b 3 + + rem setup PostgreSQL related exts + set PGUSER=postgres + set PGPASSWORD=Password12! + rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12! + echo ^ >> ext\pgsql\tests\config.inc + set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD% + "C:\Program Files\PostgreSQL\10\bin\createdb.exe" test + if %errorlevel% neq 0 exit /b 3 + + rem setup ODBC related exts + set ODBC_TEST_USER=sa + set ODBC_TEST_PASS=Password12! + set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=^(local^)\SQL2017;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% + set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% +) rem prepare for ext/openssl -if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL -if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win64 >NUL 2>NUL -if "%PLATFORM%" == "x64" ( - set OPENSSLDIR="C:\Program Files\Common Files\SSL" -) else ( +rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL +rmdir /s /q C:\OpenSSL-Win64 >NUL 2>NUL +if "%PLATFORM%" == "x86" ( set OPENSSLDIR="C:\Program Files (x86)\Common Files\SSL" +) else ( + set OPENSSLDIR="C:\Program Files\Common Files\SSL" +) +if /i "%GITHUB_ACTIONS%" equ "True" ( + rmdir /s /q %OPENSSLDIR% >NUL 2>NUL ) mkdir %OPENSSLDIR% if %errorlevel% neq 0 exit /b 3 @@ -68,7 +73,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=16M +if "%OPCACHE%" neq "" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M rem prepare for enchant mkdir C:\usr\local\lib\enchant-2 @@ -94,19 +99,14 @@ if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\en_US.aff" ( mkdir %LOCALAPPDATA%\enchant\hunspell copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\* %LOCALAPPDATA%\enchant\hunspell -set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_OBJ_DIR%\Release -if "%THREAD_SAFE%" equ "1" set TEST_PHPDBG_EXECUTABLE=%TEST_PHPDBG_EXECUTABLE%_TS -set TEST_PHPDBG_EXECUTABLE=%TEST_PHPDBG_EXECUTABLE%\phpdbg.exe +set PHP_BUILD_DIR=%PHP_BUILD_OBJ_DIR%\Release +if "%THREAD_SAFE%" neq "" set PHP_BUILD_DIR=%PHP_BUILD_DIR%_TS + +set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe mkdir c:\tests_tmp set TEST_PHP_JUNIT=c:\junit.out.xml -cd "%APPVEYOR_BUILD_FOLDER%" -nmake test TESTS="%OPCACHE_OPTS% -q --offline -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%" - -set EXIT_CODE=%errorlevel% - -appveyor PushArtifact %TEST_PHP_JUNIT% - -exit /b %EXIT_CODE% +nmake test TESTS="%OPCACHE_OPTS% -q --offline -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp -j2" +if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 0e29c87e55034..01d2a3e4f61c1 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -131,3 +131,35 @@ jobs: -d opcache.jit_buffer_size=16M - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + WINDOWS_X64: + strategy: + fail-fast: false + matrix: + include: + - x64: true + zts: false + - x64: true + zts: true + - x64: false + zts: false + name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + runs-on: windows-2019 + env: + APPVEYOR_REPO_BRANCH: "${{ github.ref_name }}" + 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-sdk-2.2.0 + PHP_BUILD_CRT: vs16 + PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }} + THREAD_SAFE: "${{ matrix.zts && '1' || '' }}" + INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}" + steps: + - name: git checkout 1/2 + run: git config --global core.autocrlf false && git config --global core.eol lf + - name: git checkout 2/2 + uses: actions/checkout@v2 + - name: Build + run: .github/scripts/windows/build.bat + - name: Test + run: .github/scripts/windows/test.bat From 4b0040ad10ec2aa2419e0e1672b8984ec32c4a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Thu, 28 Apr 2022 11:13:12 +0200 Subject: [PATCH 04/16] WIP --- .github/scripts/windows/build_task.bat | 5 +-- .github/scripts/windows/test_task.bat | 42 +++++++++++++++++------ .github/workflows/nightly.yml | 46 ++++++++++++++++++++++++++ .github/workflows/push.yml | 21 +++++++++--- 4 files changed, 95 insertions(+), 19 deletions(-) diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index c71f033414e42..c310b5bf736c2 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -60,9 +60,6 @@ if %errorlevel% neq 0 exit /b 3 if "%THREAD_SAFE%" equ "" set ADD_CONF=%ADD_CONF% --disable-zts if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS% -set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_firebird,ldap,imap,ftp -if "%OPCACHE%" equ "" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache - if "%PLATFORM%" == "x86" ( set CFLAGS=/W1 ) else ( @@ -77,7 +74,7 @@ cmd /c configure.bat ^ --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^ --with-php-build=%DEPS_DIR% ^ %ADD_CONF% ^ - --with-test-ini-ext-exclude=%EXT_EXCLUDE_FROM_TEST% + --with-test-ini-ext-exclude=snmp,oci8_12c,pdo_oci,pdo_firebird,ldap,imap,ftp,opcache if %errorlevel% neq 0 exit /b 3 nmake /NOLOGO /S diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 51f187c6602c6..315e58f517252 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -23,21 +23,18 @@ if not exist "%DEPS_DIR%" ( ) if /i "%APPVEYOR%" equ "True" ( - rem setup MySQL related exts - set MYSQL_PWD=Password12! - set MYSQL_TEST_PASSWD=%MYSQL_PWD% - set MYSQL_TEST_USER=root set MYSQL_TEST_HOST=127.0.0.1 set MYSQL_TEST_PORT=3306 - set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% - set PDO_MYSQL_TEST_PASS=%MYSQL_PWD% + set MYSQL_TEST_USER=root + set MYSQL_TEST_PASSWD=Password12! set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% + set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% + set PDO_MYSQL_TEST_PASS=%MYSQL_TEST_PASSWD% set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" if %errorlevel% neq 0 exit /b 3 - rem setup PostgreSQL related exts set PGUSER=postgres set PGPASSWORD=Password12! rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12! @@ -46,12 +43,37 @@ if /i "%APPVEYOR%" equ "True" ( "C:\Program Files\PostgreSQL\10\bin\createdb.exe" test if %errorlevel% neq 0 exit /b 3 - rem setup ODBC related exts set ODBC_TEST_USER=sa set ODBC_TEST_PASS=Password12! set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=^(local^)\SQL2017;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% ) +if /i "%GITHUB_ACTIONS%" equ "True" ( + set MYSQL_TEST_HOST=127.0.0.1 + set MYSQL_TEST_PORT=3307 + set MYSQL_TEST_USER=root + set MYSQL_TEST_PASSWD=mysql_Pass11 + set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% + set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% + set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% + set PDO_MYSQL_TEST_PASS=%MYSQL_TEST_PASSWD% + set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test + "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" + if %errorlevel% neq 0 exit /b 3 + + set PGUSER=postgres + set PGPASSWORD=postgresql_Pass11 + rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD% + echo ^ >> ext\pgsql\tests\config.inc + set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD% + "C:\Program Files\PostgreSQL\10\bin\createdb.exe" test + if %errorlevel% neq 0 exit /b 3 + + set ODBC_TEST_USER=sa + set ODBC_TEST_PASS=mssql_Pass11 + set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=^(local^)\SQLEXPRESS;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% + set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% +) rem prepare for ext/openssl rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL @@ -72,9 +94,6 @@ rem set OPENSSL_CONF=%OPENSSLDIR%\openssl.cnf set OPENSSL_CONF= rem set SSLEAY_CONF= -rem prepare for Opcache -if "%OPCACHE%" neq "" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M - rem prepare for enchant mkdir C:\usr\local\lib\enchant-2 if %errorlevel% neq 0 exit /b 3 @@ -108,5 +127,6 @@ mkdir c:\tests_tmp set TEST_PHP_JUNIT=c:\junit.out.xml +set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M nmake test TESTS="%OPCACHE_OPTS% -q --offline -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp -j2" if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 72d7047773109..0956562efbbc7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -600,3 +600,49 @@ jobs: withMysqli: ${{ matrix.branch.ref == 'PHP-8.1' }} - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + WINDOWS: + needs: GENERATE_MATRIX + if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} + x64: [true, false] + zts: [true, false] + name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + runs-on: windows-2019 + env: + APPVEYOR_REPO_BRANCH: "${{ github.ref_name }}" + 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-sdk-2.2.0 + PHP_BUILD_CRT: vs16 + PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }} + THREAD_SAFE: "${{ matrix.zts && '1' || '' }}" + INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}" + steps: + - name: git checkout 1/2 + run: git config --global core.autocrlf false && git config --global core.eol lf + - name: git checkout 2/2 + uses: actions/checkout@v2 + with: + ref: ${{ matrix.branch.ref }} + - name: Setup MySQL + run: | + choco install mysql -y --no-progress --params="/port:3307" + mysql.exe --port=3307 --user=root --password="" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'mysql_Pass11'; FLUSH PRIVILEGES;" + mysql.exe --port=3307 --user=root --password="mysql_Pass11" -e "SELECT 1;" + - name: Setup MSSQL + run: | + choco install sql-server-express -y --no-progress --install-arguments="/SECURITYMODE=SQL /SAPWD=mssql_Pass11" + sqlcmd -S "(local)\SQLEXPRESS" -U sa -P "mssql_Pass11" -Q "SELECT 1;" + - name: Setup PostgreSQL + run: | + Set-Service -Name "postgresql-x64-14" -StartupType manual -Status Running + pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "ALTER USER postgres WITH PASSWORD 'postgresql_Pass11';" } + pwsh -Command { $env:PGPASSWORD="postgresql_Pass11"; & "$env:PGBIN\psql" -U postgres -c "SELECT 1;" } + - name: Build + run: .github/scripts/windows/build.bat + - name: Test + run: .github/scripts/windows/test.bat diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 01d2a3e4f61c1..268be7b3a1941 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -19,6 +19,7 @@ on: - '**' jobs: LINUX_X64: + if: false strategy: fail-fast: false matrix: @@ -131,17 +132,15 @@ jobs: -d opcache.jit_buffer_size=16M - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - WINDOWS_X64: + WINDOWS: strategy: fail-fast: false matrix: include: - x64: true zts: false - - x64: true - zts: true - x64: false - zts: false + zts: true name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" runs-on: windows-2019 env: @@ -159,6 +158,20 @@ jobs: run: git config --global core.autocrlf false && git config --global core.eol lf - name: git checkout 2/2 uses: actions/checkout@v2 + - name: Setup MySQL + run: | + choco install mysql -y --no-progress --params="/port:3307" + mysql.exe --port=3307 --user=root --password="" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'mysql_Pass11'; FLUSH PRIVILEGES;" + mysql.exe --port=3307 --user=root --password="mysql_Pass11" -e "SELECT 1;" + - name: Setup MSSQL + run: | + choco install sql-server-express -y --no-progress --install-arguments="/SECURITYMODE=SQL /SAPWD=mssql_Pass11" + sqlcmd -S "(local)\SQLEXPRESS" -U sa -P "mssql_Pass11" -Q "SELECT 1;" + - name: Setup PostgreSQL + run: | + Set-Service -Name "postgresql-x64-14" -StartupType manual -Status Running + pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "ALTER USER postgres WITH PASSWORD 'postgresql_Pass11';" } + pwsh -Command { $env:PGPASSWORD="postgresql_Pass11"; & "$env:PGBIN\psql" -U postgres -c "SELECT 1;" } - name: Build run: .github/scripts/windows/build.bat - name: Test From 2a08113788fca6f71f2223801cc5740b6813bbc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 27 Apr 2022 15:21:52 +0200 Subject: [PATCH 05/16] fix paths for GH Actions --- .github/scripts/windows/test_task.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 315e58f517252..2832a8db7938c 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -58,7 +58,7 @@ if /i "%GITHUB_ACTIONS%" equ "True" ( set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% set PDO_MYSQL_TEST_PASS=%MYSQL_TEST_PASSWD% set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test - "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" + mysql --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" if %errorlevel% neq 0 exit /b 3 set PGUSER=postgres @@ -66,7 +66,7 @@ if /i "%GITHUB_ACTIONS%" equ "True" ( rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD% echo ^ >> ext\pgsql\tests\config.inc set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD% - "C:\Program Files\PostgreSQL\10\bin\createdb.exe" test + "%PGBIN%\createdb.exe" test if %errorlevel% neq 0 exit /b 3 set ODBC_TEST_USER=sa From 6d695ba81eeed23f68cb3ed2c3d6912310b7e4a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 27 Apr 2022 15:22:01 +0200 Subject: [PATCH 06/16] workaround early var expansion inside if block --- .github/scripts/windows/build_task.bat | 46 ++++++++++------------ .github/scripts/windows/test_task.bat | 54 +++++++++++--------------- 2 files changed, 44 insertions(+), 56 deletions(-) diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index c310b5bf736c2..2053c50fa35ad 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -5,31 +5,27 @@ if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" ( exit /b 3 ) -if /i "%APPVEYOR%" equ "True" ( - rmdir /s /q C:\cygwin >NUL 2>NUL - if %errorlevel% neq 0 exit /b 3 - rmdir /s /q C:\cygwin64 >NUL 2>NUL - if %errorlevel% neq 0 exit /b 3 - rmdir /s /q C:\mingw >NUL 2>NUL - if %errorlevel% neq 0 exit /b 3 - rmdir /s /q C:\mingw-w64 >NUL 2>NUL - if %errorlevel% neq 0 exit /b 3 - rmdir /s /q C:\msys64 >NUL 2>NUL - if %errorlevel% neq 0 exit /b 3 - rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL - if %errorlevel% neq 0 exit /b 3 - rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL - if %errorlevel% neq 0 exit /b 3 - rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL - if %errorlevel% neq 0 exit /b 3 - rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL - if %errorlevel% neq 0 exit /b 3 -) -if /i "%GITHUB_ACTIONS%" equ "True" ( - rem rmdir takes several minutes rename instead only - ren "C:\msys64" "C:\trash-msys64" - if %errorlevel% neq 0 exit /b 3 -) +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL +if %errorlevel% neq 0 exit /b 3 +rem rmdir takes several minutes rename instead only +if /i "%GITHUB_ACTIONS%" equ "True" ren "C:\msys64" "C:\trash-msys64" +if %errorlevel% neq 0 exit /b 3 del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL if %errorlevel% neq 0 exit /b 3 del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 2832a8db7938c..7fc2a701a53db 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -27,53 +27,45 @@ if /i "%APPVEYOR%" equ "True" ( set MYSQL_TEST_PORT=3306 set MYSQL_TEST_USER=root set MYSQL_TEST_PASSWD=Password12! - set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% - set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% - set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% - set PDO_MYSQL_TEST_PASS=%MYSQL_TEST_PASSWD% - set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test - "C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" - if %errorlevel% neq 0 exit /b 3 - set PGUSER=postgres set PGPASSWORD=Password12! - rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12! - echo ^ >> ext\pgsql\tests\config.inc - set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD% - "C:\Program Files\PostgreSQL\10\bin\createdb.exe" test - if %errorlevel% neq 0 exit /b 3 - set ODBC_TEST_USER=sa set ODBC_TEST_PASS=Password12! - set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=^(local^)\SQL2017;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% - set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% ) if /i "%GITHUB_ACTIONS%" equ "True" ( set MYSQL_TEST_HOST=127.0.0.1 set MYSQL_TEST_PORT=3307 set MYSQL_TEST_USER=root set MYSQL_TEST_PASSWD=mysql_Pass11 - set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% - set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% - set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% - set PDO_MYSQL_TEST_PASS=%MYSQL_TEST_PASSWD% - set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test - mysql --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test" - if %errorlevel% neq 0 exit /b 3 - set PGUSER=postgres set PGPASSWORD=postgresql_Pass11 - rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD% - echo ^ >> ext\pgsql\tests\config.inc - set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD% - "%PGBIN%\createdb.exe" test - if %errorlevel% neq 0 exit /b 3 - set ODBC_TEST_USER=sa set ODBC_TEST_PASS=mssql_Pass11 +) +set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST% +set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT% +set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER% +set PDO_MYSQL_TEST_PASS=%MYSQL_TEST_PASSWD% +set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test +rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD% +echo ^ >> ext\pgsql\tests\config.inc +set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD% +if /i "%APPVEYOR%" equ "True" ( + set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=^(local^)\SQL2017;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% + set TMP_MYSQL_BIN=%ProgramFiles%\MySql\MySQL Server 5.7\bin + set TMP_POSTGRESQL_BIN=%ProgramFiles%\PostgreSQL\10\bin +) +if /i "%GITHUB_ACTIONS%" equ "True" ( set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=^(local^)\SQLEXPRESS;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% - set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% + set TMP_MYSQL_BIN=C:\mysql\bin + set TMP_POSTGRESQL_BIN=%PGBIN% ) +set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% + +"%TMP_MYSQL_BIN%\mysql.exe" --host=%PDO_MYSQL_TEST_HOST% --port=%MYSQL_TEST_PORT% --user=%MYSQL_TEST_USER% --password=%MYSQL_TEST_PASSWD% -e "CREATE DATABASE IF NOT EXISTS test" +if %errorlevel% neq 0 exit /b 3 +"%TMP_POSTGRESQL_BIN%\createdb.exe" test +if %errorlevel% neq 0 exit /b 3 rem prepare for ext/openssl rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL From c002b1c3c975e5ec08689d61926744e6ac54a69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 27 Apr 2022 14:19:21 +0200 Subject: [PATCH 07/16] no opcache ini exclude via "with-test-ini-ext-exclude" --- .github/scripts/windows/build_task.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index 2053c50fa35ad..a87b948f7117f 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -70,7 +70,7 @@ cmd /c configure.bat ^ --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^ --with-php-build=%DEPS_DIR% ^ %ADD_CONF% ^ - --with-test-ini-ext-exclude=snmp,oci8_12c,pdo_oci,pdo_firebird,ldap,imap,ftp,opcache + --with-test-ini-ext-exclude=snmp,oci8_12c,pdo_oci,pdo_firebird,ldap,imap,ftp if %errorlevel% neq 0 exit /b 3 nmake /NOLOGO /S From fd9b0ede6062e223cd2ad1b4a643c5cf7031a89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 27 Apr 2022 17:23:57 +0200 Subject: [PATCH 08/16] ren cannot accept full path --- .github/scripts/windows/build_task.bat | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index a87b948f7117f..cdedf28850a92 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -24,8 +24,10 @@ if %errorlevel% neq 0 exit /b 3 if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL if %errorlevel% neq 0 exit /b 3 rem rmdir takes several minutes rename instead only -if /i "%GITHUB_ACTIONS%" equ "True" ren "C:\msys64" "C:\trash-msys64" +pushd C:\ +if /i "%GITHUB_ACTIONS%" equ "True" ren msys64 msys64-del if %errorlevel% neq 0 exit /b 3 +popd del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL if %errorlevel% neq 0 exit /b 3 del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL From c8d25e1dc899da79282ec96d6e2a13578a858f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 27 Apr 2022 18:27:00 +0200 Subject: [PATCH 09/16] fix BRANCH discovery for phpsdk_deps/DEPS_DIR --- .github/scripts/windows/build_task.bat | 7 ++----- .github/scripts/windows/find-target-branch.bat | 13 +++++++++++++ .github/scripts/windows/test_task.bat | 10 +++++----- .github/workflows/nightly.yml | 1 - .github/workflows/push.yml | 1 - 5 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 .github/scripts/windows/find-target-branch.bat diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index cdedf28850a92..f396bc97dfd79 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -33,12 +33,9 @@ if %errorlevel% neq 0 exit /b 3 del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" ( - set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3% -) else ( - set BRANCH=master -) +call %~dp0find-target-branch.bat set STABILITY=staging + set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH% rem SDK is cached, deps info is cached as well echo Updating dependencies in %DEPS_DIR% diff --git a/.github/scripts/windows/find-target-branch.bat b/.github/scripts/windows/find-target-branch.bat new file mode 100644 index 0000000000000..06f441f602ef8 --- /dev/null +++ b/.github/scripts/windows/find-target-branch.bat @@ -0,0 +1,13 @@ +@echo off + +findstr /m "PHP_VERSION_ID 800" %~dp0..\..\..\main\php_version.h +if %errorlevel% equ 0 ( + set BRANCH=8.0 + goto :eof +) +findstr /m "PHP_VERSION_ID 810" %~dp0..\..\..\main\php_version.h +if %errorlevel% equ 0 ( + set BRANCH=8.1 + goto :eof +) +set BRANCH=master diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 7fc2a701a53db..ae5e6d3d551de 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -9,13 +9,13 @@ set NO_INTERACTION=1 set REPORT_EXIT_STATUS=1 set SKIP_IO_CAPTURE_TESTS=1 -if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" ( - set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3% - set STABILITY=stable -) else ( - set BRANCH=master +call %~dp0find-target-branch.bat +if "%BRANCH%" equ "master" ( set STABILITY=staging +) else ( + set STABILITY=stable ) + set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH% if not exist "%DEPS_DIR%" ( echo "%DEPS_DIR%" doesn't exist diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0956562efbbc7..505da697d2f38 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -612,7 +612,6 @@ jobs: name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" runs-on: windows-2019 env: - APPVEYOR_REPO_BRANCH: "${{ github.ref_name }}" PHP_BUILD_CACHE_BASE_DIR: c:\build-cache PHP_BUILD_OBJ_DIR: c:\obj PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 268be7b3a1941..713fbc89dbd43 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -144,7 +144,6 @@ jobs: name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" runs-on: windows-2019 env: - APPVEYOR_REPO_BRANCH: "${{ github.ref_name }}" PHP_BUILD_CACHE_BASE_DIR: c:\build-cache PHP_BUILD_OBJ_DIR: c:\obj PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk From 98e9a305d3db5b619fd8f351a1e1ab05634ccaca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Thu, 28 Apr 2022 11:15:31 +0200 Subject: [PATCH 10/16] add/unify redirect to nul --- .github/scripts/windows/build_task.bat | 22 +++++++++---------- .../scripts/windows/find-target-branch.bat | 4 ++-- .github/scripts/windows/test_task.bat | 6 ++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index f396bc97dfd79..4db73d6569609 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -5,32 +5,32 @@ if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" ( exit /b 3 ) -if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL +if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 rem rmdir takes several minutes rename instead only pushd C:\ if /i "%GITHUB_ACTIONS%" equ "True" ren msys64 msys64-del if %errorlevel% neq 0 exit /b 3 popd -del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL +del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL +del /f /q C:\Windows\System32\libssl-1_1-x64.dll >nul 2>&1 if %errorlevel% neq 0 exit /b 3 call %~dp0find-target-branch.bat diff --git a/.github/scripts/windows/find-target-branch.bat b/.github/scripts/windows/find-target-branch.bat index 06f441f602ef8..3beb2346d55e5 100644 --- a/.github/scripts/windows/find-target-branch.bat +++ b/.github/scripts/windows/find-target-branch.bat @@ -1,11 +1,11 @@ @echo off -findstr /m "PHP_VERSION_ID 800" %~dp0..\..\..\main\php_version.h +findstr /m "PHP_VERSION_ID 800" %~dp0..\..\..\main\php_version.h >nul 2>&1 if %errorlevel% equ 0 ( set BRANCH=8.0 goto :eof ) -findstr /m "PHP_VERSION_ID 810" %~dp0..\..\..\main\php_version.h +findstr /m "PHP_VERSION_ID 810" %~dp0..\..\..\main\php_version.h >nul 2>&1 if %errorlevel% equ 0 ( set BRANCH=8.1 goto :eof diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index ae5e6d3d551de..0c60f46bbbbeb 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -68,15 +68,15 @@ if %errorlevel% neq 0 exit /b 3 if %errorlevel% neq 0 exit /b 3 rem prepare for ext/openssl -rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL -rmdir /s /q C:\OpenSSL-Win64 >NUL 2>NUL +rmdir /s /q C:\OpenSSL-Win32 >nul 2>&1 +rmdir /s /q C:\OpenSSL-Win64 >nul 2>&1 if "%PLATFORM%" == "x86" ( set OPENSSLDIR="C:\Program Files (x86)\Common Files\SSL" ) else ( set OPENSSLDIR="C:\Program Files\Common Files\SSL" ) if /i "%GITHUB_ACTIONS%" equ "True" ( - rmdir /s /q %OPENSSLDIR% >NUL 2>NUL + rmdir /s /q %OPENSSLDIR% >nul 2>&1 ) mkdir %OPENSSLDIR% if %errorlevel% neq 0 exit /b 3 From 1b972c7f28a790b259f746ea1c9af63ecd87d0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Thu, 28 Apr 2022 11:20:59 +0200 Subject: [PATCH 11/16] no git detached head warning --- .github/scripts/windows/build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/windows/build.bat b/.github/scripts/windows/build.bat index 6e4c999e5ac85..b4b02e61eac1c 100644 --- a/.github/scripts/windows/build.bat +++ b/.github/scripts/windows/build.bat @@ -13,7 +13,7 @@ mkdir "%PHP_BUILD_CACHE_BASE_DIR%" mkdir "%PHP_BUILD_OBJ_DIR%" echo Cloning remote SDK repository -git clone -q --branch %SDK_BRANCH% %SDK_REMOTE% --depth 1 "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1 +git clone -q -c advice.detachedHead=false --branch %SDK_BRANCH% %SDK_REMOTE% --depth 1 "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1 for /f "tokens=*" %%a in ('type %PHP_BUILD_CACHE_SDK_DIR%\VERSION') do set GOT_SDK_VER=%%a echo Got SDK version %GOT_SDK_VER% From a53c5beb4b1b9d326441eb95ddc2aba0c93a184c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 2 May 2022 00:54:57 +0200 Subject: [PATCH 12/16] fix enchant lib/dicts discovery --- .github/scripts/windows/test_task.bat | 34 ++++++++++----------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 0c60f46bbbbeb..03593a929ec65 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -82,33 +82,23 @@ mkdir %OPENSSLDIR% if %errorlevel% neq 0 exit /b 3 copy %DEPS_DIR%\template\ssl\openssl.cnf %OPENSSLDIR% if %errorlevel% neq 0 exit /b 3 -rem set OPENSSL_CONF=%OPENSSLDIR%\openssl.cnf -set OPENSSL_CONF= -rem set SSLEAY_CONF= +if /i "%APPVEYOR%" equ "True" ( + set OPENSSL_CONF= +) rem prepare for enchant -mkdir C:\usr\local\lib\enchant-2 +mkdir %~d0\usr\local\lib\enchant-2 if %errorlevel% neq 0 exit /b 3 -copy %DEPS_DIR%\bin\libenchant2_hunspell.dll C:\usr\local\lib\enchant-2 +copy %DEPS_DIR%\bin\libenchant2_hunspell.dll %~d0\usr\local\lib\enchant-2 if %errorlevel% neq 0 exit /b 3 -reg add HKEY_CURRENT_USER\SOFTWARE\Enchant\Config /v Module_Dir /t REG_SZ /d c:\enchant_plugins +mkdir %~d0\usr\local\share\enchant\hunspell if %errorlevel% neq 0 exit /b 3 -set PHP_BUILD_CACHE_ENCHANT_DICT_DIR=%PHP_BUILD_CACHE_BASE_DIR%\enchant_dict -if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%" ( - echo Creating %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% - mkdir "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%" -) -if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\en_US.aff" ( - echo Fetching enchant dicts - pushd %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% - del /q * - powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip - unzip dict.zip - del /q dict.zip - popd -) -mkdir %LOCALAPPDATA%\enchant\hunspell -copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\* %LOCALAPPDATA%\enchant\hunspell +echo Fetching enchant dicts +pushd %~d0\usr\local\share\enchant\hunspell +powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip +unzip dict.zip +del /q dict.zip +popd set PHP_BUILD_DIR=%PHP_BUILD_OBJ_DIR%\Release if "%THREAD_SAFE%" neq "" set PHP_BUILD_DIR=%PHP_BUILD_DIR%_TS From d13bbf4931fea12a9fafe3db821a431cd0904a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 2 May 2022 12:44:39 +0200 Subject: [PATCH 13/16] use UC drive letter strictly --- .appveyor.yml | 6 +++--- .github/scripts/windows/build_task.bat | 8 ++++---- .github/scripts/windows/test_task.bat | 6 +++--- .github/workflows/nightly.yml | 6 +++--- .github/workflows/push.yml | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 8de3e4d77a1d5..8b036ab0334a9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -12,9 +12,9 @@ skip_commits: - UPGRADING.INTERNALS environment: - 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_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-sdk-2.2.0 PHP_BUILD_CRT: vs16 matrix: diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index 4db73d6569609..3ab7d80d00773 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -15,13 +15,13 @@ if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >nul 2>&1 +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win32 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >nul 2>&1 +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win64 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >nul 2>&1 +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-v11-Win32 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if /i "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >nul 2>&1 +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-v11-Win64 >nul 2>&1 if %errorlevel% neq 0 exit /b 3 rem rmdir takes several minutes rename instead only pushd C:\ diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index 03593a929ec65..c040a0aa02358 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -105,10 +105,10 @@ if "%THREAD_SAFE%" neq "" set PHP_BUILD_DIR=%PHP_BUILD_DIR%_TS set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe -mkdir c:\tests_tmp +mkdir C:\tests_tmp -set TEST_PHP_JUNIT=c:\junit.out.xml +set TEST_PHP_JUNIT=C:\junit.out.xml set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M -nmake test TESTS="%OPCACHE_OPTS% -q --offline -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp -j2" +nmake test TESTS="%OPCACHE_OPTS% -q --offline -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source C:\tests_tmp --temp-target C:\tests_tmp -j2" if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 505da697d2f38..2365706c34aa4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -612,9 +612,9 @@ jobs: 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_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-sdk-2.2.0 PHP_BUILD_CRT: vs16 PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 713fbc89dbd43..50ced111ba2e2 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -144,9 +144,9 @@ jobs: 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_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-sdk-2.2.0 PHP_BUILD_CRT: vs16 PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }} From e36a1568f8f22b2eead5aa6852575a9ada25c0c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 2 May 2022 18:29:10 +0200 Subject: [PATCH 14/16] fix ODBC driver version for GH Actions --- .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 c040a0aa02358..5dd57db701d26 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -56,7 +56,7 @@ if /i "%APPVEYOR%" equ "True" ( set TMP_POSTGRESQL_BIN=%ProgramFiles%\PostgreSQL\10\bin ) if /i "%GITHUB_ACTIONS%" equ "True" ( - set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=^(local^)\SQLEXPRESS;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% + set ODBC_TEST_DSN=Driver={ODBC Driver 17 for SQL Server};Server=^(local^)\SQLEXPRESS;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS% set TMP_MYSQL_BIN=C:\mysql\bin set TMP_POSTGRESQL_BIN=%PGBIN% ) From 5eed291a332a9333afac1cdb5fa76c7513e1f53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 3 May 2022 07:54:58 +0200 Subject: [PATCH 15/16] unhardcode php version discovery, no master --- .github/scripts/windows/find-target-branch.bat | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/scripts/windows/find-target-branch.bat b/.github/scripts/windows/find-target-branch.bat index 3beb2346d55e5..a19a5816520b0 100644 --- a/.github/scripts/windows/find-target-branch.bat +++ b/.github/scripts/windows/find-target-branch.bat @@ -1,13 +1,4 @@ @echo off -findstr /m "PHP_VERSION_ID 800" %~dp0..\..\..\main\php_version.h >nul 2>&1 -if %errorlevel% equ 0 ( - set BRANCH=8.0 - goto :eof -) -findstr /m "PHP_VERSION_ID 810" %~dp0..\..\..\main\php_version.h >nul 2>&1 -if %errorlevel% equ 0 ( - set BRANCH=8.1 - goto :eof -) -set BRANCH=master +for /f "usebackq tokens=3" %%i in (`findstr PHP_MAJOR_VERSION main\php_version.h`) do set BRANCH=%%i +for /f "usebackq tokens=3" %%i in (`findstr PHP_MINOR_VERSION main\php_version.h`) do set BRANCH=%BRANCH%.%%i From fea5e38b3cadcd43199f3f5733308425cab606a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 13 Nov 2022 12:48:03 +0100 Subject: [PATCH 16/16] fix tests for Windows x86 build -cherrypick 9744 --- ext/gd/tests/bug77269.phpt | 1 + ext/gd/tests/bug77272.phpt | 1 + ext/mysqli/tests/bug73462.phpt | 6 +++--- ext/mysqli/tests/bug73949.phpt | 2 +- ext/phar/tests/bug69958.phpt | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ext/gd/tests/bug77269.phpt b/ext/gd/tests/bug77269.phpt index 5d1f73a8bf005..f9b0b7bf3197d 100644 --- a/ext/gd/tests/bug77269.phpt +++ b/ext/gd/tests/bug77269.phpt @@ -5,6 +5,7 @@ gd --SKIPIF-- --INI-- memory_limit=2G diff --git a/ext/gd/tests/bug77272.phpt b/ext/gd/tests/bug77272.phpt index 4de532a5c7b3e..fc5ee464a07bb 100644 --- a/ext/gd/tests/bug77272.phpt +++ b/ext/gd/tests/bug77272.phpt @@ -8,6 +8,7 @@ gd --FILE-- query("SHOW STATUS LIKE 'Connections'"); $c1 = $result->fetch_row(); $result->free(); $mysql_1->close(); /* Failed connection to invalid host */ - $mysql_2 = @new mysqli(' !!! invalid !!! ', $user, $passwd, $db); + $mysql_2 = @new mysqli(' !!! invalid !!! ', $user, $passwd, $db, $port); try { $mysql_2->close(); } catch (Error $exception) { @@ -26,7 +26,7 @@ require_once('skipifconnectfailure.inc'); } /* Re-use persistent connection */ - $mysql_3 = new mysqli('p:'.$host, $user, $passwd, $db); + $mysql_3 = new mysqli('p:'.$host, $user, $passwd, $db, $port); $error = mysqli_connect_errno(); $result = $mysql_3->query("SHOW STATUS LIKE 'Connections'"); $c3 = $result->fetch_row(); diff --git a/ext/mysqli/tests/bug73949.phpt b/ext/mysqli/tests/bug73949.phpt index b706ab20e8819..7c5364c274730 100644 --- a/ext/mysqli/tests/bug73949.phpt +++ b/ext/mysqli/tests/bug73949.phpt @@ -14,7 +14,7 @@ class cc{ function __construct($c=null){ } }; -$i=mysqli_connect('p:'.$host, $user, $passwd, $db); +$i=mysqli_connect('p:'.$host, $user, $passwd, $db, $port); $res=mysqli_query($i, "SHOW STATUS LIKE 'Connections'"); $t=array(new stdClass); while($db= mysqli_fetch_object($res,'cc',$t)){} diff --git a/ext/phar/tests/bug69958.phpt b/ext/phar/tests/bug69958.phpt index b53c76a104951..7e69e5c4275fa 100644 --- a/ext/phar/tests/bug69958.phpt +++ b/ext/phar/tests/bug69958.phpt @@ -10,8 +10,8 @@ $tarphar = new PharData(__DIR__.'/bug69958.tar'); $phar = $tarphar->convertToData(Phar::TAR); ?> --EXPECTF-- -Fatal error: Uncaught BadMethodCallException: phar "%s/bug69958.tar" exists and must be unlinked prior to conversion in %s/bug69958.php:%d +Fatal error: Uncaught BadMethodCallException: phar "%sbug69958.tar" exists and must be unlinked prior to conversion in %sbug69958.php:%d Stack trace: -#0 %s/bug69958.php(%d): PharData->convertToData(%d) +#0 %sbug69958.php(%d): PharData->convertToData(%d) #1 {main} - thrown in %s/bug69958.php on line %d + thrown in %sbug69958.php on line %d