Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
build: fix arm64 cross-compile from powershell
Starting vcbuild.bat for cross-compiling from powershell was failing the
licensertf step because it couldn't find x64_node_exe after downloading.

PR-URL: #45890
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
StefanStojanovic authored and juanarbol committed Jan 31, 2023
1 parent aab35a9 commit 560ee24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vcbuild.bat
Expand Up @@ -420,13 +420,13 @@ if not defined licensertf goto stage_package

set "use_x64_node_exe=false"
if "%target_arch%"=="arm64" if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set "use_x64_node_exe=true"
set "x64_node_exe=temp-vcbuild\node-x64-cross-compiling.exe"
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'"
powershell -c "Invoke-WebRequest -Uri 'https://nodejs.org/dist/latest/win-x64/node.exe' -OutFile '%x64_node_exe%'"
)
if not exist "%x64_node_exe%" (
echo Could not find the Node executable at the given x64_node_exe path. Aborting.
Expand Down

0 comments on commit 560ee24

Please sign in to comment.