Skip to content

Commit 8dc0d32

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 15b4d43 commit 8dc0d32

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
@@ -238,7 +238,6 @@ $ArchX64 = @{
238238
LLVMTarget = "x86_64-unknown-windows-msvc";
239239
CMakeName = "AMD64";
240240
BinaryDir = "bin64";
241-
ExperimentalSDKInstallRoot = "$BinaryCache\x64\Windows.platform\Developer\SDKs\WindowsExperimental.sdk";
242241
XCTestInstallRoot = "$BinaryCache\x64\Windows.platform\Developer\Library\XCTest-development";
243242
SwiftTestingInstallRoot = "$BinaryCache\x64\Windows.platform\Developer\Library\Testing-development";
244243
ToolchainInstallRoot = "$BinaryCache\x64\toolchains\$ProductVersion+$Variant";
@@ -252,7 +251,6 @@ $ArchX86 = @{
252251
LLVMTarget = "i686-unknown-windows-msvc";
253252
CMakeName = "i686";
254253
BinaryDir = "bin32";
255-
ExperimentalSDKInstallRoot = "$BinaryCache\x86\Windows.platform\Developer\SDKs\WindowsExperimental.sdk";
256254
XCTestInstallRoot = "$BinaryCache\x86\Windows.platform\Developer\Library\XCTest-development";
257255
SwiftTestingInstallRoot = "$BinaryCache\x86\Windows.platform\Developer\Library\Testing-development";
258256
Cache = @{};
@@ -265,7 +263,6 @@ $ArchARM64 = @{
265263
LLVMTarget = "aarch64-unknown-windows-msvc";
266264
CMakeName = "ARM64";
267265
BinaryDir = "bin64a";
268-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Windows.platform\Developer\SDKs\WindowsExperimental.sdk";
269266
XCTestInstallRoot = "$BinaryCache\arm64\Windows.platform\Developer\Library\XCTest-development";
270267
ToolchainInstallRoot = "$BinaryCache\arm64\toolchains\$ProductVersion+$Variant";
271268
SwiftTestingInstallRoot = "$BinaryCache\arm64\Windows.platform\Developer\Library\Testing-development";
@@ -279,7 +276,6 @@ $AndroidARM64 = @{
279276
LLVMName = "aarch64";
280277
LLVMTarget = "aarch64-unknown-linux-android$AndroidAPILevel";
281278
ShortName = "arm64";
282-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\SDKs\AndroidExperimental.sdk";
283279
XCTestInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\Library\XCTest-development";
284280
SwiftTestingInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\Library\Testing-development";
285281
Cache = @{};
@@ -292,7 +288,6 @@ $AndroidARMv7 = @{
292288
LLVMName = "armv7";
293289
LLVMTarget = "armv7-unknown-linux-androideabi$AndroidAPILevel";
294290
ShortName = "armv7";
295-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\SDKs\AndroidExperimental.sdk";
296291
XCTestInstallRoot = "$BinaryCache\armv7\Android.platform\Developer\Library\XCTest-development";
297292
SwiftTestingInstallRoot = "$BinaryCache\armv7\Android.platform\Developer\Library\Testing-development";
298293
Cache = @{};
@@ -305,7 +300,6 @@ $AndroidX86 = @{
305300
LLVMName = "i686";
306301
LLVMTarget = "i686-unknown-linux-android$AndroidAPILevel";
307302
ShortName = "x86";
308-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\SDKs\AndroidExperimental.sdk";
309303
XCTestInstallRoot = "$BinaryCache\x86\Android.platform\Developer\Library\XCTest-development";
310304
SwiftTestingInstallRoot = "$BinaryCache\x86\Android.platform\Developer\Library\Testing-development";
311305
Cache = @{};
@@ -318,7 +312,6 @@ $AndroidX64 = @{
318312
LLVMName = "x86_64";
319313
LLVMTarget = "x86_64-unknown-linux-android$AndroidAPILevel";
320314
ShortName = "x64";
321-
ExperimentalSDKInstallRoot = "$BinaryCache\arm64\Android.platform\Developer\SDKs\AndroidExperimental.sdk";
322315
XCTestInstallRoot = "$BinaryCache\x64\Android.platform\Developer\Library\XCTest-development";
323316
SwiftTestingInstallRoot = "$BinaryCache\x64\Android.platform\Developer\Library\Testing-development";
324317
Cache = @{};
@@ -1020,9 +1013,9 @@ function Get-SwiftSDK {
10201013
(
10211014
[Parameter(Position = 0, Mandatory = $true)]
10221015
[Platform] $Platform,
1023-
[switch] $Experimental = $false
1016+
[string] $Identifier = $Platform.ToString()
10241017
)
1025-
return ([IO.Path]::Combine((Get-PlatformRoot $Platform), "Developer", "SDKs", "${Platform}.sdk"))
1018+
return ([IO.Path]::Combine((Get-PlatformRoot $Platform), "Developer", "SDKs", "${Identifier}.sdk"))
10261019
}
10271020

10281021
function Build-CMakeProject {
@@ -2157,7 +2150,7 @@ function Build-ExperimentalRuntime {
21572150
Build-CMakeProject `
21582151
-Src $SourceCache\swift\Runtimes\Core `
21592152
-Bin (Get-TargetProjectBinaryCache $Arch ExperimentalRuntime) `
2160-
-InstallTo "$($Arch.ExperimentalSDKInstallRoot)\usr" `
2153+
-InstallTo "$(Get-SwiftSDK $Platform -Identifier "${Platform}Experimental")\usr" `
21612154
-Arch $Arch `
21622155
-Platform $Platform `
21632156
-UseBuiltCompilers C,CXX,Swift `
@@ -2269,7 +2262,7 @@ function Build-Foundation {
22692262
Build-CMakeProject `
22702263
-Src $SourceCache\swift-corelibs-foundation `
22712264
-Bin $FoundationBinaryCache `
2272-
-InstallTo $(if ($Static) { "$($Arch.ExperimentalSDKInstallRoot)\usr" } else { "$(Get-SwiftSDK $Platform)\usr" }) `
2265+
-InstallTo $(if ($Static) { "$(Get-SwiftSDK $Platform -Identifier "${Platform}Experimental")\usr" } else { "$(Get-SwiftSDK $Platform)\usr" }) `
22732266
-Arch $Arch `
22742267
-Platform $Platform `
22752268
-UseBuiltCompilers ASM,C,CXX,Swift `

0 commit comments

Comments
 (0)