@@ -33,6 +33,7 @@ $script:IsNix = $IsLinux -or $IsMacOS
33
33
# For Apple M1, pwsh might be getting emulated, in which case we need to check
34
34
# for the proc_translated flag, otherwise we can check the architecture.
35
35
$script :IsAppleM1 = $IsMacOS -and ((sysctl - n sysctl.proc_translated) -eq 1 -or (uname - m) -eq " arm64" )
36
+ $script :IsArm64 = $IsWindows -and $env: PROCESSOR_ARCHITECTURE -eq " AMD64"
36
37
$script :BuildInfoPath = [System.IO.Path ]::Combine($PSScriptRoot , " src" , " PowerShellEditorServices.Hosting" , " BuildInfo.cs" )
37
38
$script :PsesCommonProps = [xml ](Get-Content - Raw " $PSScriptRoot /PowerShellEditorServices.Common.props" )
38
39
@@ -62,7 +63,7 @@ task FindDotNet {
62
63
63
64
# Anywhere other than on a Mac with an M1 processor, we additionally
64
65
# need the .NET 3.1 runtime for our netcoreapp3.1 framework.
65
- if (! $script :IsAppleM1 ) {
66
+ if (-not $script :IsAppleM1 -and -not $ script :IsArm64 ) {
66
67
$runtimes = dotnet -- list- runtimes
67
68
assert ($runtimes -match " Microsoft.NETCore.App 3.1" ) " .NET Runtime 3.1 required but not found!"
68
69
}
@@ -183,7 +184,7 @@ Task TestServerWinPS -If (-not $script:IsNix) Build, SetupHelpForTests, {
183
184
exec { & dotnet $script :dotnetTestArgs $script :NetRuntime.Desktop }
184
185
}
185
186
186
- task TestServerPS7 - If (-not $script :IsAppleM1 ) Build, SetupHelpForTests, {
187
+ task TestServerPS7 - If (-not $script :IsAppleM1 -and -not $ script :IsArm64 ) Build, SetupHelpForTests, {
187
188
Set-Location .\test\PowerShellEditorServices.Test\
188
189
exec { & dotnet $script :dotnetTestArgs $script :NetRuntime.PS7 }
189
190
}
@@ -197,7 +198,7 @@ task TestE2E Build, SetupHelpForTests, {
197
198
Set-Location .\test\PowerShellEditorServices.Test.E2E\
198
199
199
200
$env: PWSH_EXE_NAME = if ($IsCoreCLR ) { " pwsh" } else { " powershell" }
200
- $NetRuntime = if ($IsAppleM1 ) { $script :NetRuntime.PS72 } else { $script :NetRuntime.PS7 }
201
+ $NetRuntime = if ($IsAppleM1 -or $ script :IsArm64 ) { $script :NetRuntime.PS72 } else { $script :NetRuntime.PS7 }
201
202
exec { & dotnet $script :dotnetTestArgs $NetRuntime }
202
203
203
204
# Run E2E tests in ConstrainedLanguage mode.
0 commit comments