-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ARM64 Win32 32bit emulation #1800
Comments
The ARM64 Win32 SDK is already out, so projects can produce ARM64 packages. Ideally, native (ARM64) would be preferred, then x86, but avoiding x64 on ARM64 is necessary. At the current moment there are no plans to ship x64 emulation, though I'd expect x86 emulation to outperform it for most workloads if it were to exist. |
Just ran into this this morning! I'll retry with |
This seems easy enough to add (famous last words I know). |
ARM64 ships x86 32-bit emulation, but as Microsoft (jkunkee) has indicated, there are no current plans to ship x86-64 emulation. It is preferred to automatically select 32bit architecture when the PROCESSOR_ARCHITECTURE is ARM64 to ensure successful installations on ARM64 architecture.
* stable: (chocolateyGH-1800) Prefer 32-bit when ARM64 Architecture
@vielmetti @joaocgreis Just made the changes and will be shipping a beta of this this morning for you to test out. |
A beta has been pushed up to the community repository - it will take awhile to go through moderation. You can get it quicker if you download it from this link: https://chocolatey.box.com/shared/static/szps4j8cuzdkgz8xhvxn3xvcaf9g6bvp.nupkg |
This has been committed to stable as of b30427d and will be in Chocolatey v0.10.14. |
Reporting success with (I thought that |
@vielmetti It likely does, but that isn't built into the package selection process - that would need to be done in each package to select the proper arch. That's a much bigger change that we'll need to communicate out wider with the community. |
@vielmetti just added #1803 - subscribe to that for better support of ARM architectures, at least from a packaging perspective. |
@jkunkee thanks for the quick feedback on this issue! |
@ferventcoder I tested the beta package and it does not work. The environment variable PS C:\> $env:PROCESSOR_ARCHITECTURE
x86
PS C:\> $env:PROCESSOR_ARCHITEW6432
ARM64 I was not aware of this difference in PowerShell when I opened this issue, I'm sorry for providing misleading information. I tested this change and it works: --- a/src/chocolatey.resources/helpers/functions/Get-OSArchitectureWidth.ps1
+++ b/src/chocolatey.resources/helpers/functions/Get-OSArchitectureWidth.ps1
@@ -53,7 +53,8 @@ param(
Write-FunctionCallLogMessage -Invocation $MyInvocation -Parameters $PSBoundParameters
$bits = 64
- if (([System.IntPtr]::Size -eq 4) -and (Test-Path env:\PROCESSOR_ARCHITEW6432)) {
+ $processorArchiteW6432 = $env:PROCESSOR_ARCHITEW6432
+ if ($processorArchiteW6432 -and $processorArchiteW6432 -eq 'AMD64') {
$bits = 64
} elseif ([System.IntPtr]::Size -eq 4) {
$bits = 32 @ferventcoder feel free to modify this as you see fit and commit, or let me know if I should open a PR. |
PowerShell runs emulated in ARM64 Windows systems. Thus, it is also necessary to check the PROCESSOR_ARCHITEW6432 to determine if Chocolatey should prefer 32-bit packages.
PowerShell runs emulated in ARM64 Windows systems. Thus, it is also necessary to check the PROCESSOR_ARCHITEW6432 to determine if Chocolatey should prefer 32-bit packages.
* pr1810: (GH-1800) Prefer 32-bit in ARM64 emulated PowerShell
* stable: (chocolateyGH-1788) Use LiteralPath in Get-UninstallRegistryKey (chocolateyGH-1800) Prefer 32-bit in ARM64 emulated PowerShell (doc) Corrected typo (maint) Corrected whitespace
When running on ARM64 Windows (
PROCESSOR_ARCHITECTURE
environment variable isARM64
orGet-WMIObject win32_Processor | Select-Object Architecture
returns 12), Chocolatey should default to install x86 packages instead of x64.This is because Windows can only emulate 32 bit x86. Running 64 bit executables is not supported. I don't know if there are plans to support ARM64 natively in the future, but for now this change would make Chocolatey run well.
cc @jkunkee @MichelLopez
What You Are Seeing?
On ARM64, packages that have a x64 version fail either during installation or when used.
If
--forcex86
is used, packages install and work well.What is Expected?
The x86 version should be installed without having to specify
--forcex86
when running on ARM64.How Did You Get This To Happen? (Steps to Reproduce)
Install any package with a x64 version on a ARM64 Windows machine.
Output Log
Full Log Output
The text was updated successfully, but these errors were encountered: