From 2592a0a983f78aa015b38aa179e14f420bf00964 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 13 Nov 2025 15:42:05 -0800 Subject: [PATCH] build: remove support for the legacy SDK Drop the support for the legacy build system for the runtime. This reduces the complexity in the build script as well as helps reduce the overall build times. --- utils/build.ps1 | 335 ++++++++++++------------------------------------ 1 file changed, 83 insertions(+), 252 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 1f9e5eb7687c4..8c28d47fb48f1 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -85,7 +85,7 @@ Default: 28 .PARAMETER AndroidSDKVersions An array of SDKs to build for the Android OS. -Default: @("Android", "AndroidExperimental") +Default: @("Android") .PARAMETER AndroidSDKArchitectures An array of architectures for which the Android Swift SDK should be built. @@ -101,7 +101,7 @@ If no such Windows SDK is installed, it will be downloaded from nuget. .PARAMETER WindowsSDKVersions An array of SDKs to build for the Windows OS. -Default: @("Windows", "WindowsExperimental") +Default: @("Windows") .PARAMETER WindowsSDKArchitectures An array of architectures for which the Windows Swift SDK should be built. @@ -195,7 +195,7 @@ param [string[]] $AndroidSDKArchitectures = @("aarch64", "armv7", "i686", "x86_64"), [ValidateSet("dynamic", "static")] [string[]] $AndroidSDKLinkModes = @("dynamic", "static"), - [string[]] $AndroidSDKVersions = @("Android", "AndroidExperimental"), + [string[]] $AndroidSDKVersions = @("Android"), [string] $AndroidSDKVersionDefault = "Android", # Windows SDK Options @@ -205,7 +205,7 @@ param [string[]] $WindowsSDKArchitectures = @("X64","X86","Arm64"), [ValidateSet("dynamic", "static")] [string[]] $WindowsSDKLinkModes = @("dynamic", "static"), - [string[]] $WindowsSDKVersions = @("Windows", "WindowsExperimental"), + [string[]] $WindowsSDKVersions = @("Windows"), [string] $WindowsSDKVersionDefault = "Windows", # Incremental Build Support @@ -889,35 +889,31 @@ enum Project { DocC brotli - LLVM - Runtime - Dispatch + ClangBuiltins + ClangRuntime + DynamicRuntime + DynamicOverlay + DynamicStringProcessing + DynamicSynchronization + DynamicDistributed + DynamicObservation + DynamicDispatch + DynamicDifferentiation + DynamicVolatile DynamicFoundation + StaticRuntime + StaticOverlay + StaticStringProcessing + StaticSynchronization + StaticDistributed + StaticObservation + StaticDifferentiation + StaticVolatile + StaticDispatch + StaticFoundation XCTest Testing - ClangBuiltins - ClangRuntime SwiftInspect - ExperimentalDynamicRuntime - ExperimentalDynamicOverlay - ExperimentalDynamicStringProcessing - ExperimentalDynamicSynchronization - ExperimentalDynamicDistributed - ExperimentalDynamicObservation - ExperimentalDynamicDispatch - ExperimentalDynamicDifferentiation - ExperimentalDynamicVolatile - ExperimentalDynamicFoundation - ExperimentalStaticRuntime - ExperimentalStaticOverlay - ExperimentalStaticStringProcessing - ExperimentalStaticSynchronization - ExperimentalStaticDistributed - ExperimentalStaticObservation - ExperimentalStaticDifferentiation - ExperimentalStaticVolatile - ExperimentalStaticDispatch - ExperimentalStaticFoundation } function Get-ProjectBinaryCache([Hashtable] $Platform, [Project] $Project) { @@ -1962,7 +1958,7 @@ function Build-CMakeProject { } if ($UseBuiltCompilers.Contains("Swift")) { - $env:Path = "$([IO.Path]::Combine((Get-InstallDir $BuildPlatform), "Runtimes", $ProductVersion, "usr", "bin"));$(Get-CMarkBinaryCache $BuildPlatform)\src;$($BuildPlatform.ToolchainInstallRoot)\usr\bin;$(Get-PinnedToolchainRuntime);${env:Path}" + $env:Path = "$($BuildPlatform.ToolchainInstallRoot)\usr\bin;$(Get-PinnedToolchainRuntime);${env:Path}" } elseif ($UsePinnedCompilers.Contains("Swift")) { $env:Path = "$(Get-PinnedToolchainRuntime);${env:Path}" } @@ -2371,21 +2367,23 @@ function Test-Compilers([Hashtable] $Platform, [string] $Variant, [switch] $Test # Override test filter for known issues in downstream LLDB Load-LitTestOverrides ([IO.Path]::GetFullPath([IO.Path]::Combine($PSScriptRoot, "..", "..", "llvm-project", "lldb", "test", "windows-swift-llvm-lit-test-overrides.txt"))) + $RuntimeBinaryCache = Get-ProjectBinaryCache $BuildPlatform DynamicRuntime + # Transitive dependency of _lldb.pyd - $RuntimeBinaryCache = Get-ProjectBinaryCache $BuildPlatform Runtime + Write-Host "Copying '$RuntimeBinaryCache\core\swiftCore.dll' to '$(Get-ProjectBinaryCache $BuildPlatform Compilers)\lib\site-packages\lldb'" Copy-Item ` - -Path $RuntimeBinaryCache\bin\swiftCore.dll ` + -Path $RuntimeBinaryCache\core\swiftCore.dll ` -Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\lib\site-packages\lldb" # Runtime dependencies of repl_swift.exe - $SwiftRTSubdir = "lib\swift\windows" - Write-Host "Copying '$RuntimeBinaryCache\$SwiftRTSubdir\$($Platform.Architecture.LLVMName)\swiftrt.obj' to '$(Get-ProjectBinaryCache $BuildPlatform Compilers)\$SwiftRTSubdir'" + Write-Host "Copying '$RuntimeBinaryCache\runtime\CMakeFiles\SwiftRT-COFF.cpp.obj' to '$(Get-ProjectBinaryCache $BuildPlatform Compilers)\lib\swift\windows'" Copy-Item ` - -Path "$RuntimeBinaryCache\$SwiftRTSubdir\$($Platform.Architecture.LLVMName)\swiftrt.obj" ` - -Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\$SwiftRTSubdir" - Write-Host "Copying '$RuntimeBinaryCache\bin\swiftCore.dll' to '$(Get-ProjectBinaryCache $BuildPlatform Compilers)\bin'" + -Path "$RuntimeBinaryCache\runtime\CMakeFiles\SwiftRT-COFF.cpp.obj" ` + -Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\lib\swift\windows" + + Write-Host "Copying '$RuntimeBinaryCache\core\swiftCore.dll' to '$(Get-ProjectBinaryCache $BuildPlatform Compilers)\bin'" Copy-Item ` - -Path "$RuntimeBinaryCache\bin\swiftCore.dll" ` + -Path "$RuntimeBinaryCache\core\swiftCore.dll" ` -Destination "$(Get-ProjectBinaryCache $BuildPlatform Compilers)\bin" $TestingDefines += @{ @@ -2397,7 +2395,7 @@ function Test-Compilers([Hashtable] $Platform, [string] $Variant, [switch] $Test # gtest sharding breaks llvm-lit's --xfail and LIT_XFAIL inputs: https://github.com/llvm/llvm-project/issues/102264 LLVM_LIT_ARGS = "-v --no-gtest-sharding --time-tests"; # LLDB Unit tests link against this library - LLVM_UNITTEST_LINK_FLAGS = "$(Get-SwiftSDK -OS Windows -Identifier Windows)\usr\lib\swift\windows\$($Platform.Architecture.LLVMName)\swiftCore.lib"; + LLVM_UNITTEST_LINK_FLAGS = "$(Get-PinnedToolchainSDK -OS $BuildPlatform.OS)\usr\lib\swift\$($BuildPlatform.OS.ToString().ToLowerInvariant())\$($Platform.Architecture.LLVMName)\swiftCore.lib"; } } @@ -2512,17 +2510,6 @@ function Patch-mimalloc() { } } -function Build-LLVM([Hashtable] $Platform) { - Build-CMakeProject ` - -Src $SourceCache\llvm-project\llvm ` - -Bin (Get-ProjectBinaryCache $Platform LLVM) ` - -Platform $Platform ` - -UseBuiltCompilers C,CXX ` - -Defines @{ - LLVM_HOST_TRIPLE = $Platform.Triple; - } -} - function Build-CompilerRuntime([Hashtable] $Platform) { $LLVMBinaryCache = $(Get-ProjectBinaryCache $HostPlatform Compilers) @@ -2763,50 +2750,11 @@ function Build-CURL([Hashtable] $Platform) { }) } -function Build-Runtime([Hashtable] $Platform) { - $PlatformDefines = @{} - if ($Platform.OS -eq [OS]::Android) { - $PlatformDefines += @{ - LLVM_ENABLE_LIBCXX = "YES"; - SWIFT_USE_LINKER = "lld"; - } - - if ((Get-AndroidNDK).ClangVersion -lt 18) { - $PlatformDefines += @{ - SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT = "YES"; - } - } - } - - Build-CMakeProject ` - -Src $SourceCache\swift ` - -Bin (Get-ProjectBinaryCache $Platform Runtime) ` - -InstallTo "$(Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK)\usr" ` - -Platform $Platform ` - -UseBuiltCompilers C,CXX,Swift ` - -SwiftSDK $null ` - -CacheScript $SourceCache\swift\cmake\caches\Runtime-$($Platform.OS.ToString())-$($Platform.Architecture.LLVMName).cmake ` - -Defines ($PlatformDefines + @{ - LLVM_DIR = "$(Get-ProjectBinaryCache $Platform LLVM)\lib\cmake\llvm"; - SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY = "YES"; - SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP = "YES"; - SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING = "YES"; - SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED = "YES"; - SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION = "YES"; - SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING = "YES"; - SWIFT_ENABLE_SYNCHRONIZATION = "YES"; - SWIFT_ENABLE_VOLATILE = "YES"; - SWIFT_NATIVE_SWIFT_TOOLS_PATH = ([IO.Path]::Combine((Get-ProjectBinaryCache $BuildPlatform Compilers), "bin")); - SWIFT_PATH_TO_LIBDISPATCH_SOURCE = "$SourceCache\swift-corelibs-libdispatch"; - SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = "$SourceCache\swift-experimental-string-processing"; - }) -} - function Test-Runtime([Hashtable] $Platform) { if ($IsCrossCompiling) { throw "Swift runtime tests are not supported when cross-compiling" } - if (-not (Test-Path (Get-ProjectBinaryCache $Platform Runtime))) { + if (-not (Test-Path (Get-ProjectBinaryCache $Platform DynamicRuntime))) { throw "Swift runtime tests are supposed to reconfigure the existing build" } $CompilersBinaryCache = Get-ProjectBinaryCache $BuildPlatform Compilers @@ -2821,7 +2769,7 @@ function Test-Runtime([Hashtable] $Platform) { $env:Path = "$(Get-CMarkBinaryCache $Platform)\src;$(Get-PinnedToolchainRuntime);${env:Path};$UnixToolsBinDir" Build-CMakeProject ` -Src $SourceCache\swift ` - -Bin (Get-ProjectBinaryCache $Platform Runtime) ` + -Bin (Get-ProjectBinaryCache $Platform DynamicRuntime) ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` -SwiftSDK $null ` @@ -2836,7 +2784,7 @@ function Test-Runtime([Hashtable] $Platform) { } } -function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $false) { +function Build-Runtime([Hashtable] $Platform, [switch] $Static = $false) { # TODO: remove this once the migration is completed. Invoke-IsolatingEnvVars { Invoke-VsDevShell $BuildPlatform @@ -2849,54 +2797,54 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa Invoke-IsolatingEnvVars { $env:Path = "$(Get-CMarkBinaryCache $Platform)\src;$(Get-PinnedToolchainRuntime);${env:Path}" - $SDKRoot = Get-SwiftSDK -OS $Platform.OS -Identifier "$($Platform.OS)Experimental" + $SDKRoot = Get-SwiftSDK -OS $Platform.OS $RuntimeBinaryCache = if ($Static) { - Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime + Get-ProjectBinaryCache $Platform StaticRuntime } else { - Get-ProjectBinaryCache $Platform ExperimentalDynamicRuntime + Get-ProjectBinaryCache $Platform DynamicRuntime } $OverlayBinaryCache = if ($Static) { - Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay + Get-ProjectBinaryCache $Platform StaticOverlay } else { - Get-ProjectBinarycache $Platform ExperimentalDynamicOverlay + Get-ProjectBinarycache $Platform DynamicOverlay } $StringProcessingBinaryCache = if ($Static) { - Get-ProjectBinarycache $Platform ExperimentalStaticStringProcessing + Get-ProjectBinarycache $Platform StaticStringProcessing } else { - Get-ProjectBinarycache $Platform ExperimentalDynamicStringProcessing + Get-ProjectBinarycache $Platform DynamicStringProcessing } $SynchronizationBinaryCache = if ($Static) { - Get-ProjectBinarycache $Platform ExperimentalStaticSynchronization + Get-ProjectBinarycache $Platform StaticSynchronization } else { - Get-ProjectBinarycache $Platform ExperimentalDynamicSynchronization + Get-ProjectBinarycache $Platform DynamicSynchronization } $DistributedBinaryCache = if ($Static) { - Get-ProjectBinarycache $Platform ExperimentalStaticDistributed + Get-ProjectBinarycache $Platform StaticDistributed } else { - Get-ProjectBinarycache $Platform ExperimentalDynamicDistributed + Get-ProjectBinarycache $Platform DynamicDistributed } $ObservationBinaryCache = if ($Static) { - Get-ProjectBinarycache $Platform ExperimentalStaticObservation + Get-ProjectBinarycache $Platform StaticObservation } else { - Get-ProjectBinaryCache $Platform ExperimentalDynamicObservation + Get-ProjectBinaryCache $Platform DynamicObservation } $DifferentiationBinaryCache = if ($Static) { - Get-ProjectBinarycache $Platform ExperimentalStaticDifferentiation + Get-ProjectBinarycache $Platform StaticDifferentiation } else { - Get-ProjectBinarycache $Platform ExperimentalDynamicDifferentiation + Get-ProjectBinarycache $Platform DynamicDifferentiation } $VolatileBinaryCache = if ($Static) { - Get-ProjectBinarycache $Platform ExperimentalStaticVolatile + Get-ProjectBinarycache $Platform StaticVolatile } else { - Get-ProjectBinaryCache $Platform ExperimentalDynamicVolatile + Get-ProjectBinaryCache $Platform DynamicVolatile } Build-CMakeProject ` @@ -3102,21 +3050,6 @@ function Write-SDKSettings([OS] $OS, [string] $Identifier = $OS.ToString()) { Write-PList -Settings $SDKSettings -Path "$(Get-SwiftSDK -OS $OS -Identifier $Identifier)\SDKSettings.plist" } -function Build-Dispatch([Hashtable] $Platform) { - $SwiftSDK = Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK - Build-CMakeProject ` - -Src $SourceCache\swift-corelibs-libdispatch ` - -Bin (Get-ProjectBinaryCache $Platform Dispatch) ` - -InstallTo "${SwiftSDK}\usr" ` - -Platform $Platform ` - -UseBuiltCompilers C,CXX,Swift ` - -SwiftSDK $SwiftSDK ` - -Defines @{ - ENABLE_SWIFT = "YES"; - dispatch_INSTALL_ARCH_SUBDIR = "YES"; - } -} - function Test-Dispatch { Invoke-IsolatingEnvVars { $env:CTEST_OUTPUT_ON_FAILURE = "YES" @@ -3134,48 +3067,6 @@ function Test-Dispatch { } } -function Build-Foundation([Hashtable] $Platform) { - $SwiftSDK = Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK - Build-CMakeProject ` - -Src $SourceCache\swift-corelibs-foundation ` - -Bin (Get-ProjectBinaryCache $Platform DynamicFoundation) ` - -InstallTo "${SwiftSDK}\usr" ` - -Platform $Platform ` - -UseBuiltCompilers C,CXX,Swift ` - -SwiftSDK $SwiftSDK ` - -Defines @{ - BUILD_SHARED_LIBS = "YES"; - # FIXME(compnerd) - workaround ARM64 build failure when cross-compiling. - CMAKE_NINJA_FORCE_RESPONSE_FILE = "YES"; - CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib"; - BROTLI_INCLUDE_DIR = "$SourceCache\brotli\c\include"; - BROTLICOMMON_LIBRARY = if ($Platform.OS -eq [OS]::Windows) { - "$(Get-ProjectBinaryCache $Platform brotli)\brotlicommon.lib" - } else { - "$(Get-ProjectBinaryCache $Platform brotli)\libbrotlicommon.a" - }; - BROTLIDEC_LIBRARY = if ($Platform.OS -eq [OS]::Windows) { - "$(Get-ProjectBinaryCache $Platform brotli)\brotlidec.lib" - } else { - "$(Get-ProjectBinaryCache $Platform brotli)\libbrotlidec.a" - } - FOUNDATION_BUILD_TOOLS = if ($Platform.OS -eq [OS]::Windows) { "YES" } else { "NO" }; - CURL_DIR = "$BinaryCache\$($Platform.Triple)\usr\lib\cmake\CURL"; - LibXml2_DIR = "$BinaryCache\$($Platform.Triple)\usr\lib\cmake\libxml2-2.11.5"; - ZLIB_LIBRARY = if ($Platform.OS -eq [OS]::Windows) { - "$BinaryCache\$($Platform.Triple)\usr\lib\zlibstatic.lib" - } else { - "$BinaryCache\$($Platform.Triple)\usr\lib\libz.a" - }; - ZLIB_INCLUDE_DIR = "$BinaryCache\$($Platform.Triple)\usr\include"; - dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch); - _SwiftFoundation_SourceDIR = "$SourceCache\swift-foundation"; - _SwiftFoundationICU_SourceDIR = "$SourceCache\swift-foundation-icu"; - _SwiftCollections_SourceDIR = "$SourceCache\swift-collections"; - SwiftFoundation_MACRO = "$(Get-ProjectBinaryCache $BuildPlatform BootstrapFoundationMacros)\bin" - } -} - function Test-Foundation { $ScratchPath = "$BinaryCache\$($BuildPlatform.Triple)\FoundationTests" @@ -3251,26 +3142,12 @@ function Build-XCTest([Hashtable] $Platform) { function Test-XCTest { Invoke-IsolatingEnvVars { - $SwiftRuntime = if ($BuildPlatform.DefaultSDK -match "Experimental") { - [IO.Path]::Combine((Get-InstallDir $BuildPlatform), "Runtimes", "$ProductVersion.experimental"); - } else { - [IO.Path]::Combine((Get-InstallDir $BuildPlatform), "Runtimes", "$ProductVersion"); - } - - $DispatchBinaryCache = if ($BuildPlatform.DefaultSDK -match "Experimental") { - Get-ProjectBinaryCache $BuildPlatform ExperimentalDynamicDispatch - } else { - Get-ProjectBinaryCache $BuildPlatform Dispatch - } - - $FoundationBinaryCache = if ($BuildPlatform.DefaultSDK -match "Experimental") { - Get-ProjectBinaryCache $BuildPlatform ExperimentalDynamicFoundation - } else { - Get-ProjectBinaryCache $BuildPlatform DynamicFoundation - } + $SwiftRuntime = [IO.Path]::Combine((Get-InstallDir $BuildPlatform), "Runtimes", "$ProductVersion"); + $DispatchBinaryCache = Get-ProjectBinaryCache $BuildPlatform DynamicDispatch + $FoundationBinaryCache = Get-ProjectBinaryCache $BuildPlatform DynamicFoundation $env:Path = "$(Get-ProjectBinaryCache $BuildPlatform XCTest);${FoundationBinaryCache}\bin;${DispatchBinaryCache};${SwiftRuntime}\usr\bin;${env:Path};$UnixToolsBinDir" - $env:SDKROOT = Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK + $env:SDKROOT = Get-SwiftSDK -OS $Platform.OS Build-CMakeProject ` -Src $SourceCache\swift-corelibs-xctest ` @@ -3359,32 +3236,22 @@ function Install-SDK([Hashtable[]] $Platforms, [OS] $OS = $Platforms[0].OS, [str } function Build-SDK([Hashtable] $Platform) { - # Third Party Dependencies - Invoke-BuildStep Build-LLVM $Platform - - # Libraries - Invoke-BuildStep Build-Runtime $Platform - Invoke-BuildStep Build-Dispatch $Platform - Invoke-BuildStep Build-Foundation $Platform -} - -function Build-ExperimentalSDK([Hashtable] $Platform) { Invoke-BuildStep Build-CDispatch $Platform if ($Platform.LinkModes.Contains("dynamic")) { - Invoke-BuildStep Build-ExperimentalRuntime $Platform + Invoke-BuildStep Build-Runtime $Platform } if ($Platform.LinkModes.Contains("static")) { - Invoke-BuildStep Build-ExperimentalRuntime $Platform -Static + Invoke-BuildStep Build-Runtime $Platform -Static } - $SDKROOT = Get-SwiftSDK -OS $Platform.OS -Identifier "$($Platform.OS)Experimental" + $SDKROOT = Get-SwiftSDK -OS $Platform.OS if ($Platform.LinkModes.Contains("dynamic")) { - Record-OperationTime $Platform "Build-ExperimentalDynamicDispatch" { + Record-OperationTime $Platform "Build-DynamicDispatch" { Build-CMakeProject ` -Src $SourceCache\swift-corelibs-libdispatch ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalDynamicDispatch) ` + -Bin (Get-ProjectBinaryCache $Platform DynamicDispatch) ` -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -3398,10 +3265,10 @@ function Build-ExperimentalSDK([Hashtable] $Platform) { } } - Record-OperationTime $Platform "Build-ExperimentalDynamicFoundation" { + Record-OperationTime $Platform "Build-DynamicFoundation" { Build-CMakeProject ` -Src $SourceCache\swift-corelibs-foundation ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalDynamicFoundation) ` + -Bin (Get-ProjectBinaryCache $Platform DynamicFoundation) ` -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers ASM,C,CXX,Swift ` @@ -3422,7 +3289,7 @@ function Build-ExperimentalSDK([Hashtable] $Platform) { } else { "$BinaryCache\$($Platform.Triple)\usr\lib\libz.a" }; - dispatch_DIR = $(Get-ProjectCMakeModules $Platform ExperimentalDynamicDispatch); + dispatch_DIR = $(Get-ProjectCMakeModules $Platform DynamicDispatch); SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers); _SwiftFoundation_SourceDIR = "$SourceCache\swift-foundation"; _SwiftFoundationICU_SourceDIR = "$SourceCache\swift-foundation-icu"; @@ -3433,10 +3300,10 @@ function Build-ExperimentalSDK([Hashtable] $Platform) { } if ($Platform.LinkModes.Contains("static")) { - Record-OperationTime $Platform "Build-ExperimentalStaticDispatch" { + Record-OperationTime $Platform "Build-StaticDispatch" { Build-CMakeProject ` -Src $SourceCache\swift-corelibs-libdispatch ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticDispatch) ` + -Bin (Get-ProjectBinaryCache $Platform StaticDispatch) ` -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers C,CXX,Swift ` @@ -3450,10 +3317,10 @@ function Build-ExperimentalSDK([Hashtable] $Platform) { } } - Record-OperationTime $Platform "Build-ExperimentalStaticFoundation" { + Record-OperationTime $Platform "Build-StaticFoundation" { Build-CMakeProject ` -Src $SourceCache\swift-corelibs-foundation ` - -Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticFoundation) ` + -Bin (Get-ProjectBinaryCache $Platform StaticFoundation) ` -InstallTo "${SDKROOT}\usr" ` -Platform $Platform ` -UseBuiltCompilers ASM,C,CXX,Swift ` @@ -3475,7 +3342,7 @@ function Build-ExperimentalSDK([Hashtable] $Platform) { } else { "$BinaryCache\$($Platform.Triple)\usr\lib\libz.a" }; - dispatch_DIR = $(Get-ProjectCMakeModules $Platform ExperimentalStaticDispatch); + dispatch_DIR = $(Get-ProjectCMakeModules $Platform StaticDispatch); SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers); _SwiftFoundation_SourceDIR = "$SourceCache\swift-foundation"; _SwiftFoundationICU_SourceDIR = "$SourceCache\swift-foundation-icu"; @@ -4138,7 +4005,6 @@ function Build-Installer([Hashtable] $Platform) { $Properties = @{ BundleFlavor = "offline"; ImageRoot = "$(Get-InstallDir $Platform)\"; - IncludeLegacySDK = if ($HostPlatform.DefaultSDK -match "Experimental") { "False" } else { "True" }; INCLUDE_SWIFT_DOCC = $INCLUDE_SWIFT_DOCC; SWIFT_DOCC_BUILD = "$(Get-ProjectBinaryCache $HostPlatform DocC)\release"; SWIFT_DOCC_RENDER_ARTIFACT_ROOT = "${SourceCache}\swift-docc-render-artifact"; @@ -4165,7 +4031,6 @@ function Build-Installer([Hashtable] $Platform) { $Properties["ToolchainVariants"] = "`"asserts$(if ($IncludeNoAsserts) { ";noasserts" })`""; foreach ($Build in $WindowsSDKBuilds) { $Properties["WindowsRuntime$($Build.Architecture.ShortName.ToUpperInvariant())"] = [IO.Path]::Combine((Get-InstallDir $Build), "Runtimes", "$ProductVersion"); - $Properties["WindowsExperimentalRuntime$($Build.Architecture.ShortName.ToUpperInvariant())"] = [IO.Path]::Combine((Get-InstallDir $Build), "Runtimes", "$ProductVersion.experimental"); } Build-WiXProject bundle\installer.wixproj -Platform $Platform -Bundle -Properties $Properties @@ -4308,7 +4173,7 @@ if (-not $SkipBuild) { foreach ($SDK in $WindowsSDKVersions) { switch ($SDK) { Windows { - $SDKROOT = Get-SwiftSDK -OS Windows -Identifier Windows + $SDKROOT = Get-SwiftSDK -OS Windows foreach ($Build in $WindowsSDKBuilds) { Invoke-BuildStep Build-SDK $Build @@ -4317,35 +4182,16 @@ if (-not $SkipBuild) { Move-Item $_.FullName "${SDKROOT}\usr\lib\swift\windows\$($Build.Architecture.LLVMName)\" | Out-Null } - # FIXME(compnerd) how do we select which SDK is meant to be re-distributed? - Copy-Directory "${SDKROOT}\usr\bin" "$([IO.Path]::Combine((Get-InstallDir $Build), "Runtimes", $ProductVersion, "usr"))" - } - - Install-SDK $WindowsSDKBuilds - Write-SDKSettings Windows - } - - WindowsExperimental { - $SDKROOT = Get-SwiftSDK -OS Windows -Identifier WindowsExperimental - foreach ($Build in $WindowsSDKBuilds) { - Invoke-BuildStep Build-ExperimentalSDK $Build - - Get-ChildItem "${SDKROOT}\usr\lib\swift\windows" -Filter "*.lib" -File -ErrorAction Ignore | ForEach-Object { - Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory" - Move-Item $_.FullName "${SDKROOT}\usr\lib\swift\windows\$($Build.Architecture.LLVMName)\" | Out-Null - } - Get-ChildItem "${SDKROOT}\usr\lib\swift_static\windows" -Filter "*.lib" -File -ErrorAction Ignore | ForEach-Object { Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory" Move-Item $_.FullName "${SDKROOT}\usr\lib\swift_static\windows\$($Build.Architecture.LLVMName)\" | Out-Null } - # FIXME(compnerd) how do we select which SDK is meant to be re-distributed? - Copy-Directory "${SDKROOT}\usr\bin" "$([IO.Path]::Combine((Get-InstallDir $Build), "Runtimes", "$ProductVersion.experimental", "usr"))" + Copy-Directory "${SDKROOT}\usr\bin" "$([IO.Path]::Combine((Get-InstallDir $Build), "Runtimes", "$ProductVersion", "usr"))" } - Install-SDK $WindowsSDKBuilds -Identifier WindowsExperimental - Write-SDKSettings Windows -Identifier WindowsExperimental + Install-SDK $WindowsSDKBuilds -Identifier Windows + Write-SDKSettings Windows -Identifier Windows } } } @@ -4363,7 +4209,7 @@ if (-not $SkipBuild) { foreach ($Build in $WindowsSDKBuilds) { if (-not $Build.LinkModes.Contains("static")) { continue } - $SDKROOT = Get-SwiftSDK -OS $Build.OS -Identifier "$($Build.OS)Experimental" + $SDKROOT = Get-SwiftSDK -OS $Build.OS $SwiftResourceDir = "${SDKROOT}\usr\lib\swift_static\$($Build.OS.ToString().ToLowerInvariant())\$($Build.Architecture.LLVMName)" Copy-Item -Force -Path "$(Get-ProjectBinaryCache $Build brotli)\brotlicommon.lib" -Destination "${SwiftResourceDir}\brotlicommon.lib" | Out-Null Copy-Item -Force -Path "$(Get-ProjectBinaryCache $Build brotli)\brotlidec.lib" -Destination "${SwiftResourceDir}\brotlidec.lib" | Out-Null @@ -4388,7 +4234,7 @@ if (-not $SkipBuild) { foreach ($SDK in $AndroidSDKVersions) { switch ($SDK) { Android { - $SDKROOT = Get-SwiftSDK -OS Android -Identifier Android + $SDKROOT = Get-SwiftSDK Android foreach ($Build in $AndroidSDKBuilds) { Invoke-BuildStep Build-SDK $Build @@ -4396,21 +4242,6 @@ if (-not $SkipBuild) { Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory" Move-Item $_.FullName "${SDKROOT}\usr\lib\swift\android\$($Build.Architecture.LLVMName)\" | Out-Null } - } - - Install-SDK $AndroidSDKBuilds - Write-SDKSettings Android - } - - AndroidExperimental { - $SDKROOT = Get-SwiftSDK Android -Identifier AndroidExperimental - foreach ($Build in $AndroidSDKBuilds) { - Invoke-BuildStep Build-ExperimentalSDK $Build - - Get-ChildItem "${SDKROOT}\usr\lib\swift\android" -File | Where-Object { $_.Name -match ".a$|.so$" } | ForEach-Object { - Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory" - Move-Item $_.FullName "${SDKROOT}\usr\lib\swift\android\$($Build.Architecture.LLVMName)\" | Out-Null - } Get-ChildItem "${SDKROOT}\usr\lib\swift_static\android" -File | Where-Object { $_.Name -match ".a$|.so$" } | ForEach-Object { Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory" @@ -4418,8 +4249,8 @@ if (-not $SkipBuild) { } } - Install-SDK $AndroidSDKBuilds -Identifiers AndroidExperimental - Write-SDKSettings Android -Identifier AndroidExperimental + Install-SDK $AndroidSDKBuilds -Identifiers Android + Write-SDKSettings Android -Identifier Android } } } @@ -4440,7 +4271,7 @@ if (-not $SkipBuild) { foreach ($Build in $AndroidSDKBuilds) { if (-not $Build.LinkModes.Contains("static")) { continue } - $SDKROOT = Get-SwiftSDK -OS $Build.OS -Identifier "$($Build.OS)Experimental" + $SDKROOT = Get-SwiftSDK -OS $Build.OS $SwiftResourceDir = "${SDKROOT}\usr\lib\swift_static\$($Build.OS.ToString().ToLowerInvariant())\$($Build.Architecture.LLVMName)" Copy-Item -Force -Path "$(Get-ProjectBinaryCache $Build brotli)\libbrotlicommon.a" -Destination "${SwiftResourceDir}\libbrotlicommon.a" | Out-Null Copy-Item -Force -Path "$(Get-ProjectBinaryCache $Build brotli)\libbrotlidec.a" -Destination "${SwiftResourceDir}\libbrotlidec.a" | Out-Null