build,win: use x64 Node when building for ARM64

Uses x64 node executable for running .js files in arm64
cross-compilation scenarios. MSI can now be created by
running `vcbuild.bat release msi arm64`

Refs: https://github.com/nodejs/node/issues/25998
Refs: https://github.com/nodejs/node/issues/32582
PR-URL: https://github.com/nodejs/node/pull/34009
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: João Reis <reis@janeasystems.com>
This commit is contained in:
Dennis Ameling
2020-06-22 11:22:42 +02:00
committed by João Reis
parent 5acc69cdad
commit 03293aa3a1
3 changed files with 25 additions and 1 deletions

3
.gitignore vendored
View File

@@ -131,6 +131,9 @@ _UpgradeReport_Files/
# Ignore dependencies fetched by deps/v8/tools/node/fetch_deps.py
/deps/.cipd
# === Rules for Windows vcbuild.bat ===
/temp-vcbuild
# === Global Rules ===
# Keep last to avoid being excluded
*.pyc

View File

@@ -544,6 +544,8 @@ Optional requirements to build the MSI installer package:
* The [WiX Toolset v3.11](https://wixtoolset.org/releases/) and the
[Wix Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension).
* The [WiX Toolset v3.14](https://wixtoolset.org/releases/) if
building for Windows 10 on ARM (ARM64).
Optional requirements for compiling for Windows 10 on ARM (ARM64):

View File

@@ -362,7 +362,26 @@ if errorlevel 1 echo Failed to sign exe&goto exit
@rem Skip license.rtf generation if not requested.
if not defined licensertf goto stage_package
%node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf
set "use_x64_node_exe=false"
if "%target_arch%"=="arm64" if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set "use_x64_node_exe=true"
if "%use_x64_node_exe%"=="true" (
echo Cross-compilation to ARM64 detected. We'll use the x64 Node executable for license2rtf.
if not defined "%x64_node_exe%" set "x64_node_exe=temp-vcbuild\node-x64-cross-compiling.exe"
if not exist "%x64_node_exe%" (
echo Downloading x64 node.exe...
if not exist "temp-vcbuild" mkdir temp-vcbuild
powershell -c "Invoke-WebRequest -Uri 'https://nodejs.org/dist/latest/win-x64/node.exe' -OutFile 'temp-vcbuild\node-x64-cross-compiling.exe'"
)
if not exist "%x64_node_exe%" (
echo Could not find the Node executable at the given x64_node_exe path. Aborting.
set exit_code=1
goto exit
)
%x64_node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf
) else (
%node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf
)
if errorlevel 1 echo Failed to generate license.rtf&goto exit
:stage_package