Skip to content

Commit 6720624

Browse files
dennisamelingBethGriggs
authored andcommitted
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: #25998 Refs: #32582 PR-URL: #34009 Reviewed-By: James M Snell <[email protected]> Reviewed-By: João Reis <[email protected]>
1 parent 916ab9e commit 6720624

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ _UpgradeReport_Files/
130130
# Ignore dependencies fetched by deps/v8/tools/node/fetch_deps.py
131131
/deps/.cipd
132132

133+
# === Rules for Windows vcbuild.bat ===
134+
/temp-vcbuild
135+
133136
# === Global Rules ===
134137
# Keep last to avoid being excluded
135138
*.pyc

BUILDING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@ Optional requirements to build the MSI installer package:
545545
* The [WiX Toolset v3.11](https://wixtoolset.org/releases/) and the
546546
[Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension)
547547
or the [Wix Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension).
548+
* The [WiX Toolset v3.14](https://wixtoolset.org/releases/) if
549+
building for Windows 10 on ARM (ARM64).
548550

549551
Optional requirements for compiling for Windows 10 on ARM (ARM64):
550552

vcbuild.bat

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,26 @@ if errorlevel 1 echo Failed to sign exe&goto exit
397397
@rem Skip license.rtf generation if not requested.
398398
if not defined licensertf goto stage_package
399399

400-
%node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf
400+
set "use_x64_node_exe=false"
401+
if "%target_arch%"=="arm64" if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set "use_x64_node_exe=true"
402+
if "%use_x64_node_exe%"=="true" (
403+
echo Cross-compilation to ARM64 detected. We'll use the x64 Node executable for license2rtf.
404+
if not defined "%x64_node_exe%" set "x64_node_exe=temp-vcbuild\node-x64-cross-compiling.exe"
405+
if not exist "%x64_node_exe%" (
406+
echo Downloading x64 node.exe...
407+
if not exist "temp-vcbuild" mkdir temp-vcbuild
408+
powershell -c "Invoke-WebRequest -Uri 'https://nodejs.org/dist/latest/win-x64/node.exe' -OutFile 'temp-vcbuild\node-x64-cross-compiling.exe'"
409+
)
410+
if not exist "%x64_node_exe%" (
411+
echo Could not find the Node executable at the given x64_node_exe path. Aborting.
412+
set exit_code=1
413+
goto exit
414+
)
415+
%x64_node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf
416+
) else (
417+
%node_exe% tools\license2rtf.js < LICENSE > %config%\license.rtf
418+
)
419+
401420
if errorlevel 1 echo Failed to generate license.rtf&goto exit
402421

403422
:stage_package

0 commit comments

Comments
 (0)