From bfa06e45bbe5fddd31fb03c4aaa2bbff3c594f2f Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Tue, 4 Apr 2023 15:51:15 -0400 Subject: [PATCH 01/22] add runtime and packaging type info for mariner2 arm64 --- build.psm1 | 2 ++ tools/packaging/packaging.psm1 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 3d0be1a846b..6324de317f4 100644 --- a/build.psm1 +++ b/build.psm1 @@ -310,6 +310,7 @@ function Start-PSBuild { [ValidateSet("alpine-x64", "fxdependent", "fxdependent-linux-x64", + "fxdependent-linux-arm64", "fxdependent-win-desktop", "linux-arm", "linux-arm64", @@ -886,6 +887,7 @@ function New-PSOptions { "alpine-x64", "fxdependent", "fxdependent-linux-x64", + "fxdependent-linux-arm64", "fxdependent-win-desktop", "linux-arm", "linux-arm64", diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index ce4d3a95fb1..c4f37e746dd 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -50,7 +50,7 @@ function Start-PSPackage { [string]$Name = "powershell", # Ubuntu, CentOS, Fedora, macOS, and Windows packages are supported - [ValidateSet("msix", "deb", "osxpkg", "rpm", "rpm-fxdependent", "msi", "zip", "zip-pdb", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size")] + [ValidateSet("msix", "deb", "osxpkg", "rpm", "rpm-fxdependent", "rpm-arm-fxdependent", "msi", "zip", "zip-pdb", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size")] [string[]]$Type, # Generate windows downlevel package From b2dd44e7c724eae757be5bdf1afd4d908dfcff19 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 26 Apr 2023 14:30:56 -0400 Subject: [PATCH 02/22] Update tools/packaging/packaging.psm1 --- tools/packaging/packaging.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index c4f37e746dd..0286a04be24 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -50,7 +50,7 @@ function Start-PSPackage { [string]$Name = "powershell", # Ubuntu, CentOS, Fedora, macOS, and Windows packages are supported - [ValidateSet("msix", "deb", "osxpkg", "rpm", "rpm-fxdependent", "rpm-arm-fxdependent", "msi", "zip", "zip-pdb", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size")] + [ValidateSet("msix", "deb", "osxpkg", "rpm", "rpm-fxdependent", "rpm-arm64-fxdependent", "msi", "zip", "zip-pdb", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size")] [string[]]$Type, # Generate windows downlevel package From 92231374741b4b3239bf648df9a48300d3daf73b Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 26 Apr 2023 19:36:13 +0000 Subject: [PATCH 03/22] add comparison for packaging type and build runtime --- tools/packaging/packaging.psm1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 0286a04be24..edaa29de88c 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -109,7 +109,10 @@ function Start-PSPackage { } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "rpm-fxdependent") { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } - } else { + } elseif ($Type.Count -eq 1 -and $Type[0] -eq "rpm-arm64-fxdependent") { + New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-arm64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + } + else { New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } From ba81430be387599cd28808f7b996085560d7baaa Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 3 May 2023 19:29:19 +0000 Subject: [PATCH 04/22] add type for fxdependent-arm64 --- tools/packaging/packaging.psm1 | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index edaa29de88c..1fc1ea306fe 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -238,6 +238,7 @@ function Start-PSPackage { # Use Git tag if not given a version if (-not $Version) { + Write-Verbose -Verbose "$RepoRoot" $Version = (git --git-dir="$RepoRoot/.git" describe) -Replace '^v' } @@ -636,6 +637,25 @@ function Start-PSPackage { } } } + 'rpm-arm64-fxdependent' { + $Arguments = @{ + Type = 'rpm' + PackageSourcePath = $Source + Name = $Name + Version = $Version + Force = $Force + NoSudo = $NoSudo + LTS = $LTS + } + foreach ($Distro in $Script:RedhatFddDistributions) { + $Arguments["Distribution"] = $Distro + if ($PSCmdlet.ShouldProcess("Create RPM Package for $Distro")) { + Write-Verbose -Verbose "Creating RPM Package for $Distro" + Write-Verbose -Verbose "Params are: PackageSourcePath $Source, Name $Name, Version $Version, Force $Force, NoSudo $NoSudo, LTS $LTS" + New-UnixPackage @Arguments + } + } + } 'osxpkg' { $HostArchitecture = "x86_64" if ($MacOSRuntime -match "-arm64") { @@ -1060,7 +1080,11 @@ function New-UnixPackage { # Setup staging directory so we don't change the original source directory $Staging = "$PSScriptRoot/staging" if ($PSCmdlet.ShouldProcess("Create staging folder")) { + Write-Verbose -Verbose "created staging folder" New-StagingFolder -StagingPath $Staging -PackageSourcePath $PackageSourcePath + Write-Verbose -Verbose "start of staging folder contents" + Get-ChildItem -Path $Staging -Recurse + Write-Verbose -Verbose "end of staging folder contents" } # Follow the Filesystem Hierarchy Standard for Linux and macOS @@ -1072,12 +1096,16 @@ function New-UnixPackage { # Destination for symlink to powershell executable $Link = Get-PwshExecutablePath -IsPreview:$IsPreview + + Write-Verbose -Verbose "link: $Link" $links = @(New-LinkInfo -LinkDestination $Link -LinkTarget "$Destination/pwsh") if($LTS) { $links += New-LinkInfo -LinkDestination (Get-PwshExecutablePath -IsLTS:$LTS) -LinkTarget "$Destination/pwsh" } + Write-Verbose -Verbose "Dest $Destination" + if ($PSCmdlet.ShouldProcess("Create package file system")) { # Generate After Install and After Remove scripts @@ -1100,6 +1128,8 @@ function New-UnixPackage { # Generate gzip of man file $ManGzipInfo = New-ManGzip -IsPreview:$IsPreview -IsLTS:$LTS + Write-Verbose -Verbose "Staging $Staging" + # Change permissions for packaging Write-Log "Setting permissions..." Start-NativeExecution { @@ -1574,6 +1604,7 @@ function New-AfterScripts Write-Verbose -Message "AfterScript Distribution: $Distribution" -Verbose if ($Distribution -in $script:RedHatDistributions) { + Write-Verbose -Verbose "distro is in RHD" $AfterInstallScript = (Join-Path $env:HOME $([System.IO.Path]::GetRandomFileName())) $AfterRemoveScript = (Join-Path $env:HOME $([System.IO.Path]::GetRandomFileName())) $packagingStrings.RedHatAfterInstallScript -f "$Link", $Destination | Out-File -FilePath $AfterInstallScript -Encoding ascii From 4e78c5ebac5ecda29a7100bcdf4f20a630a7188d Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 14 Jun 2023 19:50:44 +0000 Subject: [PATCH 05/22] make changes to build script, so that output path uses linux-arm64 but runtime is still prepended with fxdependent --- build.psm1 | 42 ++++++++++++++++++++++++++++++---- tools/packaging/packaging.psm1 | 3 +++ 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/build.psm1 b/build.psm1 index 6324de317f4..45c33988e47 100644 --- a/build.psm1 +++ b/build.psm1 @@ -429,8 +429,15 @@ Fix steps: PSModuleRestore=$PSModuleRestore ForMinimalSize=$ForMinimalSize } + + Write-Verbose "Start-PSBuild(): Runtime before calling New-PSOptions() $Runtime" -Verbose + Write-Verbose "Start-PSBuild(): Output before calling New-PSOptions() $Output" -Verbose + $script:Options = New-PSOptions @OptionsArguments + Write-Verbose "Start-PSBuild(): Runtime after calling New-PSOptions() $Runtime" -Verbose + Write-Verbose "Start-PSBuild(): Output after calling New-PSOptions() $($Options.Output)" -Verbose + if ($StopDevPowerShell) { Stop-DevPowerShell } @@ -482,9 +489,11 @@ Fix steps: if (-not $SMAOnly -and $Options.Runtime -notlike 'fxdependent*') { # libraries should not have runtime + Write-Verbose "Start-PSBuild() runtime cond 1: $($Options.Runtime)" -Verbose $Arguments += "--runtime", $Options.Runtime } elseif ($Options.Runtime -match $optimizedFddRegex) { $runtime = $Options.Runtime -replace 'fxdependent-', '' + Write-Verbose "Start-PSBuild() runtime cond 2: $runtime" -Verbose $Arguments += "--runtime", $runtime } @@ -497,8 +506,10 @@ Fix steps: $Arguments += "/property:RunAnalyzersDuringBuild=false" } + Write-Verbose -Verbose "StartPSBuild(): before Restore-PSPackage() output is $($options.Output)" # handle Restore Restore-PSPackage -Options $Options -Force:$Restore -InteractiveAuth:$InteractiveAuth + Write-Verbose -Verbose "StartPSBuild(): after Restore-PSPackage() output is $($options.Output)" # handle ResGen # Heuristic to run ResGen on the fresh machine @@ -511,6 +522,7 @@ Fix steps: # .inc file name must be different for Windows and Linux to allow build on Windows and WSL. $runtime = $Options.Runtime if ($Options.Runtime -match $optimizedFddRegex) { + Write-Verbose -Verbose "Start-PSBuild() handle type gen condition, so runtime: $runtime" $runtime = $Options.Runtime -replace 'fxdependent-', '' } @@ -523,9 +535,12 @@ Fix steps: # Get the folder path where pwsh.exe is located. if ((Split-Path $Options.Output -Leaf) -like "pwsh*") { $publishPath = Split-Path $Options.Output -Parent + Write-Verbose -Verbose "Start-PSBuild() cond 1 output: $($Options.Output)" + Write-Verbose -Verbose "Start-PSBuild() cond 1 publishPath $publishPath" } else { $publishPath = $Options.Output + Write-Verbose -Verbose "Start-PSBuild() cond 2 publishPath $publishPath" } try { @@ -544,7 +559,7 @@ Fix steps: $Arguments += "/property:SDKToUse=$sdkToUse" Write-Log -message "Run dotnet $Arguments from $PWD" - Start-NativeExecution { dotnet $Arguments } + Start-NativeExecution { dotnet $Arguments } # this is the dotnet publish command actually being run! Write-Log -message "PowerShell output: $($Options.Output)" } else { Write-Verbose "Building with shim" -Verbose @@ -920,8 +935,8 @@ function New-PSOptions { $Configuration = 'Debug' } - Write-Verbose "Using configuration '$Configuration'" - Write-Verbose "Using framework '$Framework'" + Write-Verbose "New-PSOptions() Using configuration '$Configuration'" + Write-Verbose "New-PSOptions() Using framework '$Framework'" if (-not $Runtime) { $Platform, $Architecture = dotnet --info | @@ -953,7 +968,8 @@ function New-PSOptions { } } - $PowerShellDir = if ($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) { + # $PowerShellDir = if ($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) { + $PowerShellDir = if (($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) -and (-not $Runtime -like 'fxdependent*linux*')) { "powershell-win-core" } else { "powershell-unix" @@ -972,8 +988,20 @@ function New-PSOptions { # Build the Output path if (!$Output) { - if ($Runtime -like 'fxdependent*') { + Write-Verbose "New-PSOptions(): runtime $Runtime" + $isW = $environment.IsWindows + Write-Verbose "New-PSOptions(): env is windows: $isW" + $isNotFxDepLinux = -not $Runtime -like 'fxdependent*linux*' + Write-Verbose "New-PSOptions(): runtime is not like fxdependentlinux: $isNotFxDepLinux" + if ($Runtime -like 'fxdependent*' -and -not $Runtime -like 'fxdependent*linux*') { $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, "publish", $Executable) + Write-Verbose "New-PSOptions(): like fxdependent so out path is: $Output" + } elseif ($Runtime -like 'fxdependent*' -and $Runtime -like 'fxdependent*linux*') { + Write-Verbose "New-PSOptions() building output path, before trimming: $Runtime" + $outputRuntime = $Runtime -replace 'fxdependent-', '' + Write-Verbose "New-PSOptions() building output path, after trimming: $outputRuntime" + $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $outputRuntime, "publish", $Executable) + Write-Verbose "New-PSOptions(): not like first case, so out path is $Output" } else { $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, "publish", $Executable) } @@ -1001,6 +1029,9 @@ function New-PSOptions { $RootInfo['IsValid'] = $true } + Write-Verbose "Runtime at the end of method: $Runtime" + Write-Verbose "Outout at the end of the method: $Output" + return New-PSOptionsObject ` -RootInfo ([PSCustomObject]$RootInfo) ` -Top $Top ` @@ -2314,6 +2345,7 @@ function Start-DevPowerShell { try { if (-not $BinDir) { + Write-Verbose "Start-DevPowershell() New-PSOptions() is indeed called, look into this.." $BinDir = Split-Path (New-PSOptions -Configuration $Configuration).Output } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 1fc1ea306fe..1bc5cbbcbd9 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -100,16 +100,19 @@ function Start-PSPackage { } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-alpine") { New-PSOptions -Configuration "Release" -Runtime "alpine-x64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-arm") { + Write-Verbose "type $Type means runtime is linux-arm64 first" New-PSOptions -Configuration "Release" -Runtime "Linux-ARM" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-arm64") { if ($IsMacOS) { New-PSOptions -Configuration "Release" -Runtime "osx-arm64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { + Write-Verbose "type $Type means runtime is linux-arm64" New-PSOptions -Configuration "Release" -Runtime "Linux-ARM64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "rpm-fxdependent") { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "rpm-arm64-fxdependent") { + Write-Verbose "type $Type means runtime is fxdependent-linux-arm64" New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-arm64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { From 430ab241f7f0a2e2b04d5b1bd4532dd8589296a4 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 14 Jun 2023 20:05:27 +0000 Subject: [PATCH 06/22] clean up verbose statements I added in --- build.psm1 | 33 +++------------------------------ tools/packaging/packaging.psm1 | 15 --------------- 2 files changed, 3 insertions(+), 45 deletions(-) diff --git a/build.psm1 b/build.psm1 index 45c33988e47..fa38f72cb4d 100644 --- a/build.psm1 +++ b/build.psm1 @@ -430,14 +430,8 @@ Fix steps: ForMinimalSize=$ForMinimalSize } - Write-Verbose "Start-PSBuild(): Runtime before calling New-PSOptions() $Runtime" -Verbose - Write-Verbose "Start-PSBuild(): Output before calling New-PSOptions() $Output" -Verbose - $script:Options = New-PSOptions @OptionsArguments - Write-Verbose "Start-PSBuild(): Runtime after calling New-PSOptions() $Runtime" -Verbose - Write-Verbose "Start-PSBuild(): Output after calling New-PSOptions() $($Options.Output)" -Verbose - if ($StopDevPowerShell) { Stop-DevPowerShell } @@ -489,11 +483,9 @@ Fix steps: if (-not $SMAOnly -and $Options.Runtime -notlike 'fxdependent*') { # libraries should not have runtime - Write-Verbose "Start-PSBuild() runtime cond 1: $($Options.Runtime)" -Verbose $Arguments += "--runtime", $Options.Runtime } elseif ($Options.Runtime -match $optimizedFddRegex) { $runtime = $Options.Runtime -replace 'fxdependent-', '' - Write-Verbose "Start-PSBuild() runtime cond 2: $runtime" -Verbose $Arguments += "--runtime", $runtime } @@ -506,10 +498,8 @@ Fix steps: $Arguments += "/property:RunAnalyzersDuringBuild=false" } - Write-Verbose -Verbose "StartPSBuild(): before Restore-PSPackage() output is $($options.Output)" # handle Restore Restore-PSPackage -Options $Options -Force:$Restore -InteractiveAuth:$InteractiveAuth - Write-Verbose -Verbose "StartPSBuild(): after Restore-PSPackage() output is $($options.Output)" # handle ResGen # Heuristic to run ResGen on the fresh machine @@ -522,7 +512,6 @@ Fix steps: # .inc file name must be different for Windows and Linux to allow build on Windows and WSL. $runtime = $Options.Runtime if ($Options.Runtime -match $optimizedFddRegex) { - Write-Verbose -Verbose "Start-PSBuild() handle type gen condition, so runtime: $runtime" $runtime = $Options.Runtime -replace 'fxdependent-', '' } @@ -535,12 +524,9 @@ Fix steps: # Get the folder path where pwsh.exe is located. if ((Split-Path $Options.Output -Leaf) -like "pwsh*") { $publishPath = Split-Path $Options.Output -Parent - Write-Verbose -Verbose "Start-PSBuild() cond 1 output: $($Options.Output)" - Write-Verbose -Verbose "Start-PSBuild() cond 1 publishPath $publishPath" } else { $publishPath = $Options.Output - Write-Verbose -Verbose "Start-PSBuild() cond 2 publishPath $publishPath" } try { @@ -559,7 +545,7 @@ Fix steps: $Arguments += "/property:SDKToUse=$sdkToUse" Write-Log -message "Run dotnet $Arguments from $PWD" - Start-NativeExecution { dotnet $Arguments } # this is the dotnet publish command actually being run! + Start-NativeExecution { dotnet $Arguments } Write-Log -message "PowerShell output: $($Options.Output)" } else { Write-Verbose "Building with shim" -Verbose @@ -935,8 +921,8 @@ function New-PSOptions { $Configuration = 'Debug' } - Write-Verbose "New-PSOptions() Using configuration '$Configuration'" - Write-Verbose "New-PSOptions() Using framework '$Framework'" + Write-Verbose "Using configuration '$Configuration'" + Write-Verbose "Using framework '$Framework'" if (-not $Runtime) { $Platform, $Architecture = dotnet --info | @@ -988,20 +974,11 @@ function New-PSOptions { # Build the Output path if (!$Output) { - Write-Verbose "New-PSOptions(): runtime $Runtime" - $isW = $environment.IsWindows - Write-Verbose "New-PSOptions(): env is windows: $isW" - $isNotFxDepLinux = -not $Runtime -like 'fxdependent*linux*' - Write-Verbose "New-PSOptions(): runtime is not like fxdependentlinux: $isNotFxDepLinux" if ($Runtime -like 'fxdependent*' -and -not $Runtime -like 'fxdependent*linux*') { $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, "publish", $Executable) - Write-Verbose "New-PSOptions(): like fxdependent so out path is: $Output" } elseif ($Runtime -like 'fxdependent*' -and $Runtime -like 'fxdependent*linux*') { - Write-Verbose "New-PSOptions() building output path, before trimming: $Runtime" $outputRuntime = $Runtime -replace 'fxdependent-', '' - Write-Verbose "New-PSOptions() building output path, after trimming: $outputRuntime" $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $outputRuntime, "publish", $Executable) - Write-Verbose "New-PSOptions(): not like first case, so out path is $Output" } else { $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, "publish", $Executable) } @@ -1029,9 +1006,6 @@ function New-PSOptions { $RootInfo['IsValid'] = $true } - Write-Verbose "Runtime at the end of method: $Runtime" - Write-Verbose "Outout at the end of the method: $Output" - return New-PSOptionsObject ` -RootInfo ([PSCustomObject]$RootInfo) ` -Top $Top ` @@ -2345,7 +2319,6 @@ function Start-DevPowerShell { try { if (-not $BinDir) { - Write-Verbose "Start-DevPowershell() New-PSOptions() is indeed called, look into this.." $BinDir = Split-Path (New-PSOptions -Configuration $Configuration).Output } diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 1bc5cbbcbd9..9c96fffea40 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -100,19 +100,16 @@ function Start-PSPackage { } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-alpine") { New-PSOptions -Configuration "Release" -Runtime "alpine-x64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-arm") { - Write-Verbose "type $Type means runtime is linux-arm64 first" New-PSOptions -Configuration "Release" -Runtime "Linux-ARM" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-arm64") { if ($IsMacOS) { New-PSOptions -Configuration "Release" -Runtime "osx-arm64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { - Write-Verbose "type $Type means runtime is linux-arm64" New-PSOptions -Configuration "Release" -Runtime "Linux-ARM64" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "rpm-fxdependent") { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "rpm-arm64-fxdependent") { - Write-Verbose "type $Type means runtime is fxdependent-linux-arm64" New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-arm64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { @@ -241,7 +238,6 @@ function Start-PSPackage { # Use Git tag if not given a version if (-not $Version) { - Write-Verbose -Verbose "$RepoRoot" $Version = (git --git-dir="$RepoRoot/.git" describe) -Replace '^v' } @@ -654,7 +650,6 @@ function Start-PSPackage { $Arguments["Distribution"] = $Distro if ($PSCmdlet.ShouldProcess("Create RPM Package for $Distro")) { Write-Verbose -Verbose "Creating RPM Package for $Distro" - Write-Verbose -Verbose "Params are: PackageSourcePath $Source, Name $Name, Version $Version, Force $Force, NoSudo $NoSudo, LTS $LTS" New-UnixPackage @Arguments } } @@ -1083,11 +1078,7 @@ function New-UnixPackage { # Setup staging directory so we don't change the original source directory $Staging = "$PSScriptRoot/staging" if ($PSCmdlet.ShouldProcess("Create staging folder")) { - Write-Verbose -Verbose "created staging folder" New-StagingFolder -StagingPath $Staging -PackageSourcePath $PackageSourcePath - Write-Verbose -Verbose "start of staging folder contents" - Get-ChildItem -Path $Staging -Recurse - Write-Verbose -Verbose "end of staging folder contents" } # Follow the Filesystem Hierarchy Standard for Linux and macOS @@ -1100,15 +1091,12 @@ function New-UnixPackage { # Destination for symlink to powershell executable $Link = Get-PwshExecutablePath -IsPreview:$IsPreview - Write-Verbose -Verbose "link: $Link" $links = @(New-LinkInfo -LinkDestination $Link -LinkTarget "$Destination/pwsh") if($LTS) { $links += New-LinkInfo -LinkDestination (Get-PwshExecutablePath -IsLTS:$LTS) -LinkTarget "$Destination/pwsh" } - Write-Verbose -Verbose "Dest $Destination" - if ($PSCmdlet.ShouldProcess("Create package file system")) { # Generate After Install and After Remove scripts @@ -1131,8 +1119,6 @@ function New-UnixPackage { # Generate gzip of man file $ManGzipInfo = New-ManGzip -IsPreview:$IsPreview -IsLTS:$LTS - Write-Verbose -Verbose "Staging $Staging" - # Change permissions for packaging Write-Log "Setting permissions..." Start-NativeExecution { @@ -1607,7 +1593,6 @@ function New-AfterScripts Write-Verbose -Message "AfterScript Distribution: $Distribution" -Verbose if ($Distribution -in $script:RedHatDistributions) { - Write-Verbose -Verbose "distro is in RHD" $AfterInstallScript = (Join-Path $env:HOME $([System.IO.Path]::GetRandomFileName())) $AfterRemoveScript = (Join-Path $env:HOME $([System.IO.Path]::GetRandomFileName())) $packagingStrings.RedHatAfterInstallScript -f "$Link", $Destination | Out-File -FilePath $AfterInstallScript -Encoding ascii From 9914f2fdd52afee12a9999d9151b466c7ae2f54c Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Fri, 16 Jun 2023 19:44:00 +0000 Subject: [PATCH 07/22] add fpm argument for architecture --- tools/packaging/packaging.psm1 | 35 ++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 9c96fffea40..dfe4d3eb526 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -637,8 +637,10 @@ function Start-PSPackage { } } 'rpm-arm64-fxdependent' { + $HostArchitecture = "aarch64" + Write-Verbose "HostArchitecture = $HostArchitecture" -Verbose $Arguments = @{ - Type = 'rpm' + Type = 'rpm-arm64-fxdependent' PackageSourcePath = $Source Name = $Name Version = $Version @@ -648,6 +650,7 @@ function Start-PSPackage { } foreach ($Distro in $Script:RedhatFddDistributions) { $Arguments["Distribution"] = $Distro + $Arguments["HostArchitecture"] = $HostArchitecture if ($PSCmdlet.ShouldProcess("Create RPM Package for $Distro")) { Write-Verbose -Verbose "Creating RPM Package for $Distro" New-UnixPackage @Arguments @@ -926,7 +929,7 @@ function New-UnixPackage { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory)] - [ValidateSet("deb", "osxpkg", "rpm")] + [ValidateSet("deb", "osxpkg", "rpm", "rpm-arm64-fxdependent")] [string]$Type, [Parameter(Mandatory)] @@ -958,6 +961,22 @@ function New-UnixPackage { ) DynamicParam { + $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" + if ($Type -eq "rpm-arm64-fxdependent") + { + # Add a dynamic parameter '-HostArchitecture' when the specified package type is 'rpm-fxdependent-arm64'. + # The '-HostArchitecture' parameter is used to indicate which Mac processor this package is targeting, + # Intel (x86_64) or arm (aarch64). + $ParameterAttrHA = New-Object "System.Management.Automation.ParameterAttribute" + $ValidateSetAttrHA = New-Object "System.Management.Automation.ValidateSetAttribute" -ArgumentList "x86_64", "aarch64" + $AttributesHA = New-Object "System.Collections.ObjectModel.Collection``1[System.Attribute]" + $AttributesHA.Add($ParameterAttrHA) > $null + $AttributesHA.Add($ValidateSetAttrHA) > $null + $ParameterHA = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("HostArchitecture", [string], $AttributesHA) + $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" + $Dict.Add("HostArchitecture", $ParameterHA) > $null + $Type = "rpm" + } if ($Type -eq "deb" -or $Type -like 'rpm*') { # Add a dynamic parameter '-Distribution' when the specified package type is 'deb'. # The '-Distribution' parameter can be used to indicate which Debian distro this pacakge is targeting. @@ -975,7 +994,7 @@ function New-UnixPackage { $Attributes.Add($ValidateSetAttr) > $null $Parameter = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("Distribution", [string], $Attributes) - $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" + # $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" $Dict.Add("Distribution", $Parameter) > $null return $Dict } elseif ($Type -eq "osxpkg") { @@ -1100,6 +1119,7 @@ function New-UnixPackage { if ($PSCmdlet.ShouldProcess("Create package file system")) { # Generate After Install and After Remove scripts + Write-Verbose -Verbose "About to call New-AfterScripts() with Distribution $DebDistro" $AfterScriptInfo = New-AfterScripts -Link $Link -Distribution $DebDistro -Destination $Destination # there is a weird bug in fpm @@ -1150,7 +1170,14 @@ function New-UnixPackage { # Setup package dependencies $Dependencies = @(Get-PackageDependencies @packageDependenciesParams) - $Arguments = Get-FpmArguments ` + $Arguments = @() + + if ($HostArchitecture -and $Type -eq "rpm") + { + $Arguments += @("-a", $HostArchitecture) + } + + $Arguments += Get-FpmArguments ` -Name $Name ` -Version $packageVersion ` -Iteration $Iteration ` From d74257eb72ccd2fbf71bcc19fb4af7d78fc6dde0 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Fri, 16 Jun 2023 19:46:00 +0000 Subject: [PATCH 08/22] code cleanup --- tools/packaging/packaging.psm1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index dfe4d3eb526..061971b9ee5 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -994,7 +994,6 @@ function New-UnixPackage { $Attributes.Add($ValidateSetAttr) > $null $Parameter = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("Distribution", [string], $Attributes) - # $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" $Dict.Add("Distribution", $Parameter) > $null return $Dict } elseif ($Type -eq "osxpkg") { @@ -1119,7 +1118,6 @@ function New-UnixPackage { if ($PSCmdlet.ShouldProcess("Create package file system")) { # Generate After Install and After Remove scripts - Write-Verbose -Verbose "About to call New-AfterScripts() with Distribution $DebDistro" $AfterScriptInfo = New-AfterScripts -Link $Link -Distribution $DebDistro -Destination $Destination # there is a weird bug in fpm From a17d9e566641ac0c7c187d578f79987793a0c863 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Fri, 16 Jun 2023 19:47:02 +0000 Subject: [PATCH 09/22] code cleanup --- tools/packaging/packaging.psm1 | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 061971b9ee5..7cc62a77120 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -638,7 +638,6 @@ function Start-PSPackage { } 'rpm-arm64-fxdependent' { $HostArchitecture = "aarch64" - Write-Verbose "HostArchitecture = $HostArchitecture" -Verbose $Arguments = @{ Type = 'rpm-arm64-fxdependent' PackageSourcePath = $Source From 2ab4d243fd9f7487f2a327e8e7b0dd8f508d4f19 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 19 Jun 2023 19:53:15 +0000 Subject: [PATCH 10/22] fix build condition --- build.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index fa38f72cb4d..a2977397ddb 100644 --- a/build.psm1 +++ b/build.psm1 @@ -954,8 +954,7 @@ function New-PSOptions { } } - # $PowerShellDir = if ($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) { - $PowerShellDir = if (($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) -and (-not $Runtime -like 'fxdependent*linux*')) { + $PowerShellDir = if (($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) -and -not ($Runtime -like 'fxdependent*linux*')) { "powershell-win-core" } else { "powershell-unix" From 87f63b5d6c76a83e7d158e60a7cb4f2d10133f25 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 21 Jun 2023 18:45:35 +0000 Subject: [PATCH 11/22] remove condition for fxdependent linux as that's only needed when building linux from a windows machine --- build.psm1 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/build.psm1 b/build.psm1 index a2977397ddb..33d5436769e 100644 --- a/build.psm1 +++ b/build.psm1 @@ -954,7 +954,8 @@ function New-PSOptions { } } - $PowerShellDir = if (($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) -and -not ($Runtime -like 'fxdependent*linux*')) { + $PowerShellDir = if ($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) { + # $PowerShellDir = if (($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) -and -not ($Runtime -like 'fxdependent*linux*')) { "powershell-win-core" } else { "powershell-unix" @@ -973,12 +974,19 @@ function New-PSOptions { # Build the Output path if (!$Output) { - if ($Runtime -like 'fxdependent*' -and -not $Runtime -like 'fxdependent*linux*') { - $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, "publish", $Executable) - } elseif ($Runtime -like 'fxdependent*' -and $Runtime -like 'fxdependent*linux*') { + # if ($Runtime -like 'fxdependent*' -and -not $Runtime -like 'fxdependent*linux*') { + if ($Runtime -like 'fxdependent*' -and $Runtime -like 'fxdependent*linux*') { $outputRuntime = $Runtime -replace 'fxdependent-', '' $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $outputRuntime, "publish", $Executable) - } else { + } + elseif ($Runtime -like 'fxdependent*') { + $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, "publish", $Executable) + } + # elseif ($Runtime -like 'fxdependent*' -and $Runtime -like 'fxdependent*linux*') { + # $outputRuntime = $Runtime -replace 'fxdependent-', '' + # $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $outputRuntime, "publish", $Executable) + # } + else { $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, "publish", $Executable) } } else { From 4142e48278f092066e4788f1a44ad0d65e572e55 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 21 Jun 2023 20:36:31 +0000 Subject: [PATCH 12/22] add HostArchitecture param to New-UnixPackage() and Get-FpmArguments() --- tools/packaging/packaging.psm1 | 61 ++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 7cc62a77120..e6097e0488b 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -592,6 +592,7 @@ function Start-PSPackage { Force = $Force NoSudo = $NoSudo LTS = $LTS + HostArchitecture = "amd64" } foreach ($Distro in $Script:DebianDistributions) { $Arguments["Distribution"] = $Distro @@ -609,6 +610,7 @@ function Start-PSPackage { Force = $Force NoSudo = $NoSudo LTS = $LTS + HostArchitecture = "x86_64" } foreach ($Distro in $Script:RedhatFullDistributions) { $Arguments["Distribution"] = $Distro @@ -627,6 +629,7 @@ function Start-PSPackage { Force = $Force NoSudo = $NoSudo LTS = $LTS + HostArchitecture = "x86_64" } foreach ($Distro in $Script:RedhatFddDistributions) { $Arguments["Distribution"] = $Distro @@ -637,15 +640,15 @@ function Start-PSPackage { } } 'rpm-arm64-fxdependent' { - $HostArchitecture = "aarch64" $Arguments = @{ - Type = 'rpm-arm64-fxdependent' + Type = 'rpm' PackageSourcePath = $Source Name = $Name Version = $Version Force = $Force NoSudo = $NoSudo LTS = $LTS + HostArchitecture = "aarch64" } foreach ($Distro in $Script:RedhatFddDistributions) { $Arguments["Distribution"] = $Distro @@ -688,6 +691,7 @@ function Start-PSPackage { Force = $Force NoSudo = $NoSudo LTS = $LTS + HostArchitecture = "all" } if ($PSCmdlet.ShouldProcess("Create $_ Package")) { @@ -928,7 +932,7 @@ function New-UnixPackage { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory)] - [ValidateSet("deb", "osxpkg", "rpm", "rpm-arm64-fxdependent")] + [ValidateSet("deb", "osxpkg", "rpm")] [string]$Type, [Parameter(Mandatory)] @@ -946,6 +950,10 @@ function New-UnixPackage { # This is a string because strings are appended to it [string]$Iteration = "1", + [string] + [ValidateSet("x86_64", "amd64", "aarch64", "native", "all", "noarch", "any")] + $HostArchitecture, + [Switch] $Force, @@ -960,22 +968,21 @@ function New-UnixPackage { ) DynamicParam { - $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" - if ($Type -eq "rpm-arm64-fxdependent") - { - # Add a dynamic parameter '-HostArchitecture' when the specified package type is 'rpm-fxdependent-arm64'. - # The '-HostArchitecture' parameter is used to indicate which Mac processor this package is targeting, - # Intel (x86_64) or arm (aarch64). - $ParameterAttrHA = New-Object "System.Management.Automation.ParameterAttribute" - $ValidateSetAttrHA = New-Object "System.Management.Automation.ValidateSetAttribute" -ArgumentList "x86_64", "aarch64" - $AttributesHA = New-Object "System.Collections.ObjectModel.Collection``1[System.Attribute]" - $AttributesHA.Add($ParameterAttrHA) > $null - $AttributesHA.Add($ValidateSetAttrHA) > $null - $ParameterHA = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("HostArchitecture", [string], $AttributesHA) - $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" - $Dict.Add("HostArchitecture", $ParameterHA) > $null - $Type = "rpm" - } + # if ($Type -eq "rpm-arm64-fxdependent") + # { + # # Add a dynamic parameter '-HostArchitecture' when the specified package type is 'rpm-fxdependent-arm64'. + # # The '-HostArchitecture' parameter is used to indicate which Mac processor this package is targeting, + # # Intel (x86_64) or arm (aarch64). + # $ParameterAttrHA = New-Object "System.Management.Automation.ParameterAttribute" + # $ValidateSetAttrHA = New-Object "System.Management.Automation.ValidateSetAttribute" -ArgumentList "x86_64", "aarch64" + # $AttributesHA = New-Object "System.Collections.ObjectModel.Collection``1[System.Attribute]" + # $AttributesHA.Add($ParameterAttrHA) > $null + # $AttributesHA.Add($ValidateSetAttrHA) > $null + # $ParameterHA = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("HostArchitecture", [string], $AttributesHA) + # $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" + # $Dict.Add("HostArchitecture", $ParameterHA) > $null + # $Type = "rpm" + # } if ($Type -eq "deb" -or $Type -like 'rpm*') { # Add a dynamic parameter '-Distribution' when the specified package type is 'deb'. # The '-Distribution' parameter can be used to indicate which Debian distro this pacakge is targeting. @@ -991,8 +998,9 @@ function New-UnixPackage { $Attributes = New-Object "System.Collections.ObjectModel.Collection``1[System.Attribute]" $Attributes.Add($ParameterAttr) > $null $Attributes.Add($ValidateSetAttr) > $null - + $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" $Parameter = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("Distribution", [string], $Attributes) + $Dict.Add("Distribution", $Parameter) > $null return $Dict } elseif ($Type -eq "osxpkg") { @@ -1169,10 +1177,10 @@ function New-UnixPackage { $Arguments = @() - if ($HostArchitecture -and $Type -eq "rpm") - { - $Arguments += @("-a", $HostArchitecture) - } + # if ($HostArchitecture -and $Type -eq "rpm") + # { + # $Arguments += @("-a", $HostArchitecture) + # } $Arguments += Get-FpmArguments ` -Name $Name ` @@ -1190,6 +1198,7 @@ function New-UnixPackage { -LinkInfo $Links ` -AppsFolder $AppsFolder ` -Distribution $DebDistro ` + -HostArchitecture $HostArchitecture ` -ErrorAction Stop # Build package @@ -1441,7 +1450,8 @@ function Get-FpmArguments return $true })] [String]$AppsFolder, - [String]$Distribution = 'rhel.7' + [String]$Distribution = 'rhel.7', + [string]$HostArchitecture ) $Arguments = @( @@ -1453,6 +1463,7 @@ function Get-FpmArguments "--vendor", "Microsoft Corporation", "--url", "https://microsoft.com/powershell", "--description", $Description, + "--architecture", $HostArchitecture, "--category", "shells", "-t", $Type, "-s", "dir" From 0bca8317c2df1275b956cca760cad22770522b10 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 21 Jun 2023 20:43:19 +0000 Subject: [PATCH 13/22] code cleanup --- build.psm1 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build.psm1 b/build.psm1 index 33d5436769e..ffa1116fb3e 100644 --- a/build.psm1 +++ b/build.psm1 @@ -955,7 +955,6 @@ function New-PSOptions { } $PowerShellDir = if ($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) { - # $PowerShellDir = if (($Runtime -like 'win*' -or ($Runtime -like 'fxdependent*' -and $environment.IsWindows)) -and -not ($Runtime -like 'fxdependent*linux*')) { "powershell-win-core" } else { "powershell-unix" @@ -982,10 +981,6 @@ function New-PSOptions { elseif ($Runtime -like 'fxdependent*') { $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, "publish", $Executable) } - # elseif ($Runtime -like 'fxdependent*' -and $Runtime -like 'fxdependent*linux*') { - # $outputRuntime = $Runtime -replace 'fxdependent-', '' - # $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $outputRuntime, "publish", $Executable) - # } else { $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $Runtime, "publish", $Executable) } From 0aee133d3885a85d52fe717558ecb84d3a1aabee Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Fri, 23 Jun 2023 16:08:05 +0000 Subject: [PATCH 14/22] add fxdependent-linux-arm64 to tests --- tools/ci.psm1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 731ab4eaebf..ffc19c5e61c 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -543,6 +543,10 @@ function Invoke-CIFinish $runPackageTest = $false $packageTypes = 'zip', 'zip-pdb', 'msix' } + 'fxdependent-linux-arm64' { + $runPackageTest = $true + $packageTypes = 'rpm' + } } $packages = Start-PSPackage -Type $packageTypes -ReleaseTag $preReleaseVersion -SkipReleaseChecks -WindowsRuntime $Runtime From 59ba7ad892d6092b4116f3236edd3a7d1a95c525 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Fri, 30 Jun 2023 17:15:16 +0000 Subject: [PATCH 15/22] add linux-arm test to correct place --- tools/ci.psm1 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index ffc19c5e61c..2606d785b7e 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -543,10 +543,6 @@ function Invoke-CIFinish $runPackageTest = $false $packageTypes = 'zip', 'zip-pdb', 'msix' } - 'fxdependent-linux-arm64' { - $runPackageTest = $true - $packageTypes = 'rpm' - } } $packages = Start-PSPackage -Type $packageTypes -ReleaseTag $preReleaseVersion -SkipReleaseChecks -WindowsRuntime $Runtime @@ -788,7 +784,7 @@ function New-LinuxPackage # Only build packages for PowerShell/PowerShell repository # branches, not pull requests - $packages = @(Start-PSPackage @packageParams -SkipReleaseChecks -Type deb, rpm, tar) + $packages = @(Start-PSPackage @packageParams -SkipReleaseChecks -Type deb, rpm, rpm-arm64-fxdependent, tar) foreach($package in $packages) { if (Test-Path $package) From 0f2f616475b70376d418e09e8fe3eb2eecd289f0 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 5 Jul 2023 17:07:47 -0400 Subject: [PATCH 16/22] Update build.psm1 Co-authored-by: Travis Plunk --- build.psm1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index ffa1116fb3e..016e3254e00 100644 --- a/build.psm1 +++ b/build.psm1 @@ -973,7 +973,6 @@ function New-PSOptions { # Build the Output path if (!$Output) { - # if ($Runtime -like 'fxdependent*' -and -not $Runtime -like 'fxdependent*linux*') { if ($Runtime -like 'fxdependent*' -and $Runtime -like 'fxdependent*linux*') { $outputRuntime = $Runtime -replace 'fxdependent-', '' $Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework, $outputRuntime, "publish", $Executable) From 60a947de31aac6fcf6998f88559cac0198cc5330 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 5 Jul 2023 17:07:59 -0400 Subject: [PATCH 17/22] Update tools/packaging/packaging.psm1 Co-authored-by: Travis Plunk --- tools/packaging/packaging.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index e6097e0488b..883c44e882a 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -50,7 +50,7 @@ function Start-PSPackage { [string]$Name = "powershell", # Ubuntu, CentOS, Fedora, macOS, and Windows packages are supported - [ValidateSet("msix", "deb", "osxpkg", "rpm", "rpm-fxdependent", "rpm-arm64-fxdependent", "msi", "zip", "zip-pdb", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size")] + [ValidateSet("msix", "deb", "osxpkg", "rpm", "rpm-fxdependent", "rpm-fxdependent-arm64", "msi", "zip", "zip-pdb", "nupkg", "tar", "tar-arm", "tar-arm64", "tar-alpine", "fxdependent", "fxdependent-win-desktop", "min-size")] [string[]]$Type, # Generate windows downlevel package From d6c91f1d32ac9f67d0531cdb4fc5019c19056fb3 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 5 Jul 2023 17:08:14 -0400 Subject: [PATCH 18/22] Update tools/packaging/packaging.psm1 Co-authored-by: Travis Plunk --- tools/packaging/packaging.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 883c44e882a..046b2e4ec0a 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -109,7 +109,7 @@ function Start-PSPackage { } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "rpm-fxdependent") { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } - } elseif ($Type.Count -eq 1 -and $Type[0] -eq "rpm-arm64-fxdependent") { + } elseif ($Type.Count -eq 1 -and $Type[0] -eq "rpm-fxdependent-arm64") { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-arm64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { From fc273cba41d790096393f101107df9cc82232f57 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 5 Jul 2023 17:10:35 -0400 Subject: [PATCH 19/22] Update tools/packaging/packaging.psm1 Co-authored-by: Travis Plunk --- tools/packaging/packaging.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 046b2e4ec0a..9ca1720966c 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -639,7 +639,7 @@ function Start-PSPackage { } } } - 'rpm-arm64-fxdependent' { + 'rpm-fxdependent-arm64' { $Arguments = @{ Type = 'rpm' PackageSourcePath = $Source From b1358e98fe9ac118eacccfeadc7d965977e3d00f Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 5 Jul 2023 17:10:46 -0400 Subject: [PATCH 20/22] Update tools/packaging/packaging.psm1 Co-authored-by: Travis Plunk --- tools/packaging/packaging.psm1 | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 9ca1720966c..c13a3579308 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -968,21 +968,6 @@ function New-UnixPackage { ) DynamicParam { - # if ($Type -eq "rpm-arm64-fxdependent") - # { - # # Add a dynamic parameter '-HostArchitecture' when the specified package type is 'rpm-fxdependent-arm64'. - # # The '-HostArchitecture' parameter is used to indicate which Mac processor this package is targeting, - # # Intel (x86_64) or arm (aarch64). - # $ParameterAttrHA = New-Object "System.Management.Automation.ParameterAttribute" - # $ValidateSetAttrHA = New-Object "System.Management.Automation.ValidateSetAttribute" -ArgumentList "x86_64", "aarch64" - # $AttributesHA = New-Object "System.Collections.ObjectModel.Collection``1[System.Attribute]" - # $AttributesHA.Add($ParameterAttrHA) > $null - # $AttributesHA.Add($ValidateSetAttrHA) > $null - # $ParameterHA = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("HostArchitecture", [string], $AttributesHA) - # $Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary" - # $Dict.Add("HostArchitecture", $ParameterHA) > $null - # $Type = "rpm" - # } if ($Type -eq "deb" -or $Type -like 'rpm*') { # Add a dynamic parameter '-Distribution' when the specified package type is 'deb'. # The '-Distribution' parameter can be used to indicate which Debian distro this pacakge is targeting. From ed20d44b9afc9391e7d536f904b18920609c2da7 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 5 Jul 2023 17:10:57 -0400 Subject: [PATCH 21/22] Update tools/packaging/packaging.psm1 Co-authored-by: Travis Plunk --- tools/packaging/packaging.psm1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index c13a3579308..d04714ca66e 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -1162,10 +1162,6 @@ function New-UnixPackage { $Arguments = @() - # if ($HostArchitecture -and $Type -eq "rpm") - # { - # $Arguments += @("-a", $HostArchitecture) - # } $Arguments += Get-FpmArguments ` -Name $Name ` From ef3d2638ae8d59f3c2694c839ff035d801209a62 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Wed, 5 Jul 2023 17:11:13 -0400 Subject: [PATCH 22/22] Update tools/ci.psm1 Co-authored-by: Travis Plunk --- tools/ci.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 2606d785b7e..060519d30a6 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -784,7 +784,7 @@ function New-LinuxPackage # Only build packages for PowerShell/PowerShell repository # branches, not pull requests - $packages = @(Start-PSPackage @packageParams -SkipReleaseChecks -Type deb, rpm, rpm-arm64-fxdependent, tar) + $packages = @(Start-PSPackage @packageParams -SkipReleaseChecks -Type deb, rpm, rpm-fxdependent-arm64, tar) foreach($package in $packages) { if (Test-Path $package)