diff --git a/.appveyor.yml b/.appveyor.yml index 7567578af258d..8b036ab0334a9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,45 +11,28 @@ skip_commits: - UPGRADING - UPGRADING.INTERNALS -cache: - - c:\build-cache - 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.bat b/.github/scripts/windows/build.bat index cb85f605c610e..b4b02e61eac1c 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 -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% 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 61e3042fadd28..3ab7d80d00773 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -1,37 +1,41 @@ @echo off -if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL +if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" ( + echo for CI only + exit /b 3 +) + +if /i "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >nul 2>&1 if %errorlevel% neq 0 exit /b 3 -if "%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 "%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 "%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 "%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 "%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 "%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 "%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 "%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 -if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL +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 -if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL +popd +del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >nul 2>&1 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>&1 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% @@ -48,10 +52,14 @@ 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 CFLAGS=/W1 /WX +if "%PLATFORM%" == "x86" ( + set CFLAGS=/W1 +) else ( + set CFLAGS=/W1 /WX +) cmd /c configure.bat ^ --enable-snapshot-build ^ @@ -61,10 +69,7 @@ cmd /c configure.bat ^ --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^ --with-php-build=%DEPS_DIR% ^ %ADD_CONF% ^ - --disable-test-ini -if %errorlevel% neq 0 exit /b 3 - -nmake /NOLOGO + --with-test-ini-ext-exclude=snmp,oci8_12c,pdo_oci,pdo_firebird,ldap,imap,ftp if %errorlevel% neq 0 exit /b 3 -exit /b 0 +nmake /NOLOGO /S diff --git a/.github/scripts/windows/find-target-branch.bat b/.github/scripts/windows/find-target-branch.bat new file mode 100644 index 0000000000000..a19a5816520b0 --- /dev/null +++ b/.github/scripts/windows/find-target-branch.bat @@ -0,0 +1,4 @@ +@echo off + +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 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 39f0eb07c048a..5dd57db701d26 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -1,129 +1,114 @@ @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 -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 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% +if /i "%APPVEYOR%" equ "True" ( + set MYSQL_TEST_HOST=127.0.0.1 + set MYSQL_TEST_PORT=3306 + set MYSQL_TEST_USER=root + set MYSQL_TEST_PASSWD=Password12! + set PGUSER=postgres + set PGPASSWORD=Password12! + set ODBC_TEST_USER=sa + set ODBC_TEST_PASS=Password12! +) +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 PGUSER=postgres + set PGPASSWORD=postgresql_Pass11 + 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 -"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" +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 - -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% +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 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% +) 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 -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>&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>&1 ) 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= - -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 +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%" 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 -) +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 +mkdir C:\tests_tmp -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%" - -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 -) +set TEST_PHP_JUNIT=C:\junit.out.xml -exit /b %EXIT_CODE% +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..2365706c34aa4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -600,3 +600,48 @@ 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: + 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 0e29c87e55034..50ced111ba2e2 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,3 +132,46 @@ jobs: -d opcache.jit_buffer_size=16M - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + WINDOWS: + strategy: + fail-fast: false + matrix: + include: + - x64: true + zts: false + - x64: false + zts: true + 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-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: 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/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/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 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 (