update wil to 0b2d6c2d822bb301e7558a14ee66d567c14f5dc7

This commit is contained in:
Shawn Hoffman
2023-02-22 13:12:56 -08:00
parent 95ce41ac56
commit 69c335ca8c
66 changed files with 14776 additions and 2507 deletions

View File

@ -8,7 +8,7 @@ jobs:
timeoutInMinutes: 360
pool:
vmImage: 'windows-2019'
vmImage: 'windows-2022'
steps:
- script: |
@ -18,7 +18,7 @@ jobs:
displayName: 'Install Clang'
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat"
if %ERRORLEVEL% NEQ 0 goto :eof
call scripts\init_all.cmd --fast
@ -28,7 +28,7 @@ jobs:
displayName: 'Build x86'
- script: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
if %ERRORLEVEL% NEQ 0 goto :eof
call scripts\init_all.cmd --fast
@ -37,5 +37,9 @@ jobs:
call scripts\build_all.cmd
displayName: 'Build x64'
- script: call scripts\runtests.cmd
# NOTE: We run the tests in the 32-bit cross-tools window out of convenience as this adds all necessary directories to
# the PATH that are necessary for finding the ASan/UBSan DLLs
- script: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_x86.bat""
call scripts\runtests.cmd ~[LocalOnly]
displayName: 'Run Tests'

View File

@ -1,4 +1,5 @@
@echo off
setlocal
setlocal EnableDelayedExpansion
set BUILD_ROOT=%~dp0\..\build
@ -15,23 +16,15 @@ if "%Platform%"=="x64" (
exit /B 1
)
call :build clang debug
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :build clang release
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :build clang relwithdebinfo
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :build clang minsizerel
if %ERRORLEVEL% NEQ 0 ( goto :eof )
set COMPILERS=clang msvc
set BUILD_TYPES=debug release relwithdebinfo minsizerel
call :build msvc debug
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :build msvc release
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :build msvc relwithdebinfo
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :build msvc minsizerel
if %ERRORLEVEL% NEQ 0 ( goto :eof )
for %%c in (%COMPILERS%) do (
for %%b in (%BUILD_TYPES%) do (
call :build %%c %%b
if !ERRORLEVEL! NEQ 0 ( goto :eof )
)
)
echo All build completed successfully!
@ -47,5 +40,6 @@ if not exist %BUILD_DIR% (
pushd %BUILD_DIR%
echo Building from %CD%
ninja
set EXIT_CODE=%ERRORLEVEL%
popd
goto :eof
exit /B %EXIT_CODE%

View File

@ -10,8 +10,8 @@ goto :init
:usage
echo USAGE:
echo init.cmd [--help] [-c^|--compiler ^<clang^|msvc^>] [-g^|--generator ^<ninja^|msbuild^>]
echo [-b^|--build-type ^<debug^|release^|relwithdebinfo^|minsizerel^>] [-l^|--linker link^|lld-link]
echo [--fast] [-v^|--version X.Y.Z]
echo [-b^|--build-type ^<debug^|release^|relwithdebinfo^|minsizerel^>] [-v^|--version X.Y.Z]
echo [--cppwinrt ^<version^>] [--fast]
echo.
echo ARGUMENTS
echo -c^|--compiler Controls the compiler used, either 'clang' (the default) or 'msvc'
@ -20,6 +20,7 @@ goto :init
echo 'relwithdebinfo', or 'minsizerel'
echo -v^|--version Specifies the version of the NuGet package produced. Primarily only used by the CI
echo build and is typically not necessary when building locally
echo --cppwinrt Manually specifies the version of C++/WinRT to use for generating headers
echo --fast Used to (slightly) reduce compile times and build output size. This is primarily
echo used by the CI build machines where resources are more constrained. This switch is
echo temporary and will be removed once https://github.com/microsoft/wil/issues/9 is fixed
@ -30,10 +31,10 @@ goto :init
set COMPILER=
set GENERATOR=
set BUILD_TYPE=
set LINKER=
set CMAKE_ARGS=
set BITNESS=
set VERSION=
set CPPWINRT_VERSION=
set FAST_BUILD=0
:parse
@ -88,29 +89,25 @@ goto :init
goto :parse
)
set LINKER_SET=0
if /I "%~1"=="-l" set LINKER_SET=1
if /I "%~1"=="--linker" set LINKER_SET=1
if %LINKER_SET%==1 (
if "%LINKER%" NEQ "" echo ERROR: Linker already specified & call :usage & exit /B 1
set VERSION_SET=0
if /I "%~1"=="-v" set VERSION_SET=1
if /I "%~1"=="--version" set VERSION_SET=1
if %VERSION_SET%==1 (
if "%VERSION%" NEQ "" echo ERROR: Version already specified & call :usage & exit /B 1
if /I "%~2"=="" echo ERROR: Version string missing & call :usage & exit /B 1
if /I "%~2"=="link" set LINKER=link
if /I "%~2"=="lld-link" set LINKER=lld-link
if "!LINKER!"=="" echo ERROR: Unrecognized/missing linker %~2 & call :usage & exit /B 1
set VERSION=%~2
shift
shift
goto :parse
)
set VERSION_SET=0
if /I "%~1"=="-v" set VERSION_SET=1
if /I "%~1"=="--version" set VERSION_SET=1
if %VERSION_SET%==1 (
if "%VERSION%" NEQ "" echo ERROR: Version alread specified & call :usage & exit /B 1
if /I "%~2"=="" echo ERROR: Version string missing & call :usage & exit /B 1
if /I "%~1"=="--cppwinrt" (
if "%CPPWINRT_VERSION%" NEQ "" echo ERROR: C++/WinRT version already specified & call :usage & exit /B 1
if /I "%~2"=="" echo ERROR: C++/WinRT version string missing & call :usage & exit /B 1
set VERSION=%~2
set CPPWINRT_VERSION=%~2
shift
shift
@ -132,9 +129,6 @@ goto :init
:: Check for conflicting arguments
if "%GENERATOR%"=="msbuild" (
if "%COMPILER%"=="clang" echo ERROR: Cannot use Clang with MSBuild & exit /B 1
:: While CMake won't give an error, specifying the linker won't actually have any effect with the VS generator
if "%LINKER%"=="lld-link" echo ERROR: Cannot use lld-link with MSBuild & exit /B 1
)
:: Select defaults
@ -145,8 +139,6 @@ goto :init
if "%BUILD_TYPE%"=="" set BUILD_TYPE=debug
if "%LINKER%"=="" set LINKER=link
:: Formulate CMake arguments
if %GENERATOR%==ninja set CMAKE_ARGS=%CMAKE_ARGS% -G Ninja
@ -167,14 +159,14 @@ goto :init
set CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_SYSTEM_VERSION=10.0
)
if %LINKER%==lld-link (
set CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_LINKER=lld-link
)
if "%VERSION%" NEQ "" set CMAKE_ARGS=%CMAKE_ARGS% -DWIL_BUILD_VERSION=%VERSION%
if "%CPPWINRT_VERSION%" NEQ "" set CMAKE_ARGS=%CMAKE_ARGS% -DCPPWINRT_VERSION=%CPPWINRT_VERSION%
if %FAST_BUILD%==1 set CMAKE_ARGS=%CMAKE_ARGS% -DFAST_BUILD=ON
set CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
:: Figure out the platform
if "%Platform%"=="" echo ERROR: The init.cmd script must be run from a Visual Studio command window & exit /B 1
if "%Platform%"=="x86" (
@ -191,7 +183,6 @@ goto :init
:: Run CMake
pushd %BUILD_DIR%
echo Using compiler....... %COMPILER%
echo Using linker......... %LINKER%
echo Using architecture... %Platform%
echo Using build type..... %BUILD_TYPE%
echo Using build root..... %CD%

View File

@ -1,13 +1,14 @@
@echo off
setlocal
setlocal EnableDelayedExpansion
:: NOTE: Architecture is picked up from the command window, so we can't control that here :(
set COMPILERS=clang msvc
set BUILD_TYPES=debug relwithdebinfo
call %~dp0\init.cmd -c clang -g ninja -b debug %*
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call %~dp0\init.cmd -c clang -g ninja -b relwithdebinfo %*
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call %~dp0\init.cmd -c msvc -g ninja -b debug %*
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call %~dp0\init.cmd -c msvc -g ninja -b relwithdebinfo %*
if %ERRORLEVEL% NEQ 0 ( goto :eof )
for %%c in (%COMPILERS%) do (
for %%b in (%BUILD_TYPES%) do (
call %~dp0\init.cmd -c %%c -g ninja -b %%b %*
if !ERRORLEVEL! NEQ 0 ( goto :eof )
)
)

View File

@ -1,44 +1,24 @@
@echo off
setlocal
setlocal EnableDelayedExpansion
set TEST_ARGS=%*
set BUILD_ROOT=%~dp0\..\build
:: Unlike building, we don't need to limit ourselves to the Platform of the command window
call :execute_tests clang64debug
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests clang64release
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests clang64relwithdebinfo
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests clang64minsizerel
if %ERRORLEVEL% NEQ 0 ( goto :eof )
set COMPILERS=clang msvc
set ARCHITECTURES=32 64
set BUILD_TYPES=debug release relwithdebinfo minsizerel
call :execute_tests clang32debug
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests clang32release
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests clang32relwithdebinfo
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests clang32minsizerel
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests msvc64debug
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests msvc64release
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests msvc64relwithdebinfo
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests msvc64minsizerel
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests msvc32debug
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests msvc32release
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests msvc32relwithdebinfo
if %ERRORLEVEL% NEQ 0 ( goto :eof )
call :execute_tests msvc32minsizerel
if %ERRORLEVEL% NEQ 0 ( goto :eof )
for %%c in (%COMPILERS%) do (
for %%a in (%ARCHITECTURES%) do (
for %%b in (%BUILD_TYPES%) do (
call :execute_tests %%c%%a%%b
if !ERRORLEVEL! NEQ 0 ( goto :eof )
)
)
)
goto :eof
@ -49,19 +29,27 @@ if not exist %BUILD_DIR% ( goto :eof )
pushd %BUILD_DIR%
echo Running tests from %CD%
call :execute_test app witest.app.exe
if %ERRORLEVEL% NEQ 0 ( popd && goto :eof )
if %ERRORLEVEL% NEQ 0 ( goto :execute_tests_done )
call :execute_test cpplatest witest.cpplatest.exe
if %ERRORLEVEL% NEQ 0 ( popd && goto :eof )
if %ERRORLEVEL% NEQ 0 ( goto :execute_tests_done )
call :execute_test noexcept witest.noexcept.exe
if %ERRORLEVEL% NEQ 0 ( popd && goto :eof )
if %ERRORLEVEL% NEQ 0 ( goto :execute_tests_done )
call :execute_test normal witest.exe
if %ERRORLEVEL% NEQ 0 ( popd && goto :eof )
popd
if %ERRORLEVEL% NEQ 0 ( goto :execute_tests_done )
call :execute_test sanitize-address witest.asan.exe
if %ERRORLEVEL% NEQ 0 ( goto :execute_tests_done )
call :execute_test sanitize-undefined-behavior witest.ubsan.exe
if %ERRORLEVEL% NEQ 0 ( goto :execute_tests_done )
call :execute_test win7 witest.win7.exe
if %ERRORLEVEL% NEQ 0 ( goto :execute_tests_done )
goto :eof
:execute_tests_done
set EXIT_CODE=%ERRORLEVEL%
popd
exit /B %EXIT_CODE%
:execute_test
if not exist tests\%1\%2 ( goto :eof )
echo Running %1 tests...
tests\%1\%2
tests\%1\%2 %TEST_ARGS%
goto :eof