From c12d5a7b8c055a367bb3218597f243b14e16d109 Mon Sep 17 00:00:00 2001 From: Owen Voorhees Date: Wed, 22 Oct 2025 21:41:25 -0700 Subject: [PATCH] build.ps1: add swift-tools-protocols --- utils/build.ps1 | 22 +++++++++++++++++++ .../update-checkout-config.json | 6 ++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 7ceab4733b689..dd806a5d54eea 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -851,6 +851,7 @@ enum Project { Certificates System Subprocess + ToolsProtocols Build PackageManager PackageManagerRuntime @@ -3446,6 +3447,19 @@ function Build-Subprocess([Hashtable] $Platform) { } } +function Build-ToolsProtocols([Hashtable] $Platform) { + Build-CMakeProject ` + -Src $SourceCache\swift-tools-protocols ` + -Bin (Get-ProjectBinaryCache $Platform ToolsProtocols) ` + -InstallTo "$($Platform.ToolchainInstallRoot)\usr" ` + -Platform $Platform ` + -UseBuiltCompilers C,CXX,Swift ` + -SwiftSDK (Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK) ` + -Defines @{ + BUILD_SHARED_LIBS = "YES"; + } +} + function Build-Build([Hashtable] $Platform) { # Use lld to workaround the ARM64 LNK1322 issue: https://github.com/swiftlang/swift/issues/79740 # FIXME(hjyamauchi) Have a real fix @@ -3466,6 +3480,7 @@ function Build-Build([Hashtable] $Platform) { SwiftDriver_DIR = (Get-ProjectCMakeModules $Platform Driver); SwiftSystem_DIR = (Get-ProjectCMakeModules $Platform System); TSC_DIR = (Get-ProjectCMakeModules $Platform ToolsSupportCore); + SwiftToolsProtocols_DIR = (Get-ProjectCMakeModules $Platform ToolsProtocols); SQLite3_INCLUDE_DIR = "$SourceCache\swift-toolchain-sqlite\Sources\CSQLite\include"; SQLite3_LIBRARY = "$(Get-ProjectBinaryCache $Platform SQLite)\SQLite3.lib"; } + $ArchSpecificOptions) @@ -3659,6 +3674,7 @@ function Build-PackageManager([Hashtable] $Platform) { ArgumentParser_DIR = (Get-ProjectCMakeModules $Platform ArgumentParser); SwiftDriver_DIR = (Get-ProjectCMakeModules $Platform Driver); SwiftBuild_DIR = (Get-ProjectCMakeModules $Platform Build); + SwiftToolsProtocols_DIR = (Get-ProjectCMakeModules $Platform ToolsProtocols); SwiftCrypto_DIR = (Get-ProjectCMakeModules $Platform Crypto); SwiftCollections_DIR = (Get-ProjectCMakeModules $Platform Collections); SwiftASN1_DIR = (Get-ProjectCMakeModules $Platform ASN1); @@ -3812,6 +3828,7 @@ function Build-SourceKitLSP([Hashtable] $Platform) { SwiftPM_DIR = (Get-ProjectCMakeModules $Platform PackageManager); LMDB_DIR = (Get-ProjectCMakeModules $Platform LMDB); IndexStoreDB_DIR = (Get-ProjectCMakeModules $Platform IndexStoreDB); + SwiftToolsProtocols_DIR = (Get-ProjectCMakeModules $Platform ToolsProtocols); } } @@ -3870,6 +3887,10 @@ function Test-SourceKitLSP { "-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform IndexStoreDB)\Sources\IndexStoreDB_Index\Index.lib", "-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform IndexStoreDB)\Sources\IndexStoreDB_LLVMSupport\LLVMSupport.lib", "-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform IndexStoreDB)\Sources\IndexStoreDB_Support\Support.lib", + # swift-tools-protocols + "-Xswiftc", "-I$(Get-ProjectBinaryCache $BuildPlatform ToolsProtocols)\swift", + "-Xswiftc", "-I$SourceCache\swift-tools-protocols\Sources\ToolsProtocolsCAtomics\include", + "-Xlinker", "-L$(Get-ProjectBinaryCache $BuildPlatform ToolsProtocols)\lib", # LMDB "-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform LMDB)\lib\CLMDB.lib", # sourcekit-lsp @@ -4331,6 +4352,7 @@ if (-not $SkipBuild) { Invoke-BuildStep Build-Certificates $HostPlatform Invoke-BuildStep Build-System $HostPlatform Invoke-BuildStep Build-Subprocess $HostPlatform + Invoke-BuildStep Build-ToolsProtocols $HostPlatform Invoke-BuildStep Build-Build $HostPlatform Invoke-BuildStep Build-PackageManager $HostPlatform Invoke-BuildStep Build-Markdown $HostPlatform diff --git a/utils/update_checkout/update-checkout-config.json b/utils/update_checkout/update-checkout-config.json index 59df15fb4bc56..f52d70bf8dffb 100644 --- a/utils/update_checkout/update-checkout-config.json +++ b/utils/update_checkout/update-checkout-config.json @@ -145,7 +145,7 @@ "llbuild": "main", "swift-build": "main", "swift-toolchain-sqlite": "1.0.7", - "swift-tools-protocols": "0.0.2", + "swift-tools-protocols": "0.0.8", "swift-tools-support-core": "main", "swiftpm": "main", "swift-argument-parser": "1.5.1", @@ -577,7 +577,7 @@ "llbuild": "main", "swift-build": "main", "swift-toolchain-sqlite": "1.0.7", - "swift-tools-protocols": "0.0.2", + "swift-tools-protocols": "0.0.8", "swift-tools-support-core": "main", "swiftpm": "main", "swift-argument-parser": "1.5.1", @@ -638,7 +638,7 @@ "llbuild": "main", "swift-build": "main", "swift-toolchain-sqlite": "1.0.7", - "swift-tools-protocols": "0.0.2", + "swift-tools-protocols": "0.0.8", "swift-tools-support-core": "main", "swiftpm": "main", "swift-argument-parser": "1.5.1",