@@ -1046,7 +1046,7 @@ function Get-Dependencies {
1046
1046
Write-Output " Extracting '$InstallerExeName ' ..."
1047
1047
1048
1048
# The new runtime MSI is built to expand files into the immediate directory. So, setup the installation location.
1049
- New-Item - ItemType Directory - ErrorAction Ignore $BinaryCache \toolchains\$PinnedToolchain \LocalApp\Programs\Swift\Runtimes\$ (Get-PinnedToolchainVersion )\usr\bin | Out-Null
1049
+ New-Item - ItemType Directory - ErrorAction Ignore $BinaryCache \toolchains\$ToolchainName \LocalApp\Programs\Swift\Runtimes\$ (Get-PinnedToolchainVersion )\usr\bin | Out-Null
1050
1050
Invoke-Program " $ ( $WiX.Path ) \wix.exe" -- burn extract $BinaryCache \$InstallerExeName - out $BinaryCache \toolchains\ - outba $BinaryCache \toolchains\
1051
1051
Get-ChildItem " $BinaryCache \toolchains\WixAttachedContainer" - Filter " *.msi" | ForEach-Object {
1052
1052
$LogFile = [System.IO.Path ]::ChangeExtension($_.Name , " log" )
@@ -1091,7 +1091,7 @@ function Get-Dependencies {
1091
1091
1092
1092
# TODO(compnerd) stamp/validate that we need to re-extract
1093
1093
New-Item - ItemType Directory - ErrorAction Ignore $BinaryCache \toolchains | Out-Null
1094
- Extract- Toolchain " $PinnedToolchain .exe" $BinaryCache $PinnedToolchain
1094
+ Extract- Toolchain " $PinnedToolchain .exe" $BinaryCache $PinnedToolchain.TrimStart ( " swift- " ).TrimEnd( " -a-windows10 " )
1095
1095
1096
1096
function Get-KnownPython ([string ] $ArchName ) {
1097
1097
if (-not $KnownPythons.ContainsKey ($PythonVersion )) {
@@ -1213,7 +1213,9 @@ function Get-Dependencies {
1213
1213
}
1214
1214
1215
1215
function Get-PinnedToolchainToolsDir () {
1216
- $ToolchainsRoot = [IO.Path ]::Combine(" $BinaryCache \toolchains" , " $PinnedToolchain " , " LocalApp" , " Programs" , " Swift" , " Toolchains" )
1216
+ $ToolchainName = $PinnedToolchain.TrimStart (" swift-" ).TrimEnd(" -a-windows10" )
1217
+
1218
+ $ToolchainsRoot = [IO.Path ]::Combine(" $BinaryCache \toolchains" , " $ToolchainName " , " LocalApp" , " Programs" , " Swift" , " Toolchains" )
1217
1219
1218
1220
# NOTE: Add a workaround for the main snapshots that inadvertently used the
1219
1221
# wrong version when they were built. This allows use of the nightly snapshot
@@ -1232,19 +1234,23 @@ function Get-PinnedToolchainToolsDir() {
1232
1234
return $VariantToolchainPath
1233
1235
}
1234
1236
1235
- return [IO.Path ]::Combine(" $BinaryCache \" , " toolchains" , $PinnedToolchain ,
1237
+ return [IO.Path ]::Combine(" $BinaryCache \" , " toolchains" , $ToolchainName ,
1236
1238
" Library" , " Developer" , " Toolchains" ,
1237
1239
" unknown-Asserts-development.xctoolchain" , " usr" , " bin" )
1238
1240
}
1239
1241
1240
- function Get-PinnedToolchainSDK () {
1241
- return [IO.Path ]::Combine(" $BinaryCache \" , " toolchains" , $PinnedToolchain ,
1242
+ function Get-PinnedToolchainSDK ([OS ] $OS = $BuildPlatform.OS , [string ] $Identifier = $OS.ToString ()) {
1243
+ $ToolchainName = $PinnedToolchain.TrimStart (" swift-" ).TrimEnd(" -a-windows10" )
1244
+
1245
+ return [IO.Path ]::Combine(" $BinaryCache \" , " toolchains" , $ToolchainName ,
1242
1246
" LocalApp" , " Programs" , " Swift" , " Platforms" , (Get-PinnedToolchainVersion ),
1243
- " Windows. platform" , " Developer" , " SDKs" , " Windows .sdk" )
1247
+ " $ ( $OS .ToString () ) . platform" , " Developer" , " SDKs" , " $Identifier .sdk" )
1244
1248
}
1245
1249
1246
1250
function Get-PinnedToolchainRuntime () {
1247
- return [IO.Path ]::Combine(" $BinaryCache \" , " toolchains" , $PinnedToolchain ,
1251
+ $ToolchainName = $PinnedToolchain.TrimStart (" swift-" ).TrimEnd(" -a-windows10" )
1252
+
1253
+ return [IO.Path ]::Combine(" $BinaryCache \" , " toolchains" , $ToolchainName ,
1248
1254
" LocalApp" , " Programs" , " Swift" , " Runtimes" , (Get-PinnedToolchainVersion ),
1249
1255
" usr" , " bin" )
1250
1256
}
0 commit comments