Skip to content
Closed
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
137 changes: 11 additions & 126 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -779,16 +779,6 @@ enum Project {
ClangBuiltins
ClangRuntime
SwiftInspect
ExperimentalDynamicRuntime
ExperimentalDynamicOverlay
ExperimentalDynamicStringProcessing
ExperimentalDynamicSynchronization
ExperimentalDynamicDistributed
ExperimentalDynamicObservation
ExperimentalDynamicDispatch
ExperimentalDynamicDifferentiation
ExperimentalDynamicVolatile
ExperimentalDynamicFoundation
ExperimentalStaticRuntime
ExperimentalStaticOverlay
ExperimentalStaticStringProcessing
Expand Down Expand Up @@ -2581,49 +2571,49 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
$RuntimeBinaryCache = if ($Static) {
Get-ProjectBinaryCache $Platform ExperimentalStaticRuntime
} else {
Get-ProjectBinaryCache $Platform ExperimentalDynamicRuntime
throw "dynamic Experimental Runtime is not yet implemented"
}

$OverlayBinaryCache = if ($Static) {
Get-ProjectBinaryCache $Platform ExperimentalStaticOverlay
} else {
Get-ProjectBinarycache $Platform ExperimentalDynamicOverlay
throw "dynamic Experimental Runtime is not yet implemented"
}

$StringProcessingBinaryCache = if ($Static) {
Get-ProjectBinarycache $Platform ExperimentalStaticStringProcessing
} else {
Get-ProjectBinarycache $Platform ExperimentalDynamicStringProcessing
throw "dynamic Experimental Runtime is not yet implemented"
}

$SynchronizationBinaryCache = if ($Static) {
Get-ProjectBinarycache $Platform ExperimentalStaticSynchronization
} else {
Get-ProjectBinarycache $Platform ExperimentalDynamicSynchronization
throw "dynamic Experimental Runtime is not yet implemented"
}

$DistributedBinaryCache = if ($Static) {
Get-ProjectBinarycache $Platform ExperimentalStaticDistributed
} else {
Get-ProjectBinarycache $Platform ExperimentalDynamicDistributed
throw "dynamic Experimental Runtime is not yet implemented"
}

$ObservationBinaryCache = if ($Static) {
Get-ProjectBinarycache $Platform ExperimentalStaticObservation
} else {
Get-ProjectBinaryCache $Platform ExperimentalDynamicObservation
throw "dynamic Experimental Runtime is not yet implemented"
}

$DifferentiationBinaryCache = if ($Static) {
Get-ProjectBinarycache $Platform ExperimentalStaticDifferentiation
} else {
Get-ProjectBinarycache $Platform ExperimentalDynamicDifferentiation
throw "dynamic Experimental Differentiation is not yet implemented"
}

$VolatileBinaryCache = if ($Static) {
Get-ProjectBinarycache $Platform ExperimentalStaticVolatile
} else {
Get-ProjectBinaryCache $Platform ExperimentalDynamicVolatile
throw "dynamic Experimental Volatile is not yet implemented"
}

Build-CMakeProject `
Expand All @@ -2644,9 +2634,6 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
SwiftCore_ENABLE_CONCURRENCY = "YES";
# FIXME(compnerd) remove this once the default option is flipped to `ON`.
SwiftCore_ENABLE_REMOTE_MIRROR = "YES";
# FIXME(compnerd) this currently causes a build failure on Windows, but
# this should be enabled when building the dynamic runtime.
SwiftCore_ENABLE_LIBRARY_EVOLUTION = "NO";
}

Build-CMakeProject `
Expand All @@ -2663,9 +2650,6 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa

SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";

# FIXME(compnerd) this currently causes a build failure on Windows, but
# this should be enabled when building the dynamic runtime.
SwiftOverlay_ENABLE_LIBRARY_EVOLUTION = "NO";
SwiftOverlay_ENABLE_CXX_INTEROP = "YES";
}

Expand All @@ -2682,9 +2666,6 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";

SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
# FIXME(compnerd) this currently causes a build failure on Windows, but
# this should be enabled when building the dynamic runtime.
SwiftStringProcessing_ENABLE_LIBRARY_EVOLUTION = "NO";
}

Build-CMakeProject `
Expand All @@ -2701,9 +2682,6 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa

SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";
# FIXME(compnerd) this currently causes a build failure on Windows, but
# this should be enabled when building the dynamic runtime.
SwiftSynchronization_ENABLE_LIBRARY_EVOLUTION = "NO";
}

Build-CMakeProject `
Expand All @@ -2722,9 +2700,6 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa

SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";
# FIXME(compnerd) this currently causes a build failure on Windows, but
# this should be enabled when building the dynamic runtime.
SwiftDistributed_ENABLE_LIBRARY_EVOLUTION = "NO";
}

Build-CMakeProject `
Expand All @@ -2743,9 +2718,6 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa

SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";
# FIXME(compnerd) this currently causes a build failure on Windows, but
# this should be enabled when building the dynamic runtime.
SwiftObservation_ENABLE_LIBRARY_EVOLUTION = "NO";
}

Build-CMakeProject `
Expand All @@ -2762,9 +2734,6 @@ function Build-ExperimentalRuntime([Hashtable] $Platform, [switch] $Static = $fa

SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";
# FIXME(compnerd) this currently causes a build failure on Windows, but
# this should be enabled when building the dynamic runtime.
SwiftDifferentiation_ENABLE_LIBRARY_EVOLUTION = "NO";
}

Build-CMakeProject `
Expand Down Expand Up @@ -3112,27 +3081,12 @@ function Build-SDK([Hashtable] $Platform, [switch] $IncludeMacros = $false) {
function Build-ExperimentalSDK([Hashtable] $Platform) {
Invoke-BuildStep Build-CDispatch $Platform

Invoke-BuildStep Build-ExperimentalRuntime $Platform
# TODO(compnerd) we currently build the experimental SDK with just the static
# variant. We should aim to build both dynamic and static variants.
Invoke-BuildStep Build-ExperimentalRuntime $Platform -Static

Invoke-IsolatingEnvVars {
$env:Path = "$(Get-CMarkBinaryCache $Platform)\src;$(Get-PinnedToolchainRuntime);${env:Path}"

Build-CMakeProject `
-Src $SourceCache\swift-corelibs-libdispatch `
-Bin (Get-ProjectBinaryCache $Platform ExperimentalDynamicDispatch) `
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
-Platform $Platform `
-UseBuiltCompilers C,CXX,Swift `
-SwiftSDK (Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental") `
-Defines @{
BUILD_SHARED_LIBS = "YES";
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";

ENABLE_SWIFT = "YES";
}

Build-CMakeProject `
-Src $SourceCache\swift-corelibs-libdispatch `
-Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticDispatch) `
Expand All @@ -3149,66 +3103,7 @@ function Build-ExperimentalSDK([Hashtable] $Platform) {
}
}

Build-CMakeProject `
-Src $SourceCache\swift-corelibs-foundation `
-Bin (Get-ProjectBinaryCache $Platform ExperimentalDynamicFoundation) `
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
-Platform $Platform `
-UseBuiltCompilers ASM,C,CXX,Swift `
-SwiftSDK (Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental") `
-Defines @{
BUILD_SHARED_LIBS = "YES";
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
ENABLE_TESTING = "NO";

FOUNDATION_BUILD_TOOLS = "NO";
CURL_DIR = "$BinaryCache\$($Platform.Triple)\usr\lib\cmake\CURL";
LibXml2_DIR = "$BinaryCache\$($Platform.Triple)\usr\lib\cmake\libxml2-2.11.5";
ZLIB_INCLUDE_DIR = "$BinaryCache\$($Platform.Triple)\usr\include";
ZLIB_LIBRARY = if ($Platform.OS -eq [OS]::Windows) {
"$BinaryCache\$($Platform.Triple)\usr\lib\zlibstatic.lib"
} else {
"$BinaryCache\$($Platform.Triple)\usr\lib\libz.a"
};
dispatch_DIR = $(Get-ProjectCMakeModules $Platform ExperimentalDynamicDispatch);
SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers);
_SwiftFoundation_SourceDIR = "$SourceCache\swift-foundation";
_SwiftFoundationICU_SourceDIR = "$SourceCache\swift-foundation-icu";
_SwiftCollections_SourceDIR = "$SourceCache\swift-collections";
SwiftFoundation_MACRO = "$(Get-ProjectBinaryCache $BuildPlatform FoundationMacros)\bin"
}

Build-CMakeProject `
-Src $SourceCache\swift-corelibs-foundation `
-Bin (Get-ProjectBinaryCache $Platform ExperimentalStaticFoundation) `
-InstallTo "$(Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental")\usr" `
-Platform $Platform `
-UseBuiltCompilers ASM,C,CXX,Swift `
-SwiftSDK (Get-SwiftSDK $Platform.OS -Identifier "$($Platform.OS)Experimental") `
-Defines @{
BUILD_SHARED_LIBS = "NO";
CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
CMAKE_Swift_FLAGS = @("-static-stdlib", "-Xfrontend", "-use-static-resource-dir");
CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";
ENABLE_TESTING = "NO";

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_INCLUDE_DIR = "$BinaryCache\$($Platform.Triple)\usr\include";
ZLIB_LIBRARY = if ($Platform.OS -eq [OS]::Windows) {
"$BinaryCache\$($Platform.Triple)\usr\lib\zlibstatic.lib"
} else {
"$BinaryCache\$($Platform.Triple)\usr\lib\libz.a"
};
dispatch_DIR = $(Get-ProjectCMakeModules $Platform ExperimentalStaticDispatch);
SwiftSyntax_DIR = (Get-ProjectBinaryCache $HostPlatform Compilers);
_SwiftFoundation_SourceDIR = "$SourceCache\swift-foundation";
_SwiftFoundationICU_SourceDIR = "$SourceCache\swift-foundation-icu";
_SwiftCollections_SourceDIR = "$SourceCache\swift-collections";
SwiftFoundation_MACRO = "$(Get-ProjectBinaryCache $BuildPlatform FoundationMacros)\bin"
}
Invoke-BuildStep Build-Foundation $Platform -Static
}

function Build-SQLite([Hashtable] $Platform) {
Expand Down Expand Up @@ -3926,11 +3821,6 @@ if (-not $SkipBuild) {
foreach ($Build in $WindowsSDKBuilds) {
Invoke-BuildStep Build-ExperimentalSDK $Build

Get-ChildItem "$(Get-SwiftSDK Windows -Identifier WindowsExperimental)\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 "$(Get-SwiftSDK Windows -Identifier WindowsExperimental)\usr\lib\swift\windows\$($Build.Architecture.LLVMName)\" | Out-Null
}

Get-ChildItem "$(Get-SwiftSDK Windows -Identifier WindowsExperimental)\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 "$(Get-SwiftSDK Windows -Identifier WindowsExperimental)\usr\lib\swift_static\windows\$($Build.Architecture.LLVMName)\" | Out-Null
Expand Down Expand Up @@ -3966,11 +3856,6 @@ if (-not $SkipBuild) {
foreach ($Build in $AndroidSDKBuilds) {
Invoke-BuildStep Build-ExperimentalSDK $Build

Get-ChildItem "$(Get-SwiftSDK Android -Identifier AndroidExperimental)\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 "$(Get-SwiftSDK Android -Identifier AndroidExperimental)\usr\lib\swift\android\$($Build.Architecture.LLVMName)\" | Out-Null
}

Get-ChildItem "$(Get-SwiftSDK Android -Identifier AndroidExperimental)\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"
Move-Item $_.FullName "$(Get-SwiftSDK Android -Identifier AndroidExperimental)\usr\lib\swift_static\android\$($Build.Architecture.LLVMName)\" | Out-Null
Expand Down