@@ -736,7 +736,6 @@ function Fetch-Dependencies {
736
736
Expand-Archive - Path $source - DestinationPath $destination - Force
737
737
}
738
738
739
-
740
739
function Extract-Toolchain {
741
740
param
742
741
(
@@ -766,7 +765,7 @@ function Fetch-Dependencies {
766
765
Get-ChildItem " $BinaryCache \toolchains\WixAttachedContainer" - Filter " *.msi" | ForEach-Object {
767
766
$LogFile = [System.IO.Path ]::ChangeExtension($_.Name , " log" )
768
767
$TARGETDIR = if ($_.Name -eq " rtl.msi" ) { " $BinaryCache \toolchains\$ToolchainName \LocalApp\Programs\Swift\Runtimes\$ ( Get-PinnedToolchainVersion ) \usr\bin" } else { " $BinaryCache \toolchains\$ToolchainName " }
769
- Invoke-Program - OutNull msiexec.exe / lvx! $BinaryCache \toolchains\$LogFile / qn / a $BinaryCache \toolchains\WixAttachedContainer\$ ($_.Name ) ALLUSERS= 0 TARGETDIR= $TARGETDIR
768
+ Invoke-Program - OutNull msiexec.exe / lvx! $BinaryCache \toolchains\$LogFile / qn / a $BinaryCache \toolchains\WixAttachedContainer\$ ($_.Name ) ALLUSERS= 0 TARGETDIR= $TARGETDIR
770
769
}
771
770
}
772
771
@@ -933,7 +932,17 @@ function Fetch-Dependencies {
933
932
}
934
933
}
935
934
936
- function Get-PinnedToolchainTool () {
935
+ function Get-PinnedToolchainToolsDir () {
936
+ # NOTE: add a workaround for the main snapshots that used the wrong version
937
+ # when building that was not noticed. This allows use of the nightly snapshot
938
+ # as a pinned toolchain.
939
+ if ((Get-PinnedToolchainVersion ) -eq " 0.0.0" ) {
940
+ if (-not (Test-Path " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Toolchains\0.0.0+Asserts\usr\bin" )) {
941
+ if (Test-Path " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin" ) {
942
+ return " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Toolchains\6.0.0+Asserts\usr\bin"
943
+ }
944
+ }
945
+ }
937
946
if (Test-Path " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Toolchains\$ ( Get-PinnedToolchainVersion ) +Asserts\usr\bin" ) {
938
947
return " $BinaryCache \toolchains\${PinnedToolchain} \LocalApp\Programs\Swift\Toolchains\$ ( Get-PinnedToolchainVersion ) +Asserts\usr\bin"
939
948
}
@@ -1156,7 +1165,7 @@ function Build-CMakeProject {
1156
1165
if ($UseBuiltCompilers.Contains (" ASM" )) {
1157
1166
TryAdd- KeyValue $Defines CMAKE_ASM_COMPILER ([IO.Path ]::Combine($CompilersBinaryCache , " bin" , $Driver ))
1158
1167
} else {
1159
- TryAdd- KeyValue $Defines CMAKE_ASM_COMPILER (Join-Path - Path (Get-PinnedToolchainTool ) - ChildPath $Driver )
1168
+ TryAdd- KeyValue $Defines CMAKE_ASM_COMPILER (Join-Path - Path (Get-PinnedToolchainToolsDir ) - ChildPath $Driver )
1160
1169
}
1161
1170
Append- FlagsDefine $Defines CMAKE_ASM_FLAGS " --target=$ ( $Arch.LLVMTarget ) "
1162
1171
if ($Platform -eq " Windows" ) {
@@ -1168,7 +1177,7 @@ function Build-CMakeProject {
1168
1177
if ($UseBuiltCompilers.Contains (" C" )) {
1169
1178
TryAdd- KeyValue $Defines CMAKE_C_COMPILER ([IO.Path ]::Combine($CompilersBinaryCache , " bin" , $Driver ))
1170
1179
} else {
1171
- TryAdd- KeyValue $Defines CMAKE_C_COMPILER (Join-Path - Path (Get-PinnedToolchainTool ) - ChildPath $Driver )
1180
+ TryAdd- KeyValue $Defines CMAKE_C_COMPILER (Join-Path - Path (Get-PinnedToolchainToolsDir ) - ChildPath $Driver )
1172
1181
}
1173
1182
TryAdd- KeyValue $Defines CMAKE_C_COMPILER_TARGET $Arch.LLVMTarget
1174
1183
@@ -1182,7 +1191,7 @@ function Build-CMakeProject {
1182
1191
if ($UseBuiltCompilers.Contains (" CXX" )) {
1183
1192
TryAdd- KeyValue $Defines CMAKE_CXX_COMPILER ([IO.Path ]::Combine($CompilersBinaryCache , " bin" , $Driver ))
1184
1193
} else {
1185
- TryAdd- KeyValue $Defines CMAKE_CXX_COMPILER (Join-Path - Path (Get-PinnedToolchainTool ) - ChildPath $Driver )
1194
+ TryAdd- KeyValue $Defines CMAKE_CXX_COMPILER (Join-Path - Path (Get-PinnedToolchainToolsDir ) - ChildPath $Driver )
1186
1195
}
1187
1196
TryAdd- KeyValue $Defines CMAKE_CXX_COMPILER_TARGET $Arch.LLVMTarget
1188
1197
@@ -1199,7 +1208,7 @@ function Build-CMakeProject {
1199
1208
} elseif ($UseBuiltCompilers.Contains (" Swift" )) {
1200
1209
TryAdd- KeyValue $Defines CMAKE_Swift_COMPILER ([IO.Path ]::Combine($CompilersBinaryCache , " bin" , " swiftc.exe" ))
1201
1210
} else {
1202
- TryAdd- KeyValue $Defines CMAKE_Swift_COMPILER (Join-Path - Path (Get-PinnedToolchainTool ) - ChildPath " swiftc.exe" )
1211
+ TryAdd- KeyValue $Defines CMAKE_Swift_COMPILER (Join-Path - Path (Get-PinnedToolchainToolsDir ) - ChildPath " swiftc.exe" )
1203
1212
}
1204
1213
if (-not ($Platform -eq " Windows" )) {
1205
1214
TryAdd- KeyValue $Defines CMAKE_Swift_COMPILER_WORKS = " YES"
@@ -1680,7 +1689,7 @@ function Build-Compilers() {
1680
1689
Python3_LIBRARY = " $PythonRoot \libs\$PythonLibName .lib" ;
1681
1690
Python3_ROOT_DIR = $PythonRoot ;
1682
1691
SWIFT_BUILD_SWIFT_SYNTAX = " YES" ;
1683
- SWIFT_CLANG_LOCATION = (Get-PinnedToolchainTool );
1692
+ SWIFT_CLANG_LOCATION = (Get-PinnedToolchainToolsDir );
1684
1693
SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY = " YES" ;
1685
1694
SWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP = " YES" ;
1686
1695
SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING = " YES" ;
0 commit comments