From 5440760612b7e90aa250a3322bf73524fd0ae175 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 18 May 2024 09:30:55 -0700 Subject: [PATCH 1/2] utils: tweak the path before using a Swift toolchain We need to tweak the path before we can use the pinned or the just built toolchain. This becomes a problem when trying to cross-compile the toolchain. --- utils/build.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index f307c00c0c66e..b8ba0ba4497b0 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -866,7 +866,9 @@ function Build-CMakeProject { } if ($UseBuiltCompilers.Contains("Swift")) { - $env:Path = "$($HostArch.SDKInstallRoot)\usr\bin;$($HostArch.ToolchainInstallRoot)\usr\bin;${env:Path}" + $env:Path = "$($HostArch.SDKInstallRoot)\usr\bin;$($HostArch.BinaryCache)\cmark-gfm-0.29.0.gfm.13\src;$($HostArch.ToolchainInstallRoot)\usr\bin;${env:Path}" + } else if ($UsePinnedCompilers.Contains("Swift")) { + $env:Path = "$(Get-PinnedToolchainRuntime);${env:Path}" } Invoke-Program cmake.exe @cmakeGenerateArgs @@ -1107,8 +1109,6 @@ function Build-Compilers() { } } - $env:Path = "$(Get-PinnedToolchainRuntime);${env:Path}" - Build-CMakeProject ` -Src $SourceCache\llvm-project\llvm ` -Bin $CompilersBinaryCache ` From eb6cd285daaaf0d5756dd89035c11c9fca0ce228 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 18 May 2024 12:30:31 -0700 Subject: [PATCH 2/2] Update utils/build.ps1 Co-authored-by: Mishal Shah --- utils/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index b8ba0ba4497b0..440d28c3cb4fd 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -867,7 +867,7 @@ function Build-CMakeProject { if ($UseBuiltCompilers.Contains("Swift")) { $env:Path = "$($HostArch.SDKInstallRoot)\usr\bin;$($HostArch.BinaryCache)\cmark-gfm-0.29.0.gfm.13\src;$($HostArch.ToolchainInstallRoot)\usr\bin;${env:Path}" - } else if ($UsePinnedCompilers.Contains("Swift")) { + } elseif ($UsePinnedCompilers.Contains("Swift")) { $env:Path = "$(Get-PinnedToolchainRuntime);${env:Path}" } Invoke-Program cmake.exe @cmakeGenerateArgs