From 9706951e5bb53d4bc49c4ded4ee86cf13dddf8f4 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 22 Jul 2025 09:55:46 -0700 Subject: [PATCH 1/5] utils: simplify signature for `Build-ExperimentalRuntime` --- utils/build.ps1 | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 75232c95f119c..0fac4d8f7a5b3 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -2455,15 +2455,7 @@ function Test-Runtime([Hashtable] $Platform) { } } -function Build-ExperimentalRuntime { - [CmdletBinding(PositionalBinding = $false)] - param - ( - [Parameter(Position = 0, Mandatory = $true)] - [Hashtable] $Platform, - [switch] $Static = $false - ) - +function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $false) { # TODO: remove this once the migration is completed. Invoke-IsolatingEnvVars { Invoke-VsDevShell $BuildPlatform From c1530f6228c835d94e1a9c00e1bb95667e8f04bb Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 22 Jul 2025 09:56:18 -0700 Subject: [PATCH 2/5] utils: rename `StaticFoundation` to `ExperimentalFoundation` --- utils/build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 0fac4d8f7a5b3..50d1e823597cd 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -715,7 +715,7 @@ enum Project { ExperimentalObservation ExperimentalDispatch ExperimentalDifferentiation - StaticFoundation + ExperimentalFoundation } function Get-ProjectBinaryCache([Hashtable] $Platform, [Project] $Project) { @@ -2692,7 +2692,7 @@ function Build-Foundation { ) $FoundationBinaryCache = if ($Static) { - Get-ProjectBinaryCache $Platform StaticFoundation + Get-ProjectBinaryCache $Platform ExperimentalFoundation } else { Get-ProjectBinaryCache $Platform DynamicFoundation } From 6040648b9e8a2b0d763250e0955a372c915c09c5 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 22 Jul 2025 09:58:36 -0700 Subject: [PATCH 3/5] utils: specify linkage types for experimental SDK --- utils/build.ps1 | 62 ++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 50d1e823597cd..70f458ac85f60 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -707,15 +707,15 @@ enum Project { ClangBuiltins ClangRuntime SwiftInspect - ExperimentalRuntime - ExperimentalOverlay - ExperimentalStringProcessing - ExperimentalSynchronization - ExperimentalDistributed - ExperimentalObservation - ExperimentalDispatch - ExperimentalDifferentiation - ExperimentalFoundation + ExperimentalStaticRuntime + ExperimentalStaticOverlay + ExperimentalStaticStringProcessing + ExperimentalStaticSynchronization + ExperimentalStaticDistributed + ExperimentalStaticObservation + ExperimentalStaticDifferentiation + ExperimentalStaticDispatch + ExperimentalStaticFoundation } function Get-ProjectBinaryCache([Hashtable] $Platform, [Project] $Project) { @@ -2470,7 +2470,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Core ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalRuntime) ` + -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime) ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -2498,7 +2498,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Overlay ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalOverlay) ` + -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay) ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -2511,12 +2511,12 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalRuntime)\cmake\SwiftCore"; + SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\StringProcessing ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStringProcessing) ` + -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticStringProcessing) ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,Swift ` @@ -2529,12 +2529,12 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalRuntime)\cmake\SwiftCore"; + SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Synchronization ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalSynchronization) ` + -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticSynchronization) ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,Swift ` @@ -2547,13 +2547,13 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalRuntime)\cmake\SwiftCore"; - SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalOverlay)\cmake\SwiftOverlay"; + SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; + SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Distributed ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalDistributed) ` + -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticDistributed) ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -2561,19 +2561,19 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa -Defines @{ BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" }; CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES"; - CMAKE_CXX_FLAGS = @("-I$(Get-ProjectBinaryCache $Platform ExperimentalRuntime)\include"); + CMAKE_CXX_FLAGS = @("-I$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\include"); CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform); CMAKE_Swift_COMPILER_WORKS = "YES"; CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalRuntime)\cmake\SwiftCore"; - SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalOverlay)\cmake\SwiftOverlay"; + SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; + SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Observation ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalObservation) ` + -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticObservation) ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers CXX,Swift ` @@ -2581,19 +2581,19 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa -Defines @{ BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" }; CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES"; - CMAKE_CXX_FLAGS = @("-I$(Get-ProjectBinaryCache $Platform ExperimentalRuntime)\include"); + CMAKE_CXX_FLAGS = @("-I$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\include"); CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform); CMAKE_Swift_COMPILER_WORKS = "YES"; CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalRuntime)\cmake\SwiftCore"; - SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalOverlay)\cmake\SwiftOverlay"; + SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; + SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Differentiation ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalDifferentiation) ` + -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticDifferentiation) ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -2606,8 +2606,8 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalRuntime)\cmake\SwiftCore"; - SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalOverlay)\cmake\SwiftOverlay"; + SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; + SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay"; } } } @@ -2692,7 +2692,7 @@ function Build-Foundation { ) $FoundationBinaryCache = if ($Static) { - Get-ProjectBinaryCache $Platform ExperimentalFoundation + Get-ProjectBinaryCache $Platform ExperimentalStaticFoundation } else { Get-ProjectBinaryCache $Platform DynamicFoundation } @@ -2716,7 +2716,7 @@ function Build-Foundation { } $DispatchCMakeModules = if ($Static) { - Get-ProjectCMakeModules $Platform ExperimentalDispatch + Get-ProjectCMakeModules $Platform ExperimentalStaticDispatch } else { Get-ProjectCMakeModules $Platform Dispatch } @@ -2937,7 +2937,7 @@ function Build-ExperimentalSDK([Hashtable] $Platform) { $env:Path = "$(Get-CMarkBinaryCache $Platform)\src;$(Get-PinnedToolchainRuntime);${env:Path}" Build-CMakeProject ` -Src $SourceCache\swift-corelibs-libdispatch ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalDispatch) ` + -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticDispatch) ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` From 8335d82eef26fd61f70880b6194685008cb666f4 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 22 Jul 2025 10:05:35 -0700 Subject: [PATCH 4/5] utils: precompute binary cache locations --- utils/build.ps1 | 80 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 70f458ac85f60..56e2ff8860f78 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -2468,9 +2468,51 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Invoke-IsolatingEnvVars { $env:Path = "$(Get-CMarkBinaryCache $Platform)\src;$(Get-PinnedToolchainRuntime);${env:Path}" + $RuntimeBinaryCache = if ($Static) { + Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime + } else { + throw "dynamic Experimental Runtime is not yet implemented" + } + + $OverlayBinaryCache = if ($Static) { + Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay + } else { + throw "dynamic Experimental Runtime is not yet implemented" + } + + $StringProcessingBinaryCache = if ($Static) { + Get-ProjectBinarycache $Platform ExperimentalStaticStringProcessing + } else { + throw "dynamic Experimental Runtime is not yet implemented" + } + + $SynchronizationBinaryCache = if ($Static) { + Get-ProjectBinarycache $Platform ExperimentalStaticSynchronization + } else { + throw "dynamic Experimental Runtime is not yet implemented" + } + + $DistributedBinaryCache = if ($Static) { + Get-ProjectBinarycache $Platform ExperimentalStaticDistributed + } else { + throw "dynamic Experimental Runtime is not yet implemented" + } + + $ObservationBinaryCache = if ($Static) { + Get-ProjectBinarycache $Platform ExperimentalStaticObservation + } else { + throw "dynamic Experimental Runtime is not yet implemented" + } + + $DifferentiationBinaryCache = if ($Static) { + Get-ProjectBinarycache $Platform ExperimentalStaticDifferentiation + } else { + throw "dynamic Experimental Differentiation is not yet implemented" + } + Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Core ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime) ` + -Bin $RuntimeBinaryCache ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -2498,7 +2540,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Overlay ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay) ` + -Bin $OverlayBinaryCache ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -2511,12 +2553,12 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; + SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\StringProcessing ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticStringProcessing) ` + -Bin $StringProcessingBinaryCache ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,Swift ` @@ -2529,12 +2571,12 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; + SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Synchronization ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticSynchronization) ` + -Bin $SynchronizationBinaryCache ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,Swift ` @@ -2547,13 +2589,13 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; - SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay"; + SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore"; + SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Distributed ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticDistributed) ` + -Bin $DistributedBinaryCache ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -2561,19 +2603,19 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa -Defines @{ BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" }; CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES"; - CMAKE_CXX_FLAGS = @("-I$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\include"); + CMAKE_CXX_FLAGS = @("-I${RuntimeBinaryCache}\include"); CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform); CMAKE_Swift_COMPILER_WORKS = "YES"; CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; - SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay"; + SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore"; + SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Observation ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticObservation) ` + -Bin $ObservationBinaryCache ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers CXX,Swift ` @@ -2581,19 +2623,19 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa -Defines @{ BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" }; CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES"; - CMAKE_CXX_FLAGS = @("-I$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\include"); + CMAKE_CXX_FLAGS = @("-I${RuntimeBinaryCache}\include"); CMAKE_Swift_COMPILER_TARGET = (Get-ModuleTriple $Platform); CMAKE_Swift_COMPILER_WORKS = "YES"; CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; - SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay"; + SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore"; + SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay"; } Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Differentiation ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticDifferentiation) ` + -Bin $DifferentiationBinaryCache ` -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -2606,8 +2648,8 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; CMAKE_SYSTEM_NAME = $Platform.OS.ToString(); - SwiftCore_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime)\cmake\SwiftCore"; - SwiftOverlay_DIR = "$(Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay)\cmake\SwiftOverlay"; + SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore"; + SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay"; } } } From 95227f9bb0cdaade83ddb7e717c585180bf71153 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 29 Jul 2025 12:53:27 -0700 Subject: [PATCH 5/5] build.ps1: compute SDKROOT once in the experimental runtimes build This value is re-used. Compute it once and re-use the value to ease the future transition. --- utils/build.ps1 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 56e2ff8860f78..38f9308f7dd1c 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -2468,6 +2468,8 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Invoke-IsolatingEnvVars { $env:Path = "$(Get-CMarkBinaryCache $Platform)\src;$(Get-PinnedToolchainRuntime);${env:Path}" + $SDKRoot = Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental" + $RuntimeBinaryCache = if ($Static) { Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime } else { @@ -2513,7 +2515,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Core ` -Bin $RuntimeBinaryCache ` - -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` + -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` -UseGNUDriver ` @@ -2541,7 +2543,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Overlay ` -Bin $OverlayBinaryCache ` - -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` + -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` -UseGNUDriver ` @@ -2559,7 +2561,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\StringProcessing ` -Bin $StringProcessingBinaryCache ` - -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` + -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers C,Swift ` -UseGNUDriver ` @@ -2577,7 +2579,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Synchronization ` -Bin $SynchronizationBinaryCache ` - -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` + -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers C,Swift ` -UseGNUDriver ` @@ -2596,7 +2598,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Distributed ` -Bin $DistributedBinaryCache ` - -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` + -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` -UseGNUDriver ` @@ -2616,7 +2618,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Observation ` -Bin $ObservationBinaryCache ` - -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` + -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers CXX,Swift ` -UseGNUDriver ` @@ -2636,7 +2638,7 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Build-CMakeProject ` -Src $SourceCache\swift\Runtimes\Supplemental\Differentiation ` -Bin $DifferentiationBinaryCache ` - -InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" ` + -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` -UseGNUDriver `