Skip to content

Commit 2bf57d7

Browse files
committed
[Windows] Fix build issues.
Fix build.ps1 to work properly for the experimental runtime build on platforms other than x86-64. Also fix the ToBatch option to mostly work.
1 parent eb91bb5 commit 2bf57d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

utils/build.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -664,15 +664,15 @@ function Get-TargetInfo([Hashtable] $Platform) {
664664
# Cache the result of "swiftc -print-target-info" as $Platform.Cache.TargetInfo
665665
$CacheKey = "TargetInfo"
666666
if (-not $Platform.Cache.ContainsKey($CacheKey)) {
667-
Invoke-IsolatingEnvVars {
667+
[void](Invoke-IsolatingEnvVars {
668668
$env:Path = "$(Get-PinnedToolchainRuntime);$(Get-PinnedToolchainToolsDir);${env:Path}"
669669
$TargetInfo = & swiftc -target $Platform.Triple -print-target-info
670670
if ($LastExitCode -ne 0) {
671671
throw "Unable to print target info for '$($Platform.Triple)'"
672672
}
673673
$TargetInfo = $TargetInfo | ConvertFrom-JSON
674674
$Platform.Cache[$CacheKey] = $TargetInfo.target
675-
}
675+
})
676676
}
677677
return $Platform.Cache[$CacheKey]
678678
}
@@ -1353,7 +1353,7 @@ function Build-CMakeProject {
13531353
}
13541354
if ($UseBuiltCompilers.Contains("Swift")) {
13551355
Add-KeyValueIfNew $Defines CMAKE_Swift_COMPILER_TARGET (Get-ModuleTriple $Platform)
1356-
$RuntimeBinaryCache = Get-ProjectBinaryCache $BuildPlatform Runtime
1356+
$RuntimeBinaryCache = Get-ProjectBinaryCache $Platform Runtime
13571357
$SwiftResourceDir = "${RuntimeBinaryCache}\lib\swift"
13581358

13591359
switch ($Platform.OS) {
@@ -1958,8 +1958,8 @@ function Build-LLVM([Hashtable] $Platform) {
19581958
function Build-Sanitizers([Hashtable] $Platform) {
19591959
$LLVMTargetCache = $(Get-ProjectBinaryCache $Platform LLVM)
19601960
$LITVersionStr = $(Invoke-Program $(Get-PythonExecutable) "$LLVMTargetCache\bin\llvm-lit.py" --version)
1961-
if (-not ($LITVersionStr -match "lit (\d+)\.\d+\.\d+.*")) {
1962-
throw "Unexpected version string output from llvm-lit.py"
1961+
if (-not $ToBatch -and -not ($LITVersionStr -match "lit (\d+)\.\d+\.\d+.*")) {
1962+
throw "Unexpected version string '$LITVersionStr' output from llvm-lit.py"
19631963
}
19641964
$LLVMVersionMajor = $Matches.1
19651965
$InstallTo = "$($HostPlatform.ToolchainInstallRoot)\usr\lib\clang\$LLVMVersionMajor"

0 commit comments

Comments
 (0)