diff --git a/.github/matrix.php b/.github/matrix.php index dec8c7d249c68..73768123be678 100644 --- a/.github/matrix.php +++ b/.github/matrix.php @@ -144,12 +144,14 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re $jobs['SOLARIS'] = true; } if ($all_jobs || !$no_jobs || $test_windows) { - $jobs['WINDOWS']['matrix'] = $all_variations - ? ['include' => [ - ['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true], - ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false], - ]] - : ['include' => [['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true]]]; + $matrix = [['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true]]; + if ($all_variations) { + $matrix[] = ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false]; + if (version_compare($php_version, '8.5', '>=')) { + $matrix[] = ['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true, 'clang' => true]; + } + } + $jobs['WINDOWS']['matrix'] = ['include' => $matrix]; $jobs['WINDOWS']['config'] = version_compare($php_version, '8.4', '>=') ? ['vs_crt_version' => 'vs17'] : ['vs_crt_version' => 'vs16']; diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index e8d84b8c0bfd6..19fe546a8b3cd 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -30,10 +30,14 @@ 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% +if "%CLANG_TOOLSET%" equ "1" set ADD_CONF=%ADD_CONF% --with-toolset=clang rem Some undefined behavior is reported on 32-bit, this should be fixed if "%PLATFORM%" == "x86" ( set CFLAGS=/W1 +) else if "%CLANG_TOOLSET%" equ "1" ( + rem Clang is much stricter than MSVC, produces too many warnings that would fail the build with /WX + set CFLAGS=/W1 ) else ( set CFLAGS=/W1 /WX ) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 9eeff1455f8f9..4f7ed957fceea 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -935,7 +935,7 @@ jobs: strategy: fail-fast: false matrix: ${{ fromJson(inputs.branch).jobs.WINDOWS.matrix }} - name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || ''}}" + name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || ''}}${{ matrix.clang && '_CLANG' || ''}}" runs-on: windows-2022 env: PHP_BUILD_CACHE_BASE_DIR: C:\build-cache @@ -949,6 +949,7 @@ jobs: PARALLEL: -j2 OPCACHE: "${{ matrix.opcache && '1' || '0' }}" ASAN: "${{ matrix.asan && '1' || '0' }}" + CLANG_TOOLSET: "${{ matrix.clang && '1' || '0' }}" steps: - name: git config run: git config --global core.autocrlf false && git config --global core.eol lf