@@ -193,7 +193,7 @@ function Get-EnvironmentInformation
193193 $environment += @ {' IsRedHatFamily' = $environment.IsCentOS -or $environment.IsFedora -or $environment.IsRedHat }
194194 $environment += @ {' IsSUSEFamily' = $environment.IsSLES -or $environment.IsOpenSUSE }
195195 $environment += @ {' IsAlpine' = $LinuxInfo.ID -match ' alpine' }
196- $environment += @ {' IsMariner' = $LinuxInfo.ID -match ' mariner' }
196+ $environment += @ {' IsMariner' = $LinuxInfo.ID -match ' mariner' -or $LinuxInfo .ID -match ' azurelinux ' }
197197
198198 # Workaround for temporary LD_LIBRARY_PATH hack for Fedora 24
199199 # https://github.com/PowerShell/PowerShell/issues/2511
@@ -353,8 +353,8 @@ function Start-PSBuild {
353353 $PSModuleRestore = $true
354354 }
355355
356- if ($Runtime -eq " linux-arm" -and $environment.IsLinux -and -not $environment.IsUbuntu ) {
357- throw " Cross compiling for linux-arm is only supported on Ubuntu environment"
356+ if ($Runtime -eq " linux-arm" -and $environment.IsLinux -and -not $environment.IsUbuntu -and -not $environment .IsMariner ) {
357+ throw " Cross compiling for linux-arm is only supported on AzureLinux/ Ubuntu environment"
358358 }
359359
360360 if (" win-arm" , " win-arm64" -contains $Runtime -and -not $environment.IsWindows ) {
@@ -2207,6 +2207,8 @@ function Get-RedHatPackageManager {
22072207 " yum install -y -q"
22082208 } elseif ($environment.IsFedora -or (Get-Command - Name dnf - CommandType Application - ErrorAction SilentlyContinue)) {
22092209 " dnf install -y -q"
2210+ } elseif ($environment.IsMariner -or (Get-Command - Name Test-DscConfiguration - CommandType Application - ErrorAction SilentlyContinue)) {
2211+ " tdnf install -y -q"
22102212 } else {
22112213 throw " Error determining package manager for this distribution."
22122214 }
@@ -2278,8 +2280,8 @@ function Start-PSBootstrap {
22782280 # Note that when it is null, Invoke-Expression (but not &) must be used to interpolate properly
22792281 $sudo = if (! $NoSudo ) { " sudo" }
22802282
2281- if ($BuildLinuxArm -and $environment.IsLinux -and -not $environment.IsUbuntu ) {
2282- Write-Error " Cross compiling for linux-arm is only supported on Ubuntu environment"
2283+ if ($BuildLinuxArm -and $environment.IsLinux -and -not $environment.IsUbuntu -and -not $environment .IsMariner ) {
2284+ Write-Error " Cross compiling for linux-arm is only supported on AzureLinux/ Ubuntu environment"
22832285 return
22842286 }
22852287
0 commit comments