From bab8fd84b3480144ce1eb3412e612fb968709101 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Fri, 21 Feb 2025 10:58:15 -0800 Subject: [PATCH] [Build] Make sure to always use local package dependencies on Windows --- utils/build.ps1 | 45 ++++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index fded44e3e7d1c..2148ba3b294e3 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -1392,6 +1392,7 @@ function Build-SPMProject { $env:Path = "$RuntimeInstallRoot\usr\bin;$($HostArch.ToolchainInstallRoot)\usr\bin;${env:Path}" $env:SDKROOT = $SDKInstallRoot + $env:SWIFTCI_USE_LOCAL_DEPS=1 $Arguments = @( "--scratch-path", $Bin, @@ -2179,18 +2180,14 @@ function Build-Foundation { if ($Test) { # Foundation tests build via swiftpm rather than CMake - Isolate-EnvVars { - $env:SWIFTCI_USE_LOCAL_DEPS=1 - Build-SPMProject ` - -Action Test ` - -Src $SourceCache\swift-foundation ` - -Bin "$BinaryCache\$($Arch.LLVMTarget)\CoreFoundationTests" ` - -Arch $HostArch - } + Build-SPMProject ` + -Action Test ` + -Src $SourceCache\swift-foundation ` + -Bin "$BinaryCache\$($Arch.LLVMTarget)\CoreFoundationTests" ` + -Arch $HostArch $ShortArch = $Arch.LLVMName Isolate-EnvVars { - $env:SWIFTCI_USE_LOCAL_DEPS=1 $env:DISPATCH_INCLUDE_PATH="$($Arch.SDKInstallRoot)/usr/lib/swift" $env:LIBXML_LIBRARY_PATH="$LibraryRoot/libxml2-2.11.5/usr/lib/$Platform/$ShortArch" $env:LIBXML_INCLUDE_PATH="$LibraryRoot/libxml2-2.11.5/usr/include/libxml2" @@ -3006,15 +3003,12 @@ function Build-Inspect([Platform]$Platform, $Arch) { } function Build-DocC() { - Isolate-EnvVars { - $env:SWIFTCI_USE_LOCAL_DEPS=1 - Build-SPMProject ` - -Action Build ` - -Src $SourceCache\swift-docc ` - -Bin $(Get-HostProjectBinaryCache DocC) ` - -Arch $HostArch ` - --product docc - } + Build-SPMProject ` + -Action Build ` + -Src $SourceCache\swift-docc ` + -Bin $(Get-HostProjectBinaryCache DocC) ` + -Arch $HostArch ` + --product docc } function Test-PackageManager() { @@ -3024,15 +3018,12 @@ function Test-PackageManager() { "$SourceCache\swiftpm" } - Isolate-EnvVars { - $env:SWIFTCI_USE_LOCAL_DEPS=1 - Build-SPMProject ` - -Action Test ` - -Src $SrcDir ` - -Bin "$BinaryCache\$($HostArch.LLVMTarget)\PackageManagerTests" ` - -Arch $HostArch ` - -Xcc "-I$LibraryRoot\sqlite-3.46.0\usr\include" -Xlinker "-L$LibraryRoot\sqlite-3.46.0\usr\lib" - } + Build-SPMProject ` + -Action Test ` + -Src $SrcDir ` + -Bin "$BinaryCache\$($HostArch.LLVMTarget)\PackageManagerTests" ` + -Arch $HostArch ` + -Xcc "-I$LibraryRoot\sqlite-3.46.0\usr\include" -Xlinker "-L$LibraryRoot\sqlite-3.46.0\usr\lib" } function Build-Installer($Arch) {