Skip to content

Commit

Permalink
build,win: use x64 Node when building for ARM64
Browse files Browse the repository at this point in the history
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: #25998
Refs: #32582
PR-URL: #34009
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: João Reis <[email protected]>
  • Loading branch information
dennisameling authored and BethGriggs committed Aug 20, 2020
1 parent 3133b75 commit 6048421
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,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
Expand Down
2 changes: 2 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ Optional requirements to build the MSI installer package:
* The [WiX Toolset v3.11](https://wixtoolset.org/releases/) and the
[Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension)
or 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):

Expand Down
21 changes: 20 additions & 1 deletion vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,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
Expand Down

0 comments on commit 6048421

Please sign in to comment.