Skip to content

Commit 21cfabf

Browse files
committed
utils: avoid double staging the experimental SDK
Install the experimental SDK directly into the final install/stage so that we have a complete working toolchain that we can directly package.
1 parent 9d5d87c commit 21cfabf

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

utils/build.ps1

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ $ArchX64 = @{
241241
LLVMTarget = "x86_64-unknown-windows-msvc";
242242
CMakeName = "AMD64";
243243
BinaryDir = "bin64";
244-
ExperimentalSDKInstallRoot = "$BinaryCache\x64\Windows.platform\Developer\SDKs\WindowsExperimental.sdk";
245244
XCTestInstallRoot = "$BinaryCache\x64\Windows.platform\Developer\Library\XCTest-development";
246245
SwiftTestingInstallRoot = "$BinaryCache\x64\Windows.platform\Developer\Library\Testing-development";
247246
ToolchainInstallRoot = "$BinaryCache\x64\toolchains\$ProductVersion+$Variant";
@@ -255,7 +254,6 @@ $ArchX86 = @{
255254
LLVMTarget = "i686-unknown-windows-msvc";
256255
CMakeName = "i686";
257256
BinaryDir = "bin32";
258-
ExperimentalSDKInstallRoot = "$BinaryCache\x86\Windows.platform\Developer\SDKs\WindowsExperimental.sdk";
259257
XCTestInstallRoot = "$BinaryCache\x86\Windows.platform\Developer\Library\XCTest-development";
260258
SwiftTestingInstallRoot = "$BinaryCache\x86\Windows.platform\Developer\Library\Testing-development";
261259
Cache = @{};
@@ -268,7 +266,6 @@ $ArchARM64 = @{
268266
LLVMTarget = "aarch64-unknown-windows-msvc";
269267
CMakeName = "ARM64";
270268
BinaryDir = "bin64a";
271-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Windows.platform\Developer\SDKs\WindowsExperimental.sdk";
272269
XCTestInstallRoot = "$BinaryCache\arm64\Windows.platform\Developer\Library\XCTest-development";
273270
ToolchainInstallRoot = "$BinaryCache\arm64\toolchains\$ProductVersion+$Variant";
274271
SwiftTestingInstallRoot = "$BinaryCache\arm64\Windows.platform\Developer\Library\Testing-development";
@@ -282,7 +279,6 @@ $AndroidARM64 = @{
282279
LLVMName = "aarch64";
283280
LLVMTarget = "aarch64-unknown-linux-android$AndroidAPILevel";
284281
ShortName = "arm64";
285-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\SDKs\AndroidExperimental.sdk";
286282
XCTestInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\Library\XCTest-development";
287283
SwiftTestingInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\Library\Testing-development";
288284
Cache = @{};
@@ -295,7 +291,6 @@ $AndroidARMv7 = @{
295291
LLVMName = "armv7";
296292
LLVMTarget = "armv7-unknown-linux-androideabi$AndroidAPILevel";
297293
ShortName = "armv7";
298-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\SDKs\AndroidExperimental.sdk";
299294
XCTestInstallRoot = "$BinaryCache\armv7\Android.platform\Developer\Library\XCTest-development";
300295
SwiftTestingInstallRoot = "$BinaryCache\armv7\Android.platform\Developer\Library\Testing-development";
301296
Cache = @{};
@@ -308,7 +303,6 @@ $AndroidX86 = @{
308303
LLVMName = "i686";
309304
LLVMTarget = "i686-unknown-linux-android$AndroidAPILevel";
310305
ShortName = "x86";
311-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\SDKs\AndroidExperimental.sdk";
312306
XCTestInstallRoot = "$BinaryCache\x86\Android.platform\Developer\Library\XCTest-development";
313307
SwiftTestingInstallRoot = "$BinaryCache\x86\Android.platform\Developer\Library\Testing-development";
314308
Cache = @{};
@@ -321,7 +315,6 @@ $AndroidX64 = @{
321315
LLVMName = "x86_64";
322316
LLVMTarget = "x86_64-unknown-linux-android$AndroidAPILevel";
323317
ShortName = "x64";
324-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\SDKs\AndroidExperimental.sdk";
325318
XCTestInstallRoot = "$BinaryCache\x64\Android.platform\Developer\Library\XCTest-development";
326319
SwiftTestingInstallRoot = "$BinaryCache\x64\Android.platform\Developer\Library\Testing-development";
327320
Cache = @{};
@@ -1024,9 +1017,9 @@ function Get-SwiftSDK {
10241017
(
10251018
[Parameter(Position = 0, Mandatory = $true)]
10261019
[Platform] $Platform,
1027-
[switch] $Experimental = $false
1020+
[string] $Identifier = $Platform.ToString()
10281021
)
1029-
return ([IO.Path]::Combine((Get-PlatformRoot $Platform), "Developer", "SDKs", "${Platform}.sdk"))
1022+
return ([IO.Path]::Combine((Get-PlatformRoot $Platform), "Developer", "SDKs", "${Identifier}.sdk"))
10301023
}
10311024

10321025
function Build-CMakeProject {
@@ -2153,7 +2146,7 @@ function Build-ExperimentalRuntime {
21532146
Build-CMakeProject `
21542147
-Src $SourceCache\swift\Runtimes\Core `
21552148
-Bin (Get-TargetProjectBinaryCache $Arch ExperimentalRuntime) `
2156-
-InstallTo "$($Arch.ExperimentalSDKInstallRoot)\usr" `
2149+
-InstallTo "$(Get-SwiftSDK $Platform -Identifier "${Platform}Experimental")\usr" `
21572150
-Arch $Arch `
21582151
-Platform $Platform `
21592152
-UseBuiltCompilers C,CXX,Swift `
@@ -2265,7 +2258,7 @@ function Build-Foundation {
22652258
Build-CMakeProject `
22662259
-Src $SourceCache\swift-corelibs-foundation `
22672260
-Bin $FoundationBinaryCache `
2268-
-InstallTo $(if ($Static) { "$($Arch.ExperimentalSDKInstallRoot)\usr" } else { "$(Get-SwiftSDK $Platform)\usr" }) `
2261+
-InstallTo $(if ($Static) { "$(Get-SwiftSDK $Platform -Identifier "${Platform}Experimental")\usr" } else { "$(Get-SwiftSDK $Platform)\usr" }) `
22692262
-Arch $Arch `
22702263
-Platform $Platform `
22712264
-UseBuiltCompilers ASM,C,CXX,Swift `

0 commit comments

Comments
 (0)