Skip to content
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 Windows desktop #25998

Closed
jkunkee opened this issue Feb 7, 2019 · 55 comments · Fixed by #47233
Closed

Support ARM64 Windows desktop #25998

jkunkee opened this issue Feb 7, 2019 · 55 comments · Fixed by #47233
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI. feature request Issues that request new features to be added to Node.js. windows Issues and PRs related to the Windows platform.

Comments

@jkunkee
Copy link
Contributor

jkunkee commented Feb 7, 2019

Is your suggestion related to a problem?
At present the Electron project does not support the new Windows 10 on ARM (ARM64 Win32) platform. One of its dependencies is Node.js, which also does not support it. This means that on these devices Electron apps run emulated which, with the complexity of Electron, means a suboptimal user experience.

Describe the solution you'd like
I would like Node.js to support Windows 10 on ARM. Ideally this would include any tweaks needed to make Electron embedding easier, and I would be pleased as punch to see Node.js host ARM64 Windows EXEs on its main page.

Describe alternatives you've considered
As mentioned earlier, Windows 10 on ARM includes an IA32 emulation layer that runs Node.js. This works well for many applications, but my prototype ARM64 build of Node.js runs much faster in significantly less memory.

@jkunkee
Copy link
Contributor Author

jkunkee commented Feb 8, 2019

Per my message to the mailing list, this is not a simple request, but it is one for which I'm willing to do most of the heavy lifting.

This was also discussed in the build repo: nodejs/build#1138

My prototyping branch is here:
https://github.com/jkunkee/node/tree/arm64

Branch with everything merged so it builds and passes tests:
https://github.com/jkunkee/node/tree/wip/arm64-merged-for-build

Node.js changes:

Bonus changes:

Needed deps updates:

@refack
Copy link
Contributor

refack commented Feb 8, 2019

  • GYP (necessary change not yet upstream)

What's needed from GYP?
Happy to accept PRs to https://github.com/refack/GYP

@jkunkee
Copy link
Contributor Author

jkunkee commented Feb 8, 2019

OpenSSL config PR: #26001

@jkunkee
Copy link
Contributor Author

jkunkee commented Feb 8, 2019

@refack, here you go: refack/GYP3#23

@ChALkeR ChALkeR added arm Issues and PRs related to the ARM platform. windows Issues and PRs related to the Windows platform. build Issues and PRs related to build files or the CI. labels Feb 8, 2019
@jkunkee
Copy link
Contributor Author

jkunkee commented Feb 9, 2019

refack/GYP3#23 also submitted as #26020 so it can be merged sooner.

@jefgen
Copy link

jefgen commented Feb 11, 2019

FYI, @jkunkee the ARM64 change for ICU is here: unicode-org/icu#412, and the ICU issue/ticket is: ICU-20382.

@jkunkee
Copy link
Contributor Author

jkunkee commented Feb 11, 2019

(progress-tracking comment updated)

@jkunkee
Copy link
Contributor Author

jkunkee commented Feb 11, 2019

For those interested, my hope is for Electron 6 to support Windows 10 on ARM (natively, not via emulation). electron/electron#16876

@jkunkee
Copy link
Contributor Author

jkunkee commented Feb 19, 2019

[EDIT: merged info into earlier comment]

@joaocgreis joaocgreis reopened this Apr 4, 2019
BethGriggs pushed a commit that referenced this issue Apr 9, 2019
This adds ARM64 Windows support in the OpenSSL build system.

Since OpenSSL's ARM64 Windows support does not have support for ASM--
that is, VC-WIN64-ARM inherits from VC-noCE-common which has no ASM
files--`openssl_no_asm.gypi` is always used for building. This
essentially forces the 'no-asm' Configure flag.

PR-URL: #26001
Fixes: #25998
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Signed-off-by: Beth Griggs <[email protected]>
BethGriggs pushed a commit that referenced this issue Apr 9, 2019
This change adds the generated files required for building OpenSSL for
Node.js for ARM64 Windows. I did this on a VM running Ubuntu 18.04. The
basic workflow is to cd to deps/openssl/config and run `make`,
installing any needed packages until all architectures build correctly.

Note that OpenSSL 1.1.1 does not support ASM on ARM64 Windows, so this
change also supports only no-asm on ARM64 Windows.

PR-URL: #26001
Fixes: #25998
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Signed-off-by: Beth Griggs <[email protected]>
BethGriggs pushed a commit that referenced this issue Apr 10, 2019
This adds ARM64 Windows support in the OpenSSL build system.

Since OpenSSL's ARM64 Windows support does not have support for ASM--
that is, VC-WIN64-ARM inherits from VC-noCE-common which has no ASM
files--`openssl_no_asm.gypi` is always used for building. This
essentially forces the 'no-asm' Configure flag.

PR-URL: #26001
Fixes: #25998
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Signed-off-by: Beth Griggs <[email protected]>
BethGriggs pushed a commit that referenced this issue Apr 10, 2019
This change adds the generated files required for building OpenSSL for
Node.js for ARM64 Windows. I did this on a VM running Ubuntu 18.04. The
basic workflow is to cd to deps/openssl/config and run `make`,
installing any needed packages until all architectures build correctly.

Note that OpenSSL 1.1.1 does not support ASM on ARM64 Windows, so this
change also supports only no-asm on ARM64 Windows.

PR-URL: #26001
Fixes: #25998
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Signed-off-by: Beth Griggs <[email protected]>
joaocgreis pushed a commit that referenced this issue Apr 11, 2019
The toolchain for ARM64 Windows includes support for assembly code, but
with a very different syntax from MASM and NASM. This change teaches
GYP how to emit the right XML tags in VCXPROJ files to support
compiling assembly files with the new tool.

PR-URL: #26020
Refs: #25998
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: João Reis <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
sam-github pushed a commit to sam-github/node that referenced this issue Apr 29, 2019
This adds ARM64 Windows support in the OpenSSL build system.

Since OpenSSL's ARM64 Windows support does not have support for ASM--
that is, VC-WIN64-ARM inherits from VC-noCE-common which has no ASM
files--`openssl_no_asm.gypi` is always used for building. This
essentially forces the 'no-asm' Configure flag.

PR-URL: nodejs#26001
Fixes: nodejs#25998
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Signed-off-by: Beth Griggs <[email protected]>
@wegylexy
Copy link

never mind, I've switched to .NET 6

@ac1982
Copy link

ac1982 commented May 25, 2021

Latest 16.2.0 has unofficial build on https://unofficial-builds.nodejs.org/download/release/v16.2.0/

@ntindle
Copy link

ntindle commented Sep 22, 2021

fwiw, building node.js from src on windows arm64 works just fine. Our challenge right now is that we don't have the windows arm64 resources available consistently in CI to test regularly or build release binaries. We're working on that.

Has there been much progress on this? Azure DevOps lists this as a dependency for Windows on Arm Azure Pipelines.

microsoft/azure-pipelines-agent#2062 (comment)

@Alovchin91
Copy link

Hi, can anybody share the steps to release unofficial Node.js builds on Windows arm64? Right now it's all based on the best effort, but we will need to start releasing our products with Windows arm64 support really soon so I'd like to help keeping it up to date.

@dennisameling
Copy link
Contributor

dennisameling commented Nov 25, 2021

The team is waiting for machines they can use in their CI: nodejs/build#2540

For anyone who's interested, you can build NodeJS ARM64 yourself today by doing the following:

  • Install Wix Toolset 3.14
  • Fork/clone the NodeJS repo
  • git checkout v16.13.0 (or whatever version you want to build)
  • .\vcbuild.bat arm64 release msi

Currently, Windows ARM64 is "guaranteed to build" as it's in Tier 2 for compiling: https://github.com/nodejs/node/blob/master/BUILDING.md#strategy - so this should work without problems in future versions as well.

Here's a recent 16.13.0 build from a few days ago: https://github.com/dennisameling/node/releases/tag/v16.13.0-arm64

@pb5050
Copy link

pb5050 commented Dec 30, 2021

The team is waiting for machines they can use in their CI: nodejs/build#2540

For anyone who's interested, you can build NodeJS ARM64 yourself today by doing the following:

  • Install Wix Toolset 3.14
  • Fork/clone the NodeJS repo
  • git checkout v16.13.0 (or whatever version you want to build)
  • .\vcbuild.bat arm64 release msi

Currently, Windows ARM64 is "guaranteed to build" as it's in Tier 2 for compiling: https://github.com/nodejs/node/blob/master/BUILDING.md#strategy - so this should work without problems in future versions as well.

Here's a recent 16.13.0 build from a few days ago: https://github.com/dennisameling/node/releases/tag/v16.13.0-arm64

you great a great grreat contributor i see you everywhere windows should pay you for all the work and advancement you have done for windows on arm

keep it up! you inspire

@pb5050
Copy link

pb5050 commented Jan 19, 2022

Thankyou for your continued support for Windows ARM64. Will you be publishing a pre built installer at https://nodejs.org/en/download/ ?

any plans on this? seems like its time

@hajekj
Copy link

hajekj commented Apr 5, 2022

I believe obtaining build agents should now be much more easier thanks to Arm-based processors coming to Azure: https://azure.microsoft.com/en-us/blog/now-in-preview-azure-virtual-machines-with-ampere-altra-armbased-processors/

If needed I can provide a part of my subscription to host the required VMs.

If you need to get in touch with me regarding this, please reach out at: [email protected]

@nonsenseless
Copy link

nonsenseless commented Jul 20, 2022

  • Install Wix Toolset 3.14
  • Fork/clone the NodeJS repo
  • git checkout v16.13.0 (or whatever version you want to build)
  • .\vcbuild.bat arm64 release msi

@dennisameling Thank you for the notes! I was able to install wix 3.14 and added a path variable for WIX, but I'm wondering if there are any other environment config steps I should be aware of? I'm getting the following error running the script:

Looking for Python
Python found in C:\Python310\\python.exe
Looking for Visual Studio 2019
Looking for Visual Studio 2017
Looking for WiX installation for Visual Studio 2017...
Failed to find the WiX Toolset Visual Studio 2017 Extension
Failed to find a suitable Visual Studio installation.
Try to run in a "Developer Command Prompt" or consult
https://github.com/nodejs/node/blob/HEAD/BUILDING.md#windows

and I'm afraid to dick around with vcbat much further since (I believe) VS 2022 is the first version to support arm64. The error seems to be tied to VCINSTALLDIR being null; do you have any idea what might be going wrong?

Edit: The same thing happens whether I try running from cmd, a developer prompt launched by visual studio, git bash, or power shell.

@sxa
Copy link
Member

sxa commented Jul 21, 2022

@nonsenseless Which VS version do you have installed? We've built it with 2019 without problems so if you have that and it's not detected that would be a problem (VS2019 what's on our build machines)

@richardlau
Copy link
Member

Not sure whether ARM64 differs, but on x64 you need both the Wix Toolset and the WiX Toolset Visual Studio Extension (we're using the VS 2019 version in our CI).

@nonsenseless
Copy link

@richardlau I went back and I realize that when I tried to install VS2019 and it gave me a stability warning about not being supported on ARM64 I interpreted that as "You can't install this" instead of as "Good luck". I pressed through, installed, added the wix extension for 2019, and then the build steps worked for the version I'd pulled down. Thank you for your help!

@jkunkee
Copy link
Contributor Author

jkunkee commented Jul 21, 2022

I'm happy to hear you're making progress, @nonsenseless!

since (I believe) VS 2022 is the first version to support arm64
it gave me a stability warning about not being supported on ARM64
"Good luck"

Got there in the end. The VS team would have worded that carefully to help forestall perf and functionality bugs that their dev and triage processes was not equipped to handle. "Good luck" is the right interpretation, though it could also be seen as "yes, we know it's slow, no, it's not a bug" or "we won't chase down broken corner cases if there are any." The goal of the x86 and x64 emulators is that apps--even ones as complex as VS--just work, unmodified. :)

As you've figured out, VS 2022 is the first to officially support running on ARM64. On ARM64 Windows 11 (which has the ARM64 and x64 .NET Frameworks as well as x86), devenv.exe, msbuild.exe, cl.exe, csc.exe--everything runs natively without emulation. (You can use varargs.cmd to force the use of x64- or x86-hosted tools just as on x64; they'll just run slower.)

IIRC, VS has supported generating ARM64 code officially since VS 2019, with experimental support introduced later in VS 2017. (I believe I used VS 2017 to bootstrap the Node.js build for ARM64 Windows.)

VS 2022 is also getting support for ARM64EC, an emulation-compatible native ABI. There are some fun possibilities here for Node.js (think native ARM64 JIT with x64 binary module compat), but they are neither trivial nor salient to this thread. :)

simonbuchan added a commit to simonbuchan/native-reg that referenced this issue Jul 22, 2022
Needed for ARM, which is presently not supported by prebuildify due to lack of official node builds:
nodejs/node#25998
@github-actions
Copy link
Contributor

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Jan 18, 2023
@Alovchin91
Copy link

Nope, not so fast! By now you have everything in place to implement this.

@github-actions github-actions bot removed the stale label Jan 19, 2023
@Blackhex
Copy link
Contributor

Blackhex commented Jan 20, 2023

We are also looking into this. So far only #46231 and #46420 seem to be issues to compile Node on Windows ARM64 with VS 2022.

@joespeed
Copy link

joespeed commented Feb 5, 2023

fixed per @eukarpov #46231 (comment)

@sxa
Copy link
Member

sxa commented Feb 6, 2023

Note that in terms of activity on this front, most of the discussion has been happening over in nodejs/build#3046 and it is being built as part of our regular CI runs - it just hasn't made it to being a production release platform yet.

StefanStojanovic added a commit to JaneaSystems/node that referenced this issue Mar 23, 2023
nodejs-github-bot pushed a commit that referenced this issue Mar 30, 2023
Refs: nodejs/build#3046
Refs: nodejs/build#2540
Fixes: #25998
PR-URL: #47233
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
RafaelGSS pushed a commit that referenced this issue Apr 5, 2023
Refs: nodejs/build#3046
Refs: nodejs/build#2540
Fixes: #25998
PR-URL: #47233
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
RafaelGSS pushed a commit that referenced this issue Apr 6, 2023
Refs: nodejs/build#3046
Refs: nodejs/build#2540
Fixes: #25998
PR-URL: #47233
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
RafaelGSS pushed a commit that referenced this issue Apr 7, 2023
Refs: nodejs/build#3046
Refs: nodejs/build#2540
Fixes: #25998
PR-URL: #47233
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI. feature request Issues that request new features to be added to Node.js. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.