-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build,test: run v8 tests on windows #13992
Conversation
cc: @nodejs/build , @joaocgreis , @refack |
Could it be moved to in a separate
|
@refack That's no different from the existing tools/make-v8.sh script though: it checks out depot_tools when you run Tangential: I don't think depot_tools is needed to build d8 (could use @kunalspathak This needs a rebase. |
Just to explain myself: I ment a new batch file that could be called from |
@refack - Yes, makes sense. I will rebase and update the PR with review comments. |
I believed the objective of running the V8 tests from our tree was to test our floating patches using the V8 test suite (as mentioned in nodejs/build#199, this would be used to test a PR that adds a floating patch to V8). So, I didn't understand the Doesn't this completely defeat the purpose of testing V8 from our tree? Can't we trust that the V8 branch this ends up testing has been fully tested upstream? Shouldn't this tool use the V8 test suite on the V8 tree without removing our floating patches? |
Thanks @joaocgreis for bring this up. While I was working on refactoring to move |
Hi,
So, it should test the V8 which is part of Node (including any floating patches). |
@jbajwa If I understand you correctly, here we do not need all the depot_tools actions, as the code in the node tree should be tested as is, right? |
fetch v8 and gclient sync would still be needed to get the correct deps for
v8 makefile to work. The v8 source is tested as is from the node tree.
…On Sun, Jul 9, 2017 at 7:25 PM Refael Ackermann ***@***.***> wrote:
So, it should test the V8 which is part of Node (including any floating
patches).
@jbajwa <https://github.com/jbajwa> If I understand you correctly, here
we do not need all the depot_tools actions, as the code in the node tree
should be tested as is, right?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13992 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAjQGojz8uqxXi_GQLtn6J_MYjLahPoqks5sMWFNgaJpZM4OJ61B>
.
|
@jbajwa I see now, thanks for the explanation! That's cleverly done. @kunalspathak |
Just backing up @joaocgreis - I'm using the Git-for-Windows |
@joaocgreis - Thanks for the suggestion, i didn't realize that we could do this. I will test it out and if it works then I will re-use
Yes, I realized it when i was refactoring. I mis-read cleanup function and was calling at the end of test. I will fix it. |
@kunalspathak just to be sure we're on the same page: those are mutually exclusive steps, if you re-use |
Yep, i understand that 😄 |
ping. any other comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions (not really sure about any of them, I don't know enough about batch).
vcbuild.bat
Outdated
echo Failed to find a suitable depot tools to test v8 | ||
goto exit | ||
|
||
:restorepath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe restorecwd
or similar? I thought this was changing the %PATH%
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure.
vcbuild.bat
Outdated
@@ -216,6 +222,10 @@ echo Try to run in a "Developer Command Prompt" or consult | |||
echo https://github.com/nodejs/node/blob/master/BUILDING.md#windows-1 | |||
goto exit | |||
|
|||
:depot-tools-not-found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this is defined twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of them need to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be defined twice. I will remove one.
vcbuild.bat
Outdated
call python tools\run-tests.py %common_v8_test_options% benchmarks --junitout ./v8-benchmarks-tap.xml | ||
goto restorepath | ||
|
||
:depot-tools-not-found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second definition here.
Follow on question, as it's only called once, is there a need for a separate goto
for it at all? IDK what others think, but for me every goto
adds significant mental complexity, so if it's avoidable I'd like to avoid it.
vcbuild.bat
Outdated
goto exit | ||
|
||
:restorepath | ||
cd %~dp0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be part of the exit
process for vcbuild.bat
. I see we cd %~dp0
at the beginning, is there a reason not do do it at the end as well (cc/ @joaocgreis )?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
popd
vcbuild.bat
Outdated
echo running 'ninja -C out.gn/%test_args% %v8_build_options%' | ||
call ninja -C out.gn/%test_args% %v8_build_options% > nul 2> nul | ||
if errorlevel 1 goto exit | ||
set path=%savedpath% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AIUI if any of the above commands fail then the user's PATH is not restored. Same question as for %dp0
, should we be doing this as part of exit
?
I guess you could do:
if defined savedpath set path=%savedpath%
and then any other part of the script that modifies the path wouldn't have to worry about resetting it.
vcbuild.bat
Outdated
if "%config%"=="Debug" set test_args=%target_arch%.debug | ||
if "%config%"=="Release" set test_args=%target_arch%.release | ||
set savedpath=%path% | ||
set path=%DEPOT_TOOLS_PATH%;%path% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you went with CAPS for %DEPOT_TOOLS_PATH%
but not elsewhere? I know Windows env vars are case-agnostic, but I'm not sure if there are any common defaults people use (e.g. lowercase for local, uppercase for global).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%DEPOT_TOOLS_PATH% if defined by depot_tools
so it's not our call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if %DEPOT_TOOLS_PATH%
is defined, doesn't that mean that %depot_tools_path%
is also defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but that's not cricket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gibfahn - I followed the syntax of environment variables defined outside the script to be all caps. e.g. VS140COMNTOOLS
, PROCESSOR_ARCHITEW6432
, etc. I see that some tooling related environment variables are also all caps, e.g. GYP_MSVS_VERSION
. But again i am open to change if you strongly feel like that.
vcbuild.bat
Outdated
call python tools\dev\v8gen.py %test_args% > nul 2> nul | ||
if errorlevel 1 goto exit | ||
echo running 'ninja -C out.gn/%test_args% %v8_build_options%' | ||
call ninja -C out.gn/%test_args% %v8_build_options% > nul 2> nul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So for these two commands if something fails then will there be any output? I assume you're &> nul
because otherwise it spews too much out to the screen, but (e.g. if we start running this in CI) it might be useful to know what went wrong. Or maybe it just doesn't really fail?
I guess you could output to a logfile, and then echo something at the beginning saying errors logged to blah.log
(or whatever it should be).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no reason to swallow or log to file. Let it flow just like in the call to MSbuild
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, primary reason was it was outputing a lot. I like @refack suggestion and will let it flow like msbuild
.
vcbuild.bat
Outdated
@@ -216,6 +222,10 @@ echo Try to run in a "Developer Command Prompt" or consult | |||
echo https://github.com/nodejs/node/blob/master/BUILDING.md#windows-1 | |||
goto exit | |||
|
|||
:depot-tools-not-found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of them need to go
vcbuild.bat
Outdated
call python tools\dev\v8gen.py %test_args% > nul 2> nul | ||
if errorlevel 1 goto exit | ||
echo running 'ninja -C out.gn/%test_args% %v8_build_options%' | ||
call ninja -C out.gn/%test_args% %v8_build_options% > nul 2> nul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no reason to swallow or log to file. Let it flow just like in the call to MSbuild
vcbuild.bat
Outdated
echo calling: tools\make-v8.sh | ||
sh tools\make-v8.sh | ||
if errorlevel 1 goto exit | ||
cd %~dp0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed as it's a precondition for this whole script and done in L3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep.
vcbuild.bat
Outdated
if "%config%"=="Debug" set test_args=%target_arch%.debug | ||
if "%config%"=="Release" set test_args=%target_arch%.release | ||
set savedpath=%path% | ||
set path=%DEPOT_TOOLS_PATH%;%path% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather require this as a precondition for running.
Test, and if it's not set, err, like with if not defined DEPOT_TOOLS_PATH
If all you need is ninja
you could
where ninja > nul 2>nul
if errorlevel 1 echo depot_tools not set-up & goto exit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't follow you. if not defined DEPOT_TOOLS_PATH
would make sure depot_tools
are in path. If ninja
is not there, it will anyway fail when invoked. I know it is better to check upfront, but sync script calls other tools/scripts that also have to be in path and if not, things will fail when invoked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK when depot_tools
are set-up Path
already includes DEPOT_TOOLS_PATH
, so if you could test that and fail, it would be nicer than manipulation the Path
.
If it's not simple, then current solution is Ok.
vcbuild.bat
Outdated
cd %~dp0 | ||
cd deps\v8 | ||
echo running 'python tools\dev\v8gen.py %test_args%' | ||
call python tools\dev\v8gen.py %test_args% > nul 2> nul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let the output flow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure.
@@ -83,6 +85,10 @@ if /i "%1"=="test-async-hooks" set test_args=%test_args% async-hooks&goto arg-o | |||
if /i "%1"=="test-all" set test_args=%test_args% gc internet pummel %common_test_suites%&set build_testgc_addon=1&set cpplint=1&set jslint=1&goto arg-ok | |||
if /i "%1"=="test-node-inspect" set test_node_inspect=1&goto arg-ok | |||
if /i "%1"=="test-check-deopts" set test_check_deopts=1&goto arg-ok | |||
if /i "%1"=="test-v8" set test_v8=1&set custom_v8_test=1&goto arg-ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not: I'd prefer you align to if /i "%1"=="test-check-deopts"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other checks that are not aligned. e.g. test-all
above. test-v8
aligns to test-all
and other shorter if checks.
vcbuild.bat
Outdated
sh tools\make-v8.sh | ||
if errorlevel 1 goto exit | ||
cd %~dp0 | ||
cd deps\v8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushd
vcbuild.bat
Outdated
goto exit | ||
|
||
:restorepath | ||
cd %~dp0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
popd
goto test-v8 | ||
|
||
:test-v8 | ||
if not defined custom_v8_test goto cpplint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still would like this block to move to tools\test-v8.cmd
and here leave
call tools\test-v8.cmd
goto cpplint
AFAICT everything else will fall into place.
vcbuild.bat
Outdated
@@ -513,9 +525,15 @@ echo %cmd1% | |||
%cmd1% | |||
exit /b %ERRORLEVEL% | |||
|
|||
:test-v8-exit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird, I thought I removed this and moved it to test-v8.bat
. I will remove it. Sorry about that.
if "%config%"=="Debug" set test_args=%target_arch%.debug | ||
if "%config%"=="Release" set test_args=%target_arch%.release | ||
set savedpath=%path% | ||
set path=%DEPOT_TOOLS_PATH%;%path% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you can SETLOCAL
and ENDLOCAL
in :test-v8-exit
and then I don't care what monstrosities you do to poor old Path
Ohhhh, so pretty. If only we used the sub-script approach earlier.... |
@gibfahn - Do you have any other comments or should we land this? |
I will land this PR tomorrow if no one objects. |
`vcbuild.bat test-v8` : Runs unit test from v8 repo `vcbuild.bat test-v8-intl` : Runs intl test from v8 repo `vcbuild.bat test-v8` : Runs benchmarks from v8 repo The runs needs https://www.chromium.org/developers/how-tos/install-depot-tools installed on the machine expects environment variable `DEPOT_TOOLS_PATH` to be set to the path. Set environment variable `DISABLE_V8_I18N` to disable i18n. PR-URL: nodejs#13992 Refs: nodejs#4704 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
`vcbuild.bat test-v8` : Runs unit test from v8 repo `vcbuild.bat test-v8-intl` : Runs intl test from v8 repo `vcbuild.bat test-v8` : Runs benchmarks from v8 repo The runs needs https://www.chromium.org/developers/how-tos/install-depot-tools installed on the machine expects environment variable `DEPOT_TOOLS_PATH` to be set to the path. Set environment variable `DISABLE_V8_I18N` to disable i18n. PR-URL: #13992 Refs: #4704 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Should this be backported to |
ping @nodejs/platform-windows |
I don't think this needs to be backported to v6. This is mainly to test floating patches on V8, I believe those will not be common in v6 in the future. |
Every time we need to float a new V8 patch we should run those tests. It isn’t 100% necessary but nice to have
|
I'll backport. |
This is a port of #4704 for windows.
Related discussion: nodejs/build#577 (comment)
vcbuild.bat test-v8
: Runs unit test from v8 repovcbuild.bat test-v8-intl
: Runs intl test from v8 repovcbuild.bat test-v8
: Runs benchmarks from v8 repoThe runs needs depot_tools
installed on the machine expects environment variable
DEPOT_TOOLS_PATH
to be set to the path.Set environment variable
DISABLE_V8_I18N
to disable i18n.I verified this on my machine and it works as expected. But would love to setup a CI machine that contains depot_tools installation and try it out.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
build