@@ -179,7 +179,7 @@ if ($Env:VSCMD_ARG_HOST_ARCH -or $Env:VSCMD_ARG_TGT_ARCH) {
179
179
}
180
180
181
181
# Prevent elsewhere-installed swift modules from confusing our builds.
182
- $env : SDKROOT = " "
182
+ $Env : SDKROOT = " "
183
183
184
184
$BuildArchName = if ($Env: PROCESSOR_ARCHITEW6432 ) { $Env: PROCESSOR_ARCHITEW6432 } else { $Env: PROCESSOR_ARCHITECTURE }
185
185
@@ -201,15 +201,15 @@ if ($PinnedBuild -eq "") {
201
201
202
202
$CustomWinSDKRoot = $null # Overwritten if we download a Windows SDK from nuget
203
203
204
- $vswhere = " ${env : ProgramFiles(x86)} \Microsoft Visual Studio\Installer\vswhere.exe"
204
+ $vswhere = " ${Env : ProgramFiles(x86)} \Microsoft Visual Studio\Installer\vswhere.exe"
205
205
$VSInstallRoot = & $vswhere - nologo - latest - products " *" - all - prerelease - property installationPath
206
206
$msbuild = " $VSInstallRoot \MSBuild\Current\Bin\$BuildArchName \MSBuild.exe"
207
207
208
208
# Hoist to global scope as this is used in two sites.
209
209
$WiXVersion = " 4.0.6"
210
210
211
- # Avoid $env :ProgramFiles in case this script is running as x86
212
- $UnixToolsBinDir = " $env : SystemDrive \Program Files\Git\usr\bin"
211
+ # Avoid $Env :ProgramFiles in case this script is running as x86
212
+ $UnixToolsBinDir = " $Env : SystemDrive \Program Files\Git\usr\bin"
213
213
214
214
if ($Android -and ($AndroidSDKs.Length -eq 0 )) {
215
215
# Enable all android SDKs by default.
@@ -519,7 +519,7 @@ function Get-TargetInfo($Arch) {
519
519
$CacheKey = " TargetInfo"
520
520
if (-not $Arch.Cache.ContainsKey ($CacheKey )) {
521
521
Isolate- EnvVars {
522
- $env : Path = " $ ( Get-PinnedToolchainRuntime ) ;$ ( Get-PinnedToolchainToolsDir ) ;${env : Path} "
522
+ $Env : Path = " $ ( Get-PinnedToolchainRuntime ) ;$ ( Get-PinnedToolchainToolsDir ) ;${Env : Path} "
523
523
$TargetInfo = & swiftc - target $Arch.LLVMTarget - print- target- info
524
524
if ($LastExitCode -ne 0 ) {
525
525
throw " Unable to print target info for '$ ( $Arch.LLVMTarget ) '"
@@ -674,19 +674,19 @@ function Invoke-VsDevShell($Arch) {
674
674
$WinSDKIncludePath = " $WinSDKVerIncludeRoot \ucrt;$WinSDKVerIncludeRoot \um;$WinSDKVerIncludeRoot \shared;$WinSDKVerIncludeRoot \winrt;$WinSDKVerIncludeRoot \cppwinrt"
675
675
$WinSDKVerLibRoot = " $CustomWinSDKRoot \lib\$WinSDKVersion "
676
676
677
- $env : WindowsLibPath = " $CustomWinSDKRoot \UnionMetadata\$WinSDKVersion ;$CustomWinSDKRoot \References\$WinSDKVersion "
678
- $env : WindowsSdkBinPath = " $CustomWinSDKRoot \bin"
679
- $env : WindowsSDKLibVersion = " $WinSDKVersion \"
680
- $env : WindowsSdkVerBinPath = " $CustomWinSDKRoot \bin\$WinSDKVersion "
681
- $env : WindowsSDKVersion = " $WinSDKVersion \"
677
+ $Env : WindowsLibPath = " $CustomWinSDKRoot \UnionMetadata\$WinSDKVersion ;$CustomWinSDKRoot \References\$WinSDKVersion "
678
+ $Env : WindowsSdkBinPath = " $CustomWinSDKRoot \bin"
679
+ $Env : WindowsSDKLibVersion = " $WinSDKVersion \"
680
+ $Env : WindowsSdkVerBinPath = " $CustomWinSDKRoot \bin\$WinSDKVersion "
681
+ $Env : WindowsSDKVersion = " $WinSDKVersion \"
682
682
683
- $env : EXTERNAL_INCLUDE += " ;$WinSDKIncludePath "
684
- $env : INCLUDE += " ;$WinSDKIncludePath "
685
- $env : LIB += " ;$WinSDKVerLibRoot \ucrt\$ ( $Arch.ShortName ) ;$WinSDKVerLibRoot \um\$ ( $Arch.ShortName ) "
686
- $env : LIBPATH += " ;$env : WindowsLibPath "
687
- $env : PATH += " ;$env : WindowsSdkVerBinPath \$ ( $Arch.ShortName ) ;$env : WindowsSdkBinPath \$ ( $Arch.ShortName ) "
688
- $env : UCRTVersion = $WinSDKVersion
689
- $env : UniversalCRTSdkDir = $CustomWinSDKRoot
683
+ $Env : EXTERNAL_INCLUDE += " ;$WinSDKIncludePath "
684
+ $Env : INCLUDE += " ;$WinSDKIncludePath "
685
+ $Env : LIB += " ;$WinSDKVerLibRoot \ucrt\$ ( $Arch.ShortName ) ;$WinSDKVerLibRoot \um\$ ( $Arch.ShortName ) "
686
+ $Env : LIBPATH += " ;$Env : WindowsLibPath "
687
+ $Env : PATH += " ;$Env : WindowsSdkVerBinPath \$ ( $Arch.ShortName ) ;$Env : WindowsSdkBinPath \$ ( $Arch.ShortName ) "
688
+ $Env : UCRTVersion = $WinSDKVersion
689
+ $Env : UniversalCRTSdkDir = $CustomWinSDKRoot
690
690
}
691
691
}
692
692
}
@@ -1066,15 +1066,15 @@ function Build-CMakeProject {
1066
1066
$DriverBinaryCache = Get-HostProjectBinaryCache Driver
1067
1067
1068
1068
if ($EnableCaching ) {
1069
- $env : SCCACHE_DIRECT = " true"
1069
+ $Env : SCCACHE_DIRECT = " true"
1070
1070
if ($Cache -eq " " ) {
1071
- $env : SCCACHE_DIR = " $BinaryCache \sccache"
1071
+ $Env : SCCACHE_DIR = " $BinaryCache \sccache"
1072
1072
} else {
1073
- $env : SCCACHE_DIR = $Cache
1073
+ $Env : SCCACHE_DIR = $Cache
1074
1074
}
1075
1075
}
1076
1076
if ($UseSwiftSwiftDriver ) {
1077
- $env : SWIFT_DRIVER_SWIFT_FRONTEND_EXEC = ([IO.Path ]::Combine($CompilersBinaryCache , " bin" , " swift-frontend.exe" ))
1077
+ $Env : SWIFT_DRIVER_SWIFT_FRONTEND_EXEC = ([IO.Path ]::Combine($CompilersBinaryCache , " bin" , " swift-frontend.exe" ))
1078
1078
}
1079
1079
1080
1080
# TODO(compnerd) workaround swiftc.exe symlink not existing.
@@ -1094,13 +1094,13 @@ function Build-CMakeProject {
1094
1094
# Set generic android options if we need to build an Android runtime component
1095
1095
# while building the compiler. Use an environment variable to pass it, to
1096
1096
# ensure that it can be accessed from the cmake cache file.
1097
- $env : NDKPATH = Get-AndroidNDKPath
1097
+ $Env : NDKPATH = Get-AndroidNDKPath
1098
1098
}
1099
1099
if ($Platform -eq " Android" ) {
1100
- $vswhere = " ${env : ProgramFiles(x86)} \Microsoft Visual Studio\Installer\vswhere.exe"
1100
+ $vswhere = " ${Env : ProgramFiles(x86)} \Microsoft Visual Studio\Installer\vswhere.exe"
1101
1101
$VSInstallPath = & $vswhere - nologo - latest - products * - property installationPath
1102
1102
if (Test-Path " ${VSInstallPath} \Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin" ) {
1103
- $env : Path = " ${VSInstallPath} \Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;${VSInstallPath} \Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;${env : Path} "
1103
+ $Env : Path = " ${VSInstallPath} \Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;${VSInstallPath} \Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;${Env : Path} "
1104
1104
TryAdd- KeyValue $Defines CMAKE_MAKE_PROGRAM " ${VSInstallPath} \Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
1105
1105
} else {
1106
1106
throw " Missing CMake and Ninja in the visual studio installation that are needed to build Android"
@@ -1340,9 +1340,9 @@ function Build-CMakeProject {
1340
1340
}
1341
1341
1342
1342
if ($UseBuiltCompilers.Contains (" Swift" )) {
1343
- $env : Path = " $ ( $BuildArch.SDKInstallRoot ) \usr\bin;$ ( Get-CMarkBinaryCache $BuildArch ) \src;$ ( $BuildArch.ToolchainInstallRoot ) \usr\bin;$ ( Get-PinnedToolchainRuntime ) ;${env : Path} "
1343
+ $Env : Path = " $ ( $BuildArch.SDKInstallRoot ) \usr\bin;$ ( Get-CMarkBinaryCache $BuildArch ) \src;$ ( $BuildArch.ToolchainInstallRoot ) \usr\bin;$ ( Get-PinnedToolchainRuntime ) ;${Env : Path} "
1344
1344
} elseif ($UsePinnedCompilers.Contains (" Swift" )) {
1345
- $env : Path = " $ ( Get-PinnedToolchainRuntime ) ;${env : Path} "
1345
+ $Env : Path = " $ ( Get-PinnedToolchainRuntime ) ;${Env : Path} "
1346
1346
}
1347
1347
1348
1348
if ($ToBatch ) {
@@ -1421,9 +1421,9 @@ function Build-SPMProject {
1421
1421
$SDKInstallRoot = (Get-SwiftSDK Windows)
1422
1422
$RuntimeInstallRoot = [IO.Path ]::Combine((Get-InstallDir $HostArch ), " Runtimes" , $ProductVersion )
1423
1423
1424
- $env : Path = " $RuntimeInstallRoot \usr\bin;$ ( $HostArch.ToolchainInstallRoot ) \usr\bin;${env : Path} "
1425
- $env : SDKROOT = $SDKInstallRoot
1426
- $env : SWIFTCI_USE_LOCAL_DEPS = 1
1424
+ $Env : Path = " $RuntimeInstallRoot \usr\bin;$ ( $HostArch.ToolchainInstallRoot ) \usr\bin;${Env : Path} "
1425
+ $Env : SDKROOT = $SDKInstallRoot
1426
+ $Env : SWIFTCI_USE_LOCAL_DEPS = 1
1427
1427
1428
1428
$Arguments = @ (
1429
1429
" --scratch-path" , $Bin ,
@@ -1611,7 +1611,7 @@ function Build-Compilers() {
1611
1611
$BuildTools = Join-Path - Path (Get-BuildProjectBinaryCache BuildTools) - ChildPath bin
1612
1612
1613
1613
if ($TestClang -or $TestLLD -or $TestLLDB -or $TestLLVM -or $TestSwift ) {
1614
- $env : Path = " $ ( Get-CMarkBinaryCache $Arch ) \src;$CompilersBinaryCache \tools\swift\libdispatch-windows-$ ( $Arch.LLVMName ) -prefix\bin;$CompilersBinaryCache \bin;$env : Path ;$VSInstallRoot \DIA SDK\bin\$ ( $HostArch.VSName ) ;$UnixToolsBinDir "
1614
+ $Env : Path = " $ ( Get-CMarkBinaryCache $Arch ) \src;$CompilersBinaryCache \tools\swift\libdispatch-windows-$ ( $Arch.LLVMName ) -prefix\bin;$CompilersBinaryCache \bin;$Env : Path ;$VSInstallRoot \DIA SDK\bin\$ ( $HostArch.VSName ) ;$UnixToolsBinDir "
1615
1615
$Targets = @ ()
1616
1616
$TestingDefines = @ {
1617
1617
SWIFT_BUILD_DYNAMIC_SDK_OVERLAY = " YES" ;
@@ -1638,8 +1638,8 @@ function Build-Compilers() {
1638
1638
# Override some test results with llvm-lit.
1639
1639
$TestsToXFail = Select-LitTestOverrides " xfail"
1640
1640
$TestsToSkip = Select-LitTestOverrides " skip"
1641
- $env : LIT_XFAIL = $TestsToXFail -join " ;"
1642
- $env : LIT_FILTER_OUT = " ($ ( $TestsToSkip -join ' |' ) )"
1641
+ $Env : LIT_XFAIL = $TestsToXFail -join " ;"
1642
+ $Env : LIT_FILTER_OUT = " ($ ( $TestsToSkip -join ' |' ) )"
1643
1643
1644
1644
# Transitive dependency of _lldb.pyd
1645
1645
$RuntimeBinaryCache = Get-TargetProjectBinaryCache $Arch Runtime
@@ -1771,7 +1771,7 @@ function Build-mimalloc() {
1771
1771
Isolate- EnvVars {
1772
1772
Invoke-VsDevShell $Arch
1773
1773
# Avoid hard-coding the VC tools version number
1774
- $VCRedistDir = (Get-ChildItem " ${env : VCToolsRedistDir} \$ ( $HostArch.ShortName ) " - Filter " Microsoft.VC*.CRT" ).FullName
1774
+ $VCRedistDir = (Get-ChildItem " ${Env : VCToolsRedistDir} \$ ( $HostArch.ShortName ) " - Filter " Microsoft.VC*.CRT" ).FullName
1775
1775
if ($VCRedistDir ) {
1776
1776
TryAdd- KeyValue $Properties VCRedistDir " $VCRedistDir \"
1777
1777
}
@@ -2091,7 +2091,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
2091
2091
}
2092
2092
2093
2093
Isolate- EnvVars {
2094
- $env : Path = " $ ( Get-CMarkBinaryCache $Arch ) \src;$ ( Get-PinnedToolchainRuntime ) ;${env : Path} "
2094
+ $Env : Path = " $ ( Get-CMarkBinaryCache $Arch ) \src;$ ( Get-PinnedToolchainRuntime ) ;${Env : Path} "
2095
2095
2096
2096
$CompilersBinaryCache = if ($IsCrossCompiling ) {
2097
2097
Get-BuildProjectBinaryCache Compilers
@@ -2149,7 +2149,7 @@ function Build-ExperimentalRuntime {
2149
2149
}
2150
2150
2151
2151
Isolate- EnvVars {
2152
- $env : Path = " $ ( Get-CMarkBinaryCache $Arch ) \src;$ ( Get-PinnedToolchainRuntime ) ;${env : Path} "
2152
+ $Env : Path = " $ ( Get-CMarkBinaryCache $Arch ) \src;$ ( Get-PinnedToolchainRuntime ) ;${Env : Path} "
2153
2153
2154
2154
Build-CMakeProject `
2155
2155
- Src $SourceCache \swift\Runtimes\Core `
@@ -2200,7 +2200,7 @@ function Build-Dispatch([Platform]$Platform, $Arch, [switch]$Test = $false) {
2200
2200
if ($Test ) {
2201
2201
$Targets = @ (" default" , " ExperimentalTest" )
2202
2202
$InstallPath = " "
2203
- $env : CTEST_OUTPUT_ON_FAILURE = " YES"
2203
+ $Env : CTEST_OUTPUT_ON_FAILURE = " YES"
2204
2204
} else {
2205
2205
$Targets = @ (" install" )
2206
2206
$InstallPath = " $ ( $Arch.SDKInstallRoot ) \usr"
@@ -2242,12 +2242,12 @@ function Build-Foundation {
2242
2242
2243
2243
$ShortArch = $Arch.LLVMName
2244
2244
Isolate- EnvVars {
2245
- $env : DISPATCH_INCLUDE_PATH = " $ ( $Arch.SDKInstallRoot ) /usr/lib/swift"
2246
- $env : LIBXML_LIBRARY_PATH = " $LibraryRoot /libxml2-2.11.5/usr/lib/$Platform /$ShortArch "
2247
- $env : LIBXML_INCLUDE_PATH = " $LibraryRoot /libxml2-2.11.5/usr/include/libxml2"
2248
- $env : ZLIB_LIBRARY_PATH = " $LibraryRoot /zlib-1.3.1/usr/lib/$Platform /$ShortArch "
2249
- $env : CURL_LIBRARY_PATH = " $LibraryRoot /curl-8.9.1/usr/lib/$Platform /$ShortArch "
2250
- $env : CURL_INCLUDE_PATH = " $LibraryRoot /curl-8.9.1/usr/include"
2245
+ $Env : DISPATCH_INCLUDE_PATH = " $ ( $Arch.SDKInstallRoot ) /usr/lib/swift"
2246
+ $Env : LIBXML_LIBRARY_PATH = " $LibraryRoot /libxml2-2.11.5/usr/lib/$Platform /$ShortArch "
2247
+ $Env : LIBXML_INCLUDE_PATH = " $LibraryRoot /libxml2-2.11.5/usr/include/libxml2"
2248
+ $Env : ZLIB_LIBRARY_PATH = " $LibraryRoot /zlib-1.3.1/usr/lib/$Platform /$ShortArch "
2249
+ $Env : CURL_LIBRARY_PATH = " $LibraryRoot /curl-8.9.1/usr/lib/$Platform /$ShortArch "
2250
+ $Env : CURL_INCLUDE_PATH = " $LibraryRoot /curl-8.9.1/usr/include"
2251
2251
Build-SPMProject `
2252
2252
- Action Test `
2253
2253
- Src $SourceCache \swift- corelibs- foundation `
@@ -2371,7 +2371,7 @@ function Build-XCTest([Platform]$Platform, $Arch) {
2371
2371
2372
2372
function Test-XCTest {
2373
2373
Isolate- EnvVars {
2374
- $env : Path = " $ ( Get-TargetProjectBinaryCache $BuildArch XCTest) ;$ ( Get-TargetProjectBinaryCache $BuildArch DynamicFoundation) \bin;$ ( Get-TargetProjectBinaryCache $BuildArch Dispatch) ;$ ( Get-TargetProjectBinaryCache $BuildArch Runtime) \bin;${env : Path} ;$UnixToolsBinDir "
2374
+ $Env : Path = " $ ( Get-TargetProjectBinaryCache $BuildArch XCTest) ;$ ( Get-TargetProjectBinaryCache $BuildArch DynamicFoundation) \bin;$ ( Get-TargetProjectBinaryCache $BuildArch Dispatch) ;$ ( Get-TargetProjectBinaryCache $BuildArch Runtime) \bin;${Env : Path} ;$UnixToolsBinDir "
2375
2375
2376
2376
Build-CMakeProject `
2377
2377
- Src $SourceCache \swift- corelibs- xctest `
@@ -2597,9 +2597,9 @@ function Build-LLBuild($Arch, [switch]$Test = $false) {
2597
2597
FILECHECK_EXECUTABLE = ([IO.Path ]::Combine((Get-BuildProjectBinaryCache BuildTools), " bin" , " FileCheck.exe" ));
2598
2598
LIT_EXECUTABLE = " $SourceCache \llvm-project\llvm\utils\lit\lit.py" ;
2599
2599
}
2600
- $env : Path = " $env : Path ;$UnixToolsBinDir "
2601
- $env : AR = ([IO.Path ]::Combine((Get-HostProjectBinaryCache Compilers), " bin" , " llvm-ar.exe" ))
2602
- $env : CLANG = ([IO.Path ]::Combine((Get-HostProjectBinaryCache Compilers), " bin" , " clang.exe" ))
2600
+ $Env : Path = " $Env : Path ;$UnixToolsBinDir "
2601
+ $Env : AR = ([IO.Path ]::Combine((Get-HostProjectBinaryCache Compilers), " bin" , " llvm-ar.exe" ))
2602
+ $Env : CLANG = ([IO.Path ]::Combine((Get-HostProjectBinaryCache Compilers), " bin" , " clang.exe" ))
2603
2603
$InstallPath = " "
2604
2604
} else {
2605
2605
$Targets = @ ()
@@ -2822,7 +2822,7 @@ function Test-Format {
2822
2822
)
2823
2823
2824
2824
Isolate- EnvVars {
2825
- $env : SWIFTFORMAT_BUILD_ONLY_TESTS = 1
2825
+ $Env : SWIFTFORMAT_BUILD_ONLY_TESTS = 1
2826
2826
# Testing swift-format is faster in serial mode than in parallel mode, probably because parallel test execution
2827
2827
# launches a process for every test class and the process launching overhead on Windows is greater than any
2828
2828
# gains from parallel test execution.
@@ -2951,17 +2951,17 @@ function Test-SourceKitLSP {
2951
2951
)
2952
2952
2953
2953
Isolate- EnvVars {
2954
- $env : SOURCEKIT_LSP_BUILD_ONLY_TESTS = 1
2954
+ $Env : SOURCEKIT_LSP_BUILD_ONLY_TESTS = 1
2955
2955
2956
2956
# CI doesn't contain any sensitive information. Log everything.
2957
- $env : SOURCEKIT_LSP_LOG_PRIVACY_LEVEL = " sensitive"
2957
+ $Env : SOURCEKIT_LSP_LOG_PRIVACY_LEVEL = " sensitive"
2958
2958
2959
2959
# Log with the highest log level to simplify debugging of CI failures.
2960
- $env : SOURCEKIT_LSP_LOG_LEVEL = " debug"
2960
+ $Env : SOURCEKIT_LSP_LOG_LEVEL = " debug"
2961
2961
2962
2962
# The Windows build doesn't build the SourceKit plugins into the SwiftPM build directory (it builds them using CMake).
2963
2963
# Tell the tests where to find the just-built plugins.
2964
- $env : SOURCEKIT_LSP_TEST_PLUGIN_PATHS = " $ ( $HostArch.ToolchainInstallRoot ) \usr\lib"
2964
+ $Env : SOURCEKIT_LSP_TEST_PLUGIN_PATHS = " $ ( $HostArch.ToolchainInstallRoot ) \usr\lib"
2965
2965
2966
2966
Build-SPMProject `
2967
2967
- Action TestParallel `
@@ -3121,7 +3121,7 @@ function Build-Installer($Arch) {
3121
3121
Isolate- EnvVars {
3122
3122
Invoke-VsDevShell $Arch
3123
3123
# Avoid hard-coding the VC tools version number
3124
- $VCRedistDir = (Get-ChildItem " ${env : VCToolsRedistDir} \$ ( $HostArch.ShortName ) " - Filter " Microsoft.VC*.CRT" ).FullName
3124
+ $VCRedistDir = (Get-ChildItem " ${Env : VCToolsRedistDir} \$ ( $HostArch.ShortName ) " - Filter " Microsoft.VC*.CRT" ).FullName
3125
3125
if ($VCRedistDir ) {
3126
3126
$Properties [" VCRedistDir" ] = " $VCRedistDir \"
3127
3127
}
0 commit comments