Skip to content

Commit d3a141c

Browse files
committed
utils: correct the host that we reference for the tools
We need to use the build for the tools rather than the host. This is to help fix the cross-compilation scenarios.
1 parent a9df0bd commit d3a141c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/build.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -1536,9 +1536,9 @@ function Build-SPMProject {
15361536
$Stopwatch = [Diagnostics.Stopwatch]::StartNew()
15371537

15381538
Invoke-IsolatingEnvVars {
1539-
$RuntimeInstallRoot = [IO.Path]::Combine((Get-InstallDir $HostPlatform), "Runtimes", $ProductVersion)
1539+
$RuntimeInstallRoot = [IO.Path]::Combine((Get-InstallDir $BuildPlatform), "Runtimes", $ProductVersion)
15401540

1541-
$env:Path = "$RuntimeInstallRoot\usr\bin;$($HostPlatform.ToolchainInstallRoot)\usr\bin;${env:Path}"
1541+
$env:Path = "$RuntimeInstallRoot\usr\bin;$($BuildPlatform.ToolchainInstallRoot)\usr\bin;${env:Path}"
15421542
$env:SDKROOT = (Get-SwiftSDK Windows)
15431543
$env:SWIFTCI_USE_LOCAL_DEPS = "1"
15441544

@@ -1574,7 +1574,7 @@ function Build-SPMProject {
15741574
}
15751575
}
15761576

1577-
Invoke-Program "$($HostPlatform.ToolchainInstallRoot)\usr\bin\swift.exe" $ActionName @Arguments @AdditionalArguments
1577+
Invoke-Program "$($BuildPlatform.ToolchainInstallRoot)\usr\bin\swift.exe" $ActionName @Arguments @AdditionalArguments
15781578
}
15791579

15801580
if (-not $ToBatch) {

0 commit comments

Comments
 (0)