Skip to content

Commit

Permalink
updating build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Jun 6, 2024
1 parent fb9f30c commit 3b7c19f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
25 changes: 21 additions & 4 deletions tools/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,24 @@ if "%1" neq "" (
shift
goto :harvestVersions
)
if "%VERSIONS%" equ "" set VERSIONS=0.10.0
if "%VERSIONS%" equ "" set VERSIONS=20.14.0
pushd %SELF%\..
for %%V in (%VERSIONS%) do call :build ia32 x86 %%V
for %%V in (%VERSIONS%) do call :build x64 x64 %%V

if "%PROCESSOR_ARCHITECTURE%" == "ARM64" (
for %%V in (%VERSIONS%) do call :build arm64 arm64 %%V
) else (
for %%V in (%VERSIONS%) do call :build ia32 x86 %%V
for %%V in (%VERSIONS%) do call :build x64 x64 %%V

)
popd

exit /b 0

:build

set DESTDIR=%DESTDIRROOT%\%1\%3

if exist "%DESTDIR%\node.exe" goto gyp
if not exist "%DESTDIR%\NUL" mkdir "%DESTDIR%"
echo Downloading node.exe %2 %3...
Expand All @@ -56,12 +63,22 @@ if not exist "%GYP%" (
exit /b -1
)

"%NODEEXE%" "%GYP%" configure build --msvs_version=2019 -%FLAVOR%
"%NODEEXE%" "%GYP%" configure --msvs_version=2022 -%FLAVOR%
if %ERRORLEVEL% neq 0 (
echo Error building edge.node %FLAVOR% for node.js %2 v%3
exit /b -1
)

REM Conflict when building arm64 binaries
if "%PROCESSOR_ARCHITECTURE%" == "ARM64" (
FOR %%F IN (build\*.vcxproj) DO (
echo Patch /fp:strict in %%F
powershell -Command "(Get-Content -Raw %%F) -replace '<FloatingPointModel>Strict</FloatingPointModel>', '<!-- <FloatingPointModel>Strict</FloatingPointModel> -->' | Out-File -Encoding Utf8 %%F"
)
)

"%NODEEXE%" "%GYP%" build

echo %DESTDIR%
copy /y .\build\%FLAVOR%\edge_*.node "%DESTDIR%"
if %ERRORLEVEL% neq 0 (
Expand Down
20 changes: 10 additions & 10 deletions tools/download_double.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
var {http} = require('follow-redirects');


console.log('Trying download from', process.argv[2]);
http.get(process.argv[2], function (res) {
console.log('HTTP', res.statusCode);
if (res.statusCode !== 200) {
throw new Error(`Unable to download ${process.argv[2]}`);
}

var stream = require('fs').createWriteStream(process.argv[3]);
res.pipe(stream);
});
console.log('Trying download from', process.argv[2]);
http.get(process.argv[2], function (res) {
console.log('HTTP', res.statusCode);
if (res.statusCode !== 200) {
throw new Error(`Unable to download ${process.argv[2]}`);
}

var stream = require('fs').createWriteStream(process.argv[3]);
res.pipe(stream);
});

2 changes: 1 addition & 1 deletion tools/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (!process.env.EDGE_USE_CORECLR) {
buildParameters = buildParameters.concat(['-sdk:4.5']);
}

var compiler = runner === 'circleci' || runner === 'CI' ? 'C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe' : 'csc'
var compiler = 'C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe'

run(process.platform === 'win32' ? compiler : 'mcs', buildParameters, runOnSuccess);
}
Expand Down

0 comments on commit 3b7c19f

Please sign in to comment.