From f8b0ae3ca316de8b53ca6f5f4cd39ae6964e47c4 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Mon, 9 Oct 2023 14:54:38 -0700 Subject: [PATCH] Fix alpine tar package name and do not crossgen alpine fxdependent package (#20459) --- build.psm1 | 8 ++++---- tools/packaging/packaging.psm1 | 10 +++++----- .../Images/GenericLinuxFiles/PowerShellPackage.ps1 | 2 +- tools/releaseBuild/azureDevOps/templates/nuget.yml | 2 +- .../templates/release-ValidatePackageNames.yml | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.psm1 b/build.psm1 index 27b0e493e4c..ec95e071bf7 100644 --- a/build.psm1 +++ b/build.psm1 @@ -273,7 +273,7 @@ function Test-IsReleaseCandidate return $false } -$optimizedFddRegex = 'fxdependent-(linux|linux-musl|win|win7|osx)-(x64|x86|arm64|arm)' +$optimizedFddRegex = 'fxdependent-(linux|win|win7|osx)-(x64|x86|arm64|arm)' function Start-PSBuild { [CmdletBinding(DefaultParameterSetName="Default")] @@ -309,7 +309,7 @@ function Start-PSBuild { # If this parameter is not provided it will get determined automatically. [ValidateSet("linux-musl-x64", "fxdependent", - "fxdependent-linux-musl-x64", + "fxdependent-noopt-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", @@ -563,7 +563,7 @@ Fix steps: Write-Verbose "Building with shim" -Verbose $globalToolSrcFolder = Resolve-Path (Join-Path $Options.Top "../Microsoft.PowerShell.GlobalTool.Shim") | Select-Object -ExpandProperty Path - if ($Options.Runtime -eq 'fxdependent') { + if ($Options.Runtime -eq 'fxdependent' -or $Options.Runtime -eq 'fxdependent-noopt-linux-musl-x64') { $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk" } elseif ($Options.Runtime -eq 'fxdependent-win-desktop') { $Arguments += "/property:SDKToUse=Microsoft.NET.Sdk.WindowsDesktop" @@ -900,7 +900,7 @@ function New-PSOptions { [ValidateSet("", "linux-musl-x64", "fxdependent", - "fxdependent-linux-musl-x64", + "fxdependent-noopt-linux-musl-x64", "fxdependent-linux-x64", "fxdependent-linux-arm64", "fxdependent-win-desktop", diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 30148f0d503..a6575088090 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -115,7 +115,7 @@ function Start-PSPackage { New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-arm64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } elseif ($Type.Count -eq 1 -and $Type[0] -eq "tar-alpine-fxdependent") { - New-PSOptions -Configuration "Release" -Runtime 'fxdependent-linux-musl-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } + New-PSOptions -Configuration "Release" -Runtime 'fxdependent-noopt-linux-musl-x64' -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } } else { New-PSOptions -Configuration "Release" -WarningAction SilentlyContinue | ForEach-Object { $_.Runtime, $_.Configuration } @@ -456,11 +456,11 @@ function Start-PSPackage { $Arguments = @{ PackageSourcePath = $Source Name = $Name - PackageNameSuffix = 'alpine-fxdependent' + PackageNameSuffix = 'musl-noopt-fxdependent' Version = $Version Force = $Force R2RVerification = [R2RVerification]@{ - R2RState = 'R2R' + R2RState = 'NoR2R' OperatingSystem = "Linux" } } @@ -594,7 +594,7 @@ function Start-PSPackage { Name = $Name Version = $Version Force = $Force - Architecture = "linux-musl-x64" + Architecture = "musl-x64" ExcludeSymbolicLinks = $true R2RVerification = [R2RVerification]@{ R2RState = 'R2R' @@ -4606,7 +4606,7 @@ function Invoke-AzDevOpsLinuxPackageBuild { Remove-Item -Path $binDir -Recurse -Force } - $buildParams['Runtime'] = 'fxdependent-linux-musl-x64' + $buildParams['Runtime'] = 'fxdependent-noopt-linux-musl-x64' $buildFolder = "${env:SYSTEM_ARTIFACTSDIRECTORY}/${amd64AlpineFxdBuildFolder}" Start-PSBuild -Clean @buildParams @releaseTagParam -Output $buildFolder -PSOptionsPath "${buildFolder}-meta/psoptions.json" # Remove symbol files, xml document files. diff --git a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 index ae04aed5ea3..2475dce7d89 100644 --- a/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 +++ b/tools/releaseBuild/Images/GenericLinuxFiles/PowerShellPackage.ps1 @@ -59,7 +59,7 @@ function BuildPackages { $buildParams.Add("Runtime", "fxdependent") } elseif ($Alpine.IsPresent) { $projectAssetsZipName = 'linuxAlpineProjectAssetssymbols.zip' - $buildParams.Add("Runtime", 'linux-musl-x64') + $buildParams.Add("Runtime", 'musl-x64') } else { # make the artifact name unique $projectAssetsZipName = "linuxProjectAssets-$((Get-Date).Ticks)-symbols.zip" diff --git a/tools/releaseBuild/azureDevOps/templates/nuget.yml b/tools/releaseBuild/azureDevOps/templates/nuget.yml index 749956682d3..247e91013a3 100644 --- a/tools/releaseBuild/azureDevOps/templates/nuget.yml +++ b/tools/releaseBuild/azureDevOps/templates/nuget.yml @@ -111,7 +111,7 @@ jobs: - task: ExtractFiles@1 displayName: 'Extract files alpine-fxdependent' inputs: - archiveFilePatterns: '$(System.ArtifactsDirectory)/packages/powershell-*-linux-x64-alpine-fxdependent.tar.gz' + archiveFilePatterns: '$(System.ArtifactsDirectory)/packages/powershell-*-linux-x64-musl-noopt-fxdependent.tar.gz' destinationFolder: '$(alpineFxdPath)' - template: SetVersionVariables.yml diff --git a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml index a00ac4a8573..1fb5364302b 100644 --- a/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml +++ b/tools/releaseBuild/azureDevOps/templates/release-ValidatePackageNames.yml @@ -44,7 +44,7 @@ steps: - pwsh: | $message = @() Get-ChildItem $(System.ArtifactsDirectory)\* -recurse -filter *.tar.gz | ForEach-Object { - if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-alpine\-fxdependent)\.(tar\.gz)') + if($_.Name -notmatch 'powershell-(lts-)?\d+\.\d+\.\d+\-([a-z]*.\d+\-)?(linux|osx|linux-musl)+\-(x64\-fxdependent|x64|arm32|arm64|x64\-musl\-fxdependent)\.(tar\.gz)') { $messageInstance = "$($_.Name) is not a valid package name" $message += $messageInstance