Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ enum Project {
Certificates
System
Subprocess
ToolsProtocols
Build
PackageManager
PackageManagerRuntime
Expand Down Expand Up @@ -3446,6 +3447,21 @@ function Build-Subprocess([Hashtable] $Platform) {
}
}

function Build-ToolsProtocols([Hashtable] $Platform) {
$SDKROOT = Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK
Build-CMakeProject `
-Src $SourceCache\swift-tools-protocols `
-Bin (Get-ProjectBinaryCache $Platform ToolsProtocols) `
-Platform $Platform `
-UseBuiltCompilers C,CXX,Swift `
-SwiftSDK $SDKROOT `
-BuildTargets default `
-Defines @{
BUILD_SHARED_LIBS = "NO";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a single use library? i.e. does only one product use the library? If not, we should consider the shared version with numbers on the size impact - that is verify that static linking is smaller than the dynamic linking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's going to get linked into at least two executables, so I will probably end up flipping it to a shared library but I haven't tested it yet

CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
}
}

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
Expand All @@ -3466,6 +3482,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)
Expand Down Expand Up @@ -3659,6 +3676,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);
Expand Down Expand Up @@ -3812,6 +3830,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);
}
}

Expand Down Expand Up @@ -3870,6 +3889,14 @@ 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",
"-Xlinker", "-L$(Get-ProjectBinaryCache $BuildPlatform ToolsProtocols)\lib",
"-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform ToolsProtocols)\lib\libBuildServerProtocol.lib",
"-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform ToolsProtocols)\lib\libLanguageServerProtocol.lib",
"-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform ToolsProtocols)\lib\libLanguageServerProtocolTransport.lib",
"-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform ToolsProtocols)\lib\libSKLogging.lib",
"-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform ToolsProtocols)\lib\libToolsProtocolsSwiftExtensions.lib",
# LMDB
"-Xlinker", "$(Get-ProjectBinaryCache $BuildPlatform LMDB)\lib\CLMDB.lib",
# sourcekit-lsp
Expand Down Expand Up @@ -4331,6 +4358,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
Expand Down
8 changes: 4 additions & 4 deletions utils/update_checkout/update-checkout-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.4",
"swift-tools-support-core": "main",
"swiftpm": "main",
"swift-argument-parser": "1.5.1",
Expand Down Expand Up @@ -513,7 +513,7 @@
"swift-nio-ssl": "2.15.0",
"swift-experimental-string-processing": "swift/release/6.0",
"wasi-libc": "wasi-sdk-20",
"wasmkit": "0.0.3",
"wasmkit": "0.0.4",
"curl": "curl-8_4_0",
"icu": "maint/maint-69",
"libxml2": "v2.11.5",
Expand Down Expand Up @@ -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.4",
"swift-tools-support-core": "main",
"swiftpm": "main",
"swift-argument-parser": "1.5.1",
Expand Down Expand Up @@ -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.4",
"swift-tools-support-core": "main",
"swiftpm": "main",
"swift-argument-parser": "1.5.1",
Expand Down