From ff3d2a70cd042180137da78cc58c9f9b82b904a0 Mon Sep 17 00:00:00 2001 From: Bogdan Lobor Date: Thu, 24 Mar 2016 09:52:27 +0200 Subject: [PATCH 1/5] build, windows: build and test add-ons on test-ci added build-addons task, it allows to build and test native addons during test-ci task. Basicaly it should work in same way like Makefile "build-addons" task. --- vcbuild.bat | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 7c4c7bd7417c88..082b3a03aca2e7 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -36,6 +36,7 @@ set release_urls_arg= set build_release= set enable_vtune_arg= set configure_flags= +set build_addons= :next-arg if "%1"=="" goto args-done @@ -55,7 +56,7 @@ if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok if /i "%1"=="test" set test_args=%test_args% sequential parallel message -J&set jslint=1&goto arg-ok -if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap message sequential parallel&goto arg-ok +if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons message sequential parallel&set build_addons=1&goto arg-ok if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok if /i "%1"=="test-gc" set test_args=%test_args% gc&set buildnodeweak=1&goto arg-ok @@ -73,6 +74,7 @@ if /i "%1"=="intl-none" set i18n_arg=%1&goto arg-ok if /i "%1"=="download-all" set download_arg="--download=all"&goto arg-ok if /i "%1"=="ignore-flaky" set test_args=%test_args% --flaky-tests=dontcare&goto arg-ok if /i "%1"=="enable-vtune" set enable_vtune_arg=1&goto arg-ok +if /i "%1"=="build-addons" set build_addons=1&goto build-addons echo Warning: ignoring invalid command line option `%1`. @@ -193,6 +195,9 @@ msbuild node.sln /m /t:%target% /p:Configuration=%config% /p:Platform=%msbplatfo if errorlevel 1 goto exit if "%target%" == "Clean" goto exit +:: assign path to node_exe +set node_exe=%cd%\%config%\node.exe + :sign @rem Skip signing if the `nosign` option was specified. if defined nosign goto licensertf @@ -240,15 +245,32 @@ ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/no :build-node-weak @rem Build node-weak if required -if "%buildnodeweak%"=="" goto run-tests +if "%buildnodeweak%"=="" goto build-addons "%config%\node" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild --directory="%~dp0test\gc\node_modules\weak" --nodedir="%~dp0." if errorlevel 1 goto build-node-weak-failed -goto run-tests +goto build-addons :build-node-weak-failed echo Failed to build node-weak. goto exit +:build-addons +if not defined build_addons goto run-tests +echo Building add-ons +:: clear +for /d %%F in (test\addons\??_*) do ( + rd /s /q %%F +) +:: generate +%node_exe% tools/doc/addon-verify.js +:: building addons +for /d %%F in (test/addons/*) do ( + %node_exe% deps/npm/node_modules/node-gyp/bin/node-gyp rebuild ^ + --directory=test/addons/%%F ^ + --nodedir=%cd% +) +goto run-tests + :run-tests if "%test_args%"=="" goto jslint if "%config%"=="Debug" set test_args=--mode=debug %test_args% From 32caebb5d163105cff84dff2ccf7c93ae1bf7a8c Mon Sep 17 00:00:00 2001 From: Bogdan Lobor Date: Thu, 24 Mar 2016 13:55:57 +0200 Subject: [PATCH 2/5] build, windows: check if "node_exe" defined --- vcbuild.bat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcbuild.bat b/vcbuild.bat index 082b3a03aca2e7..945fb80d5d9222 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -256,6 +256,10 @@ goto exit :build-addons if not defined build_addons goto run-tests +if not defined node_exe ( + echo Failed to find node.exe + goto run-tests +) echo Building add-ons :: clear for /d %%F in (test\addons\??_*) do ( From 26f3f04209a20c029ba80e511c87ebdec4a3da10 Mon Sep 17 00:00:00 2001 From: Bogdan Lobor Date: Thu, 24 Mar 2016 18:46:07 +0200 Subject: [PATCH 3/5] build, windows: move "node_exe" variable assignment. this should fix issue with running test-ci on non-build servers. --- vcbuild.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 945fb80d5d9222..2449539e8fea07 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -38,6 +38,9 @@ set enable_vtune_arg= set configure_flags= set build_addons= +:: assign path to node_exe +set node_exe="%config%\node.exe" + :next-arg if "%1"=="" goto args-done if /i "%1"=="debug" set config=Debug&goto arg-ok @@ -195,9 +198,6 @@ msbuild node.sln /m /t:%target% /p:Configuration=%config% /p:Platform=%msbplatfo if errorlevel 1 goto exit if "%target%" == "Clean" goto exit -:: assign path to node_exe -set node_exe=%cd%\%config%\node.exe - :sign @rem Skip signing if the `nosign` option was specified. if defined nosign goto licensertf From ee5e2940d5c5474a68c9a222cbe632b0b5c4cdfa Mon Sep 17 00:00:00 2001 From: "bogdan.lobor" Date: Thu, 24 Mar 2016 23:45:07 +0200 Subject: [PATCH 4/5] build, windows: changes accordingly to PR comment Renamed build-addons -> test-addons test-addons task shouldtest only addons test should task also test addons --- vcbuild.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 2449539e8fea07..3560908b3e499f 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -58,7 +58,8 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok -if /i "%1"=="test" set test_args=%test_args% sequential parallel message -J&set jslint=1&goto arg-ok +if /i "%1"=="test" set test_args=%test_args% addons sequential parallel message -J&set jslint=1&set build_addons=1&goto arg-ok +if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons message sequential parallel&set build_addons=1&goto arg-ok if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok @@ -77,7 +78,6 @@ if /i "%1"=="intl-none" set i18n_arg=%1&goto arg-ok if /i "%1"=="download-all" set download_arg="--download=all"&goto arg-ok if /i "%1"=="ignore-flaky" set test_args=%test_args% --flaky-tests=dontcare&goto arg-ok if /i "%1"=="enable-vtune" set enable_vtune_arg=1&goto arg-ok -if /i "%1"=="build-addons" set build_addons=1&goto build-addons echo Warning: ignoring invalid command line option `%1`. @@ -256,7 +256,7 @@ goto exit :build-addons if not defined build_addons goto run-tests -if not defined node_exe ( +if not exist %node_exe% ( echo Failed to find node.exe goto run-tests ) From c1b7db7cd00c3ae6c4d7499115d866df9336dc8a Mon Sep 17 00:00:00 2001 From: Bogdan Lobor Date: Mon, 28 Mar 2016 19:21:49 +0300 Subject: [PATCH 5/5] build, windows: changes accordingly to PR comments move "node_exe" variable assignment change backslashes --- vcbuild.bat | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 3560908b3e499f..fd05a1fe698bc4 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -38,9 +38,6 @@ set enable_vtune_arg= set configure_flags= set build_addons= -:: assign path to node_exe -set node_exe="%config%\node.exe" - :next-arg if "%1"=="" goto args-done if /i "%1"=="debug" set config=Debug&goto arg-ok @@ -96,6 +93,9 @@ if defined build_release ( set i18n_arg=small-icu ) +:: assign path to node_exe +set node_exe=%config%\node.exe + if "%config%"=="Debug" set configure_flags=%configure_flags% --debug if defined nosnapshot set configure_flags=%configure_flags% --without-snapshot if defined noetw set configure_flags=%configure_flags% --without-etw& set noetw_msi_arg=/p:NoETW=1 @@ -266,12 +266,12 @@ for /d %%F in (test\addons\??_*) do ( rd /s /q %%F ) :: generate -%node_exe% tools/doc/addon-verify.js +"%node_exe%" "tools\doc\addon-verify.js" :: building addons -for /d %%F in (test/addons/*) do ( - %node_exe% deps/npm/node_modules/node-gyp/bin/node-gyp rebuild ^ - --directory=test/addons/%%F ^ - --nodedir=%cd% +for /d %%F in (test\addons\*) do ( + "%node_exe%" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild ^ + --directory="%%F" ^ + --nodedir="%cd%" ) goto run-tests