From a5634f31a60fc648761ed70548c21568ee43cb19 Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Fri, 25 Aug 2023 17:26:13 -0400 Subject: [PATCH 1/4] build.ps1: Update the msbuild installer invocation --- build.ps1 | 64 +++++++++++++------------------------------------------ 1 file changed, 15 insertions(+), 49 deletions(-) diff --git a/build.ps1 b/build.ps1 index 11992f56..46242cc6 100644 --- a/build.ps1 +++ b/build.ps1 @@ -597,13 +597,14 @@ function Build-WiXProject() { $Properties = $Properties.Clone() TryAdd-KeyValue $Properties Configuration Release - TryAdd-KeyValue $Properties BaseOutputPath "$($Arch.BinaryCache)\msi\" + TryAdd-KeyValue $Properties BaseOutputPath "$($Arch.BinaryCache)\installer-scripts\" TryAdd-KeyValue $Properties ProductArchitecture $ArchName TryAdd-KeyValue $Properties ProductVersion $ProductVersionArg $MSBuildArgs = @("$SourceCache\swift-installer-scripts\platforms\Windows\$FileName") $MSBuildArgs += "-noLogo" $MSBuildArgs += "-restore" + $MSBuildArgs += "-maxCpuCount" foreach ($Property in $Properties.GetEnumerator()) { if ($Property.Value.Contains(" ")) { $MSBuildArgs += "-p:$($Property.Key)=$($Property.Value.Replace('\', '\\'))" @@ -611,8 +612,8 @@ function Build-WiXProject() { $MSBuildArgs += "-p:$($Property.Key)=$($Property.Value)" } } - $MSBuildArgs += "-bl:$($Arch.BinaryCache)\msi\$ArchName-$([System.IO.Path]::GetFileNameWithoutExtension($FileName)).binlog" - $MSBuildArgs += "-ds:False" + $MSBuildArgs += "-binaryLogger:$($Arch.BinaryCache)\msi\$ArchName-$([System.IO.Path]::GetFileNameWithoutExtension($FileName)).binlog" + $MSBuildArgs += "-detailedSummary:False" Invoke-Program $msbuild @MSBuildArgs } @@ -1405,64 +1406,36 @@ function Build-DocC() { } function Build-Installer() { - Build-WiXProject bld\bld.wixproj -Arch $HostArch -Properties @{ - DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\"; - TOOLCHAIN_ROOT = "$($HostArch.ToolchainInstallRoot)\"; - } - - Build-WiXProject cli\cli.wixproj -Arch $HostArch -Properties @{ + Build-WiXProject bundle\installer.wixproj -Arch $HostArch -Properties @{ DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\"; TOOLCHAIN_ROOT = "$($HostArch.ToolchainInstallRoot)\"; + PLATFORM_ROOT = "$($HostArch.PlatformInstallRoot)\"; + # Pending support for building other architectures + SDK_ROOT = "$($HostArch.SDKInstallRoot)\"; INCLUDE_SWIFT_FORMAT = "true"; SWIFT_FORMAT_BUILD = "$($HostArch.BinaryCache)\swift-format\release"; - } - - Build-WiXProject dbg\dbg.wixproj -Arch $HostArch -Properties @{ - DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\"; - TOOLCHAIN_ROOT = "$($HostArch.ToolchainInstallRoot)\"; INCLUDE_SWIFT_INSPECT = "true"; SWIFT_INSPECT_BUILD = "$($HostArch.BinaryCache)\swift-inspect\release"; } - Build-WiXProject ide\ide.wixproj -Arch $HostArch -Properties @{ - DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\"; - TOOLCHAIN_ROOT = "$($HostArch.ToolchainInstallRoot)\"; - } - - foreach ($Arch in $SDKArchs) { - Build-WiXProject runtimemsi\runtimemsi.wixproj -Arch $Arch -Properties @{ - SDK_ROOT = "$($Arch.SDKInstallRoot)\"; - } - - Build-WiXProject sdk\sdk.wixproj -Arch $Arch -Properties @{ - InstallerPlatform = $HostArch.ShortName; - PLATFORM_ROOT = "$($Arch.PlatformInstallRoot)\"; - SDK_ROOT = "$($Arch.SDKInstallRoot)\"; - SWIFT_SOURCE_DIR = "$SourceCache\swift\"; - } - } - - foreach ($MSI in ("bld", "cli", "dbg", "ide", "sdk", "runtime")) { - if ($ToBatch) { - Write-Output "Move-Item $($HostArch.BinaryCache)\msi\Release\$($HostArch.VSName)\$MSI.msi $($HostArch.BinaryCache)\msi\"; - } else { - Move-Item -Force "$($HostArch.BinaryCache)\msi\Release\$($HostArch.VSName)\$MSI.msi" "$($HostArch.BinaryCache)\msi\"; - } - } + if ($Stage -ne "") { + $Stage += "\" # Interpret as target directory - Build-WiXProject bundle\installer.wixproj -Arch $HostArch -Bundle -Properties @{ - MSI_LOCATION = "$($HostArch.BinaryCache)\msi\"; + Copy-File "$($HostArch.BinaryCache)\installer-scripts\Release\$($HostArch.VSName)\*.msi" $Stage + Copy-File "$($HostArch.BinaryCache)\installer-scripts\Release\$($HostArch.VSName)\installer.exe" $Stage } } #------------------------------------------------------------------- +Build-Installer +exit + if (-not $SkipBuild) { Build-BuildTools $HostArch Build-Compilers $HostArch } - foreach ($Arch in $SDKArchs) { if (-not $SkipBuild) { Build-ZLib $Arch @@ -1526,10 +1499,3 @@ if ($Test -contains "dispatch") { Build-Dispatch $HostArch -Test } if ($Test -contains "foundation") { Build-Foundation $HostArch -Test } if ($Test -contains "xctest") { Build-XCTest $HostArch -Test } if ($Test -contains "llbuild") { Build-LLBuild $HostArch -Test } - -if (-not $SkipPackaging -and $Stage -ne "") { - $Stage += "\" # Interpret as target directory - - Copy-File "$($HostArch.BinaryCache)\msi\*.msi" $Stage - Copy-File "$($HostArch.BinaryCache)\installer.exe" $Stage -} From 45dc8c7a49e1624556b2af4ead3e88db7e96ddc6 Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Fri, 25 Aug 2023 17:30:13 -0400 Subject: [PATCH 2/4] Remove local testing code --- build.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index 46242cc6..76e8a8ba 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1428,9 +1428,6 @@ function Build-Installer() { #------------------------------------------------------------------- -Build-Installer -exit - if (-not $SkipBuild) { Build-BuildTools $HostArch Build-Compilers $HostArch From a8771d5f43f7abfd1a804614053e7027c1399a9d Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Fri, 25 Aug 2023 17:37:06 -0400 Subject: [PATCH 3/4] installer-scripts -> installer --- build.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index 76e8a8ba..113bae57 100644 --- a/build.ps1 +++ b/build.ps1 @@ -597,7 +597,7 @@ function Build-WiXProject() { $Properties = $Properties.Clone() TryAdd-KeyValue $Properties Configuration Release - TryAdd-KeyValue $Properties BaseOutputPath "$($Arch.BinaryCache)\installer-scripts\" + TryAdd-KeyValue $Properties BaseOutputPath "$($Arch.BinaryCache)\installer\" TryAdd-KeyValue $Properties ProductArchitecture $ArchName TryAdd-KeyValue $Properties ProductVersion $ProductVersionArg @@ -1421,8 +1421,8 @@ function Build-Installer() { if ($Stage -ne "") { $Stage += "\" # Interpret as target directory - Copy-File "$($HostArch.BinaryCache)\installer-scripts\Release\$($HostArch.VSName)\*.msi" $Stage - Copy-File "$($HostArch.BinaryCache)\installer-scripts\Release\$($HostArch.VSName)\installer.exe" $Stage + Copy-File "$($HostArch.BinaryCache)\installer\Release\$($HostArch.VSName)\*.msi" $Stage + Copy-File "$($HostArch.BinaryCache)\installer\Release\$($HostArch.VSName)\installer.exe" $Stage } } From f8956ad35a55dae4050ee40d51505919ac88123b Mon Sep 17 00:00:00 2001 From: Tristan Labelle Date: Fri, 25 Aug 2023 17:40:16 -0400 Subject: [PATCH 4/4] Keep honoring $ToBatch --- build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 113bae57..f045b5a9 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1418,7 +1418,7 @@ function Build-Installer() { SWIFT_INSPECT_BUILD = "$($HostArch.BinaryCache)\swift-inspect\release"; } - if ($Stage -ne "") { + if (($Stage -ne "") -and (-not $ToBatch)) { $Stage += "\" # Interpret as target directory Copy-File "$($HostArch.BinaryCache)\installer\Release\$($HostArch.VSName)\*.msi" $Stage