From 4d64f27d4d524e794b86000a229a141892fa73a8 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 14 Sep 2023 10:52:16 -0700 Subject: [PATCH 01/12] build: enable macros during the build Use WiX to extract a future toolchain to allow building the macros support when building the toolchain. We build swift-syntax and now wire that into the build itself. --- utils/build-windows-toolchain.bat | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index 77eb0d8e9454e..17595c0ca639a 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -54,6 +54,8 @@ del /f /q "%UniversalCRTSdkDir%\Include\%UCRTVersion%\um\module.modulemap" del /f /q "%VCToolsInstallDir%\include\module.modulemap" del /f /q "%VCToolsInstallDir%\include\vcruntime.apinotes" +call :FetchWiX || (exit /b) +call :FetchX64Toolchain || (exit /b) call :CloneDependencies || (exit /b) call :CloneRepositories || (exit /b) @@ -190,6 +192,33 @@ cmake ^ cmake --build "%BuildRoot%\curl" || (exit /b) cmake --build "%BuildRoot%\curl" --target install || (exit /b) +path %BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\PFiles64\Swift\Runtimes\0.0.0\usr\bin;%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\PFiles64\Swift\Toolchains\0.0.0+Asserts\usr\bin;%Path% + +:: Build Swift Syntax +cmake ^ + -B "%BuildRoot%\99" ^ + + -D BUILD_SHARED_LIBS=YES ^ + -D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^ + -D CMAKE_C_COMPILER=cl.exe ^ + -D CMAKE_C_FLAGS="/GS- /Oy /Gw /Gy" ^ + -D CMAKE_CXX_COMPILER=cl ^ + -D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^ + -D CMAKE_MT=mt ^ + -D CMAKE_Swift_COMPILER=%BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Toolchains/0.0.0+Asserts/usr/bin/swiftc.exe ^ + -D CMAKE_Swift_FLAGS="-sdk %BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ + -D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^ + -D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^ + + -D CMAKE_INSTALL_PREFIX="%InstallRoot%" ^ + + -D SWIFT_SYNTAX_ENABLE_WMO_PRE_3_26=YES ^ + + -G Ninja ^ + -S %SourceRoot%\swift-syntax || (exit /b) +cmake --build %BuildRoot%\99 || (exit /b) +cmake --build %BuildRoot%\99 --target install || (exit /b) + :: Build Toolchain cmake ^ -B "%BuildRoot%\1" ^ @@ -207,11 +236,17 @@ cmake ^ -D CMAKE_INSTALL_PREFIX="%InstallRoot%" ^ + -D CMAKE_Swift_COMPILER="%BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Toolchains/0.0.0+Asserts/usr/bin/swiftc.exe" ^ + -D CMAKE_Swift_FLAGS="-sdk %BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ + -D LLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-windows-msvc ^ -D PACKAGE_VENDOR="swift.org" ^ -D CLANG_VENDOR="swift.org" ^ -D CLANG_VENDOR_UTI="org.swift" ^ + -D LLDB_PYTHON_EXE_RELATIVE_PATH=python.exe ^ + -D LLDB_PYTHON_EXT_SUFFIX=.pyd ^ + -D LLDB_PYTHON_RELATIVE_PATH=lib/site-packages ^ -D LLVM_APPEND_VC_REV=NO ^ -D LLVM_VERSION_SUFFIX="" ^ @@ -226,9 +261,11 @@ cmake ^ -D LLVM_EXTERNAL_CMARK_SOURCE_DIR="%SourceRoot%\cmark" ^ -D PYTHON_HOME=%PYTHON_HOME% ^ -D PYTHON_EXECUTABLE=%PYTHON_HOME%\python.exe ^ + -D SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR="%BuildRoot%\99" ^ -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE="%SourceRoot%\swift-corelibs-libdispatch" ^ -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE="%SourceRoot%\swift-syntax" ^ -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=%SourceRoot%\swift-experimental-string-processing ^ + -D SWIFT_PATH_TO_SWIFT_SDK="%BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" -G Ninja ^ -S llvm-project\llvm || (exit /b) @@ -815,6 +852,30 @@ git clone --quiet --no-tags --depth 1 --branch curl-7_77_0 https://github.com/cu goto :eof endlocal +:FetchWiX +setlocal enableextensions enabledelayedexpansion + +curl.exe -sL https://www.nuget.org/api/v2/package/wix/4.0.1 -o wix-4.0.1.zip +md WiX-4.0.1 || exit (/b) +cd WiX-4.0.1 || exit (/b) +tar -xf ../wix-4.0.1.zip || exit (/b) + +goto :eof +endlocal + +:FetchX64Toolchain +setlocal enableextensions enabledelayedexpansion + +curl.exe -k -sOL "https://download.swift.org/development/windows10/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a-windows10.exe" || (exit /b) +"WiX-4.0.1\tools\net6.0\any\wix.exe" burn extract swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a-windows10.exe -o %BuildRoot%\toolchains || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a0" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\PFiles64\Swift\Runtimes\0.0.0\usr\bin\" || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a1" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\" || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a2" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\" || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a5" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\" || (exit /b) + +goto :eof +endlocal + :TestSwift setlocal enableextensions enabledelayedexpansion From e201aa005b85a62a5289ab2c3605526b35dd3c98 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 15 Sep 2023 07:13:09 -0700 Subject: [PATCH 02/12] Update build-windows-toolchain.bat --- utils/build-windows-toolchain.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index 17595c0ca639a..1141d149d4256 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -265,7 +265,7 @@ cmake ^ -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE="%SourceRoot%\swift-corelibs-libdispatch" ^ -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE="%SourceRoot%\swift-syntax" ^ -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=%SourceRoot%\swift-experimental-string-processing ^ - -D SWIFT_PATH_TO_SWIFT_SDK="%BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" + -D SWIFT_PATH_TO_SWIFT_SDK="%BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ -G Ninja ^ -S llvm-project\llvm || (exit /b) From 422008e98ea7e90578fc8d50e35468623006c485 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 19 Sep 2023 09:49:17 -0700 Subject: [PATCH 03/12] Update build-windows-toolchain.bat --- utils/build-windows-toolchain.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index 1141d149d4256..9472371642649 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -209,11 +209,11 @@ cmake ^ -D CMAKE_Swift_FLAGS="-sdk %BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ -D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^ -D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^ + -D CMAKE_Swift_FLAGS_RELEASE="-O" ^ + -D CMAKE_Swift_FLAGS_RELWITHDEBINFO="-O" ^ -D CMAKE_INSTALL_PREFIX="%InstallRoot%" ^ - -D SWIFT_SYNTAX_ENABLE_WMO_PRE_3_26=YES ^ - -G Ninja ^ -S %SourceRoot%\swift-syntax || (exit /b) cmake --build %BuildRoot%\99 || (exit /b) From 390f6e76452e39d042cd954edd2ae29506fbaf95 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 19 Sep 2023 15:00:02 -0700 Subject: [PATCH 04/12] Update build-windows-toolchain.bat try a more recent toolchain --- utils/build-windows-toolchain.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index 9472371642649..d72e3b3079d3c 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -866,7 +866,7 @@ endlocal :FetchX64Toolchain setlocal enableextensions enabledelayedexpansion -curl.exe -k -sOL "https://download.swift.org/development/windows10/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a-windows10.exe" || (exit /b) +curl.exe -k -sOL "https://github.com/thebrowsercompany/swift-build/releases/download/20230919.2/installer-amd64.exe" || (exit /b) "WiX-4.0.1\tools\net6.0\any\wix.exe" burn extract swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a-windows10.exe -o %BuildRoot%\toolchains || (exit /b) msiexec.exe /qn /a "%BuildRoot%\toolchains\a0" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\PFiles64\Swift\Runtimes\0.0.0\usr\bin\" || (exit /b) msiexec.exe /qn /a "%BuildRoot%\toolchains\a1" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\" || (exit /b) From 3b76bdada9c7a50e4947a74912ab3dcfbced27d6 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 19 Sep 2023 15:48:01 -0700 Subject: [PATCH 05/12] Update build-windows-toolchain.bat --- utils/build-windows-toolchain.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index d72e3b3079d3c..190bc6b15e694 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -867,7 +867,7 @@ endlocal setlocal enableextensions enabledelayedexpansion curl.exe -k -sOL "https://github.com/thebrowsercompany/swift-build/releases/download/20230919.2/installer-amd64.exe" || (exit /b) -"WiX-4.0.1\tools\net6.0\any\wix.exe" burn extract swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a-windows10.exe -o %BuildRoot%\toolchains || (exit /b) +"WiX-4.0.1\tools\net6.0\any\wix.exe" burn extract installer-amd64.exe -o %BuildRoot%\toolchains || (exit /b) msiexec.exe /qn /a "%BuildRoot%\toolchains\a0" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\PFiles64\Swift\Runtimes\0.0.0\usr\bin\" || (exit /b) msiexec.exe /qn /a "%BuildRoot%\toolchains\a1" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\" || (exit /b) msiexec.exe /qn /a "%BuildRoot%\toolchains\a2" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\" || (exit /b) From 8fc3b7f0e7d0d44b5c4ec1ff01fca3da8c83090b Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 20 Sep 2023 10:15:55 -0700 Subject: [PATCH 06/12] Update build-windows-toolchain.bat --- utils/build-windows-toolchain.bat | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index 190bc6b15e694..1fdf4273eba1b 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -192,7 +192,7 @@ cmake ^ cmake --build "%BuildRoot%\curl" || (exit /b) cmake --build "%BuildRoot%\curl" --target install || (exit /b) -path %BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\PFiles64\Swift\Runtimes\0.0.0\usr\bin;%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\PFiles64\Swift\Toolchains\0.0.0+Asserts\usr\bin;%Path% +path %BuildRoot%\toolchains\5.9.0\PFiles64\Swift\runtime-development\usr\bin;%BuildRoot%\toolchains\5.9.0\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin;%Path% :: Build Swift Syntax cmake ^ @@ -205,8 +205,8 @@ cmake ^ -D CMAKE_CXX_COMPILER=cl ^ -D CMAKE_CXX_FLAGS="/GS- /Oy /Gw /Gy" ^ -D CMAKE_MT=mt ^ - -D CMAKE_Swift_COMPILER=%BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Toolchains/0.0.0+Asserts/usr/bin/swiftc.exe ^ - -D CMAKE_Swift_FLAGS="-sdk %BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ + -D CMAKE_Swift_COMPILER=%BuildRoot%/toolchains/5.9.0/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe ^ + -D CMAKE_Swift_FLAGS="-sdk %BuildRoot%/toolchains/5.9.0/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ -D CMAKE_EXE_LINKER_FLAGS="/INCREMENTAL:NO" ^ -D CMAKE_SHARED_LINKER_FLAGS="/INCREMENTAL:NO" ^ -D CMAKE_Swift_FLAGS_RELEASE="-O" ^ @@ -236,8 +236,8 @@ cmake ^ -D CMAKE_INSTALL_PREFIX="%InstallRoot%" ^ - -D CMAKE_Swift_COMPILER="%BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Toolchains/0.0.0+Asserts/usr/bin/swiftc.exe" ^ - -D CMAKE_Swift_FLAGS="-sdk %BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ + -D CMAKE_Swift_COMPILER="%BuildRoot%/toolchains/5.9.0/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swiftc.exe" ^ + -D CMAKE_Swift_FLAGS="-sdk %BuildRoot%/toolchains/5.9.0/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ -D LLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-windows-msvc ^ @@ -265,7 +265,7 @@ cmake ^ -D SWIFT_PATH_TO_LIBDISPATCH_SOURCE="%SourceRoot%\swift-corelibs-libdispatch" ^ -D SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE="%SourceRoot%\swift-syntax" ^ -D SWIFT_PATH_TO_STRING_PROCESSING_SOURCE=%SourceRoot%\swift-experimental-string-processing ^ - -D SWIFT_PATH_TO_SWIFT_SDK="%BuildRoot%/toolchains/swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a/PFiles64/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ + -D SWIFT_PATH_TO_SWIFT_SDK="%BuildRoot%/toolchains/5.9.0/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" ^ -G Ninja ^ -S llvm-project\llvm || (exit /b) @@ -866,12 +866,14 @@ endlocal :FetchX64Toolchain setlocal enableextensions enabledelayedexpansion -curl.exe -k -sOL "https://github.com/thebrowsercompany/swift-build/releases/download/20230919.2/installer-amd64.exe" || (exit /b) -"WiX-4.0.1\tools\net6.0\any\wix.exe" burn extract installer-amd64.exe -o %BuildRoot%\toolchains || (exit /b) -msiexec.exe /qn /a "%BuildRoot%\toolchains\a0" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\PFiles64\Swift\Runtimes\0.0.0\usr\bin\" || (exit /b) -msiexec.exe /qn /a "%BuildRoot%\toolchains\a1" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\" || (exit /b) -msiexec.exe /qn /a "%BuildRoot%\toolchains\a2" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\" || (exit /b) -msiexec.exe /qn /a "%BuildRoot%\toolchains\a5" TARGETDIR="%BuildRoot%\toolchains\swift-DEVELOPMENT-SNAPSHOT-2023-08-12-a\" || (exit /b) +curl.exe -k -sOL "https://download.swift.org/swift-5.9-release/windows10/swift-5.9-RELEASE/swift-5.9-RELEASE-windows10.exe" || (exit /b) +"WiX-4.0.1\tools\net6.0\any\wix.exe" burn extract swift-5.9-RELEASE-windows10.exe -o %BuildRoot%\toolchains || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a0" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a1" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a2" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a3" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a4" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) +msiexec.exe /qn /a "%BuildRoot%\toolchains\a5" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) goto :eof endlocal From c62d41d63ea622ae403e25fe378d1004cec35115 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 20 Sep 2023 11:20:15 -0700 Subject: [PATCH 07/12] Update build-windows-toolchain.bat --- utils/build-windows-toolchain.bat | 2 -- 1 file changed, 2 deletions(-) diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index 1fdf4273eba1b..662ad04829497 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -872,8 +872,6 @@ msiexec.exe /qn /a "%BuildRoot%\toolchains\a0" TARGETDIR="%BuildRoot%\toolchains msiexec.exe /qn /a "%BuildRoot%\toolchains\a1" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) msiexec.exe /qn /a "%BuildRoot%\toolchains\a2" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) msiexec.exe /qn /a "%BuildRoot%\toolchains\a3" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) -msiexec.exe /qn /a "%BuildRoot%\toolchains\a4" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) -msiexec.exe /qn /a "%BuildRoot%\toolchains\a5" TARGETDIR="%BuildRoot%\toolchains\5.9.0\" || (exit /b) goto :eof endlocal From 8c88f0f3f2d2f41984660a0359b97b9b7aa4d515 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 20 Sep 2023 13:22:29 -0700 Subject: [PATCH 08/12] Update lit.cfg --- test/lit.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/test/lit.cfg b/test/lit.cfg index 35d6ac55029a7..1ef32985a4b9d 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -351,6 +351,7 @@ config.gyb = make_path(config.swift_utils, 'gyb.py') config.rth = make_path(config.swift_utils, 'rth') # Resilience test helper config.scale_test = make_path(config.swift_utils, 'scale-test') config.PathSanitizingFileCheck = make_path(config.swift_utils, 'PathSanitizingFileCheck') +config.swift_bin_dir = make_path(config.swift, '..', '..', 'bin') config.swift_lib_dir = make_path(config.swift, '..', '..', 'lib') config.round_trip_syntax_test = make_path(config.swift_utils, 'round-trip-syntax-test') config.refactor_check_compiles = make_path(config.swift_utils, 'refactor-check-compiles.py') From 254feaca9b22b619cae38a80ad55ad8362614d4b Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Thu, 21 Sep 2023 15:22:31 -0400 Subject: [PATCH 09/12] Fix silent test failures in the Windows CI --- utils/build-windows-toolchain.bat | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/build-windows-toolchain.bat b/utils/build-windows-toolchain.bat index 662ad04829497..195b902b182ba 100644 --- a/utils/build-windows-toolchain.bat +++ b/utils/build-windows-toolchain.bat @@ -781,25 +781,25 @@ python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'D :: TODO(compnerd) match the XCTest installation name python -c "import plistlib; print(str(plistlib.dumps({ 'DefaultProperties': { 'XCTEST_VERSION': 'development' } }), encoding='utf-8'))" > %PlatformRoot%\Info.plist -IF NOT "%SKIP_PACKAGING%"=="1" call :PackageToolchain +IF NOT "%SKIP_PACKAGING%"=="1" call :PackageToolchain || (exit /b) :: TODO(compnerd) test LLVM SET SKIP_TEST=0 FOR %%T IN (%SKIP_TESTS%) DO (IF /I %%T==swift SET SKIP_TEST=1) -IF "%SKIP_TEST%"=="0" call :TestSwift +IF "%SKIP_TEST%"=="0" call :TestSwift || (exit /b) SET SKIP_TEST=0 FOR %%T IN (%SKIP_TESTS%) DO (IF /I %%T==dispatch SET SKIP_TEST=1) -IF "%SKIP_TEST%"=="0" call :TestDispatch +IF "%SKIP_TEST%"=="0" call :TestDispatch || (exit /b) SET SKIP_TEST=0 FOR %%T IN (%SKIP_TESTS%) DO (IF /I %%T==foundation SET SKIP_TEST=1) -IF "%SKIP_TEST%"=="0" call :TestFoundation +IF "%SKIP_TEST%"=="0" call :TestFoundation || (exit /b) SET SKIP_TEST=0 FOR %%T IN (%SKIP_TESTS%) DO (IF /I %%T==xctest SET SKIP_TEST=1) -IF "%SKIP_TEST%"=="0" call :TestXCTest +IF "%SKIP_TEST%"=="0" call :TestXCTest || (exit /b) :: Clean up the module cache rd /s /q %LocalAppData%\clang\ModuleCache From fea49fd6fd86cc8be5963e906ba2741b7332525d Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Wed, 23 Aug 2023 13:30:12 -0400 Subject: [PATCH 10/12] Remove realpath in lit site config. (cherry picked from commit 7d13da43ded184e85d4ae6f83b9c08fe2279cb4e) --- test/lit.site.cfg.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in index 9f238f6eab31d..06af9476c7f12 100644 --- a/test/lit.site.cfg.in +++ b/test/lit.site.cfg.in @@ -13,6 +13,7 @@ import os import platform import sys +import lit.util config.cmake = "@CMAKE_COMMAND@" config.llvm_src_root = "@LLVM_MAIN_SRC_DIR@" @@ -170,6 +171,6 @@ if '@SWIFT_SWIFT_PARSER@' == 'TRUE': # Let the main config do the real work. if config.test_exec_root is None: - config.test_exec_root = os.path.dirname(os.path.realpath(__file__)) + config.test_exec_root = os.path.dirname(lit.util.abs_path_preserve_drive(__file__)) lit_config.load_config( config, os.path.join(config.swift_src_root, "test", "lit.cfg")) From 2aeec435b9935ab2b76a76cf2c9de4d2ae15cd04 Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Tue, 22 Aug 2023 12:10:29 -0400 Subject: [PATCH 11/12] Use llvm's abs_path_preserve_drive (#68038) (cherry picked from commit 136642c167abdf197711c9349e2987ac97eb8f6d) --- test/lit.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/lit.cfg b/test/lit.cfg index 1ef32985a4b9d..c757dda069542 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -2706,8 +2706,8 @@ run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitiz # we provide we use realpath here. Because PathSanitizingFileCheck only # understands sanitize patterns with forward slashes, and realpath normalizes # the slashes, we have to replace them back to forward slashes. - shell_quote(os.path.realpath(swift_obj_root).replace("\\", "/")), - shell_quote(os.path.realpath(config.swift_src_root).replace("\\", "/")), + shell_quote(lit.util.abs_path_preserve_drive(swift_obj_root).replace("\\", "/")), + shell_quote(lit.util.abs_path_preserve_drive(config.swift_src_root).replace("\\", "/")), shell_quote(config.filecheck), '--enable-windows-compatibility' if kIsWindows else '') From d1553c9eee38000a3eb0710d2811b5f36b989061 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Tue, 26 Sep 2023 21:15:04 -0700 Subject: [PATCH 12/12] [Test] Add xfail for failing test 5.9 has been running builds in CI without failing when tests failed, xfail the only failing test. --- .../class/method/msvc-abi-return-indirect-trivial-record.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Interop/Cxx/class/method/msvc-abi-return-indirect-trivial-record.swift b/test/Interop/Cxx/class/method/msvc-abi-return-indirect-trivial-record.swift index dd29bd4aca466..335b7b293ffe1 100644 --- a/test/Interop/Cxx/class/method/msvc-abi-return-indirect-trivial-record.swift +++ b/test/Interop/Cxx/class/method/msvc-abi-return-indirect-trivial-record.swift @@ -3,6 +3,7 @@ // RUN: %target-swift-emit-irgen -I %t/Inputs -enable-experimental-cxx-interop -Xcc -std=c++17 %t/test.swift -module-name Test | %FileCheck %s // REQUIRES: OS=windows-msvc +// XFAIL: OS=windows-msvc //--- Inputs/module.modulemap module MsvcUseVecIt {