Skip to content

win,msi: use x64 node executable when cross-compiling for arm64

Builds further on https://github.com/nodejs/node/pull/33689

The last step to successfully create MSI installers for arm64 on a x64 host is to run the license2rtf script on the x64 host using a x64 Node executable. Based on @joaocgreis's comment in https://github.com/nodejs/node/pull/33689#pullrequestreview-426759240 I came up with some logic in vcbuild.bat which downloads the latest x64 Node executable if it's not present on the machine yet.

A variable called %x64_node_exe% can be passed by your CI pipeline so that the build machines don't have to download the x64 executable all the time.

IMPORTANT: when building an MSI for ARM64, WIX 3.14 or higher is required, as that version includes support for ARM64.

How to test

  • Run vcbuild.bat release msi arm64

Before applying this PR, the process fails with Failed to generate license.rtf (because the generated node.exe is for the arm64 architecture and therefore can't run on the x64 host).

After applying this PR, the process finishes successfully.

Refs: #25998 (closed) Refs: #32582 (closed)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading