FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build,test: run v8 tests on windows by kunalspathak · Pull Request #13992 · nodejs/node · GitHub

/ node Public

build,test: run v8 tests on windows - #13992

Merged
kunalspathak merged 1 commit into
nodejs:masterfrom
kunalspathak:testv8
Jul 27, 2017
Merged

build,test: run v8 tests on windows#13992
kunalspathak merged 1 commit into
nodejs:masterfrom
kunalspathak:testv8

Conversation

Copy link
Copy Markdown
Member

This is a port of #4704 for windows.
Related discussion: nodejs/build#577 (comment)

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 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), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

build

nodejs-github-bot added build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform. labels Jun 29, 2017

kunalspathak commented Jun 29, 2017
edited
Loading

Copy link
Copy Markdown
Member Author

cc: @nodejs/build , @joaocgreis , @refack

refack commented Jun 30, 2017

Copy link
Copy Markdown
Contributor

Could it be moved to in a separate .bat file (in tools/ or tools/msvs/)?

  1. more tests yeah !!! 👍 🎉 💃 but:
  2. vcbuild.bat is already a hot mess
  3. depot_tools is a new dependency that only a subset of people want/have/not-discussed-by, so it makes sense to me to partition this to a new file. Maybe with an if not defined DEPOT_TOOLS_PATH exit /b 0 at the top...

Copy link
Copy Markdown
Member

depot_tools is a new dependency that only a subset of people want/have/not-discussed-by

@refack That's no different from the existing tools/make-v8.sh script though: it checks out depot_tools when you run make test-v8.

Tangential: I don't think depot_tools is needed to build d8 (could use ./configure --enable-d8 for that) but it also downloads things like test262 that are used in V8's test suite.

@kunalspathak This needs a rebase.

refack commented Jul 2, 2017

Copy link
Copy Markdown
Contributor

Could it be moved to in a separate .bat file (in tools/ or tools/msvs/)?

@refack That's no different from the existing tools/make-v8.sh script though: it checks out depot_tools when you run make test-v8.

Just to explain myself: I ment a new batch file that could be called from vcbuild.bat (or on it's own if that's effortless).

Copy link
Copy Markdown
Member Author

Could it be moved to in a separate .bat file (in tools/ or tools/msvs/)?

@refack - Yes, makes sense. I will rebase and update the PR with review comments.

Copy link
Copy Markdown
Member

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 rd /S /Q v8 in this PR, but then I noticed a similar rm -rf v8 was added to make-v8.sh in #9393, which is currently in master.

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?

(also cc @jbajwa @mhdawson)

Copy link
Copy Markdown
Member Author

Thanks @joaocgreis for bring this up. While I was working on refactoring to move make v8 part in separate script, i realized that in unix version, cleanup happens inside make-v8.sh before building and running v8 test. I am not sure if I follow this completely. Isn't it undoing the fetch/sync part or am i missing something?

jbajwa commented Jul 9, 2017

Copy link
Copy Markdown

Hi,
The idea of the script is to get the DEPS needed by V8 make and the run-tests.py script. I'll just briefly explain the script below:

  • git stash // preserve any local uncommitted changes
  • rm -rf v8 // need to remove v8 copy to fetch the latest v8 copy, with all DEPS
  • git checkout BRANCH // branch being the v8 version used in node
  • gclient sync // update the deps to that specific V8 version
  • git reset --hard HEAD // resets to current git HEAD, which will include any local committed changes
  • git clean -fdq // will clean any untracked src files, but deps will be ignored as its part of .gitignore
  • stash pop // will restore any uncommitted changes

So, it should test the V8 which is part of Node (including any floating patches).

refack commented Jul 9, 2017

Copy link
Copy Markdown
Contributor

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?

jbajwa commented Jul 9, 2017 via email

Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@jbajwa I see now, thanks for the explanation! That's cleverly done.

@kunalspathak cleanup returns to the version of V8 in node with the floating patches, but keeping all the necessary files for building and testing V8 (because they are conveniently gitignored). So, this PR is missing that step before building. In the Unix version, cleanup is registered with trap to run if the script is cancelled. I don't think this is straightforward to do in cmd, but is not essential. You might also consider running make-v8.sh with Git Bash - we already require the git tools for testing and what this is doing actually increases the dependency on git. While for actually running tests it is always better to use cmd (to avoid tty being a pipe), for a setup stage I believe reusing the script would be better.

refack commented Jul 10, 2017

Copy link
Copy Markdown
Contributor

running make-v8.sh with Git Bash - we already require the git tools for testing

Just backing up @joaocgreis - I'm using the Git-for-Windows make to run make lint and some git hooks, works very well.
Also AFAICT this is a opt-in operation so I would have considered adding the GfW toolset even as new requirement just like depot_tools.

Copy link
Copy Markdown
Member Author

You might also consider running make-v8.sh with Git Bash

@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 make-v8.sh.

So, this PR is missing that step before building

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.

Copy link
Copy Markdown
Member

@kunalspathak just to be sure we're on the same page: those are mutually exclusive steps, if you re-use make-v8.sh then cleanup is not needed in vcbuild.bat.

Copy link
Copy Markdown
Member Author

Yep, i understand that 😄

Copy link
Copy Markdown
Member Author

ping. any other comments?

gibfahn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Some questions (not really sure about any of them, I don't know enough about batch).

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe restorecwd or similar? I thought this was changing the %PATH%.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

sure.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is there a reason this is defined twice?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

One of them need to go

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should not be defined twice. I will remove one.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 )?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

popd

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

%DEPOT_TOOLS_PATH% if defined by depot_tools so it's not our call.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

But if %DEPOT_TOOLS_PATH% is defined, doesn't that mean that %depot_tools_path% is also defined?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah but that's not cricket.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@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.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I see no reason to swallow or log to file. Let it flow just like in the call to MSbuild

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, primary reason was it was outputing a lot. I like @refack suggestion and will let it flow like msbuild.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

One of them need to go

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I see no reason to swallow or log to file. Let it flow just like in the call to MSbuild

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

not needed as it's a precondition for this whole script and done in L3

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

yep.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

let the output flow

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

sure.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

not: I'd prefer you align to if /i "%1"=="test-check-deopts"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There are other checks that are not aligned. e.g. test-all above. test-v8 aligns to test-all and other shorter if checks.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

pushd

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

popd

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is this still needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

weird, I thought I removed this and moved it to test-v8.bat. I will remove it. Sorry about that.

Comment thread tools/test-v8.bat Outdated

refack Jul 18, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Now you can SETLOCAL and ENDLOCAL in :test-v8-exit and then I don't care what monstrosities you do to poor old Path

refack commented Jul 18, 2017

Copy link
Copy Markdown
Contributor

Ohhhh, so pretty. If only we used the sub-script approach earlier....

Copy link
Copy Markdown
Member Author

@gibfahn - Do you have any other comments or should we land this?

Copy link
Copy Markdown
Member Author

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 <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>

Copy link
Copy Markdown
Member Author

kunalspathak merged commit 09dd6bb into nodejs:master Jul 27, 2017
addaleax pushed a commit that referenced this pull request Jul 27, 2017
`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 <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
addaleax mentioned this pull request Aug 2, 2017

Copy link
Copy Markdown
Contributor

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

Copy link
Copy Markdown
Contributor

ping @nodejs/platform-windows

Copy link
Copy Markdown
Member

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.

MylesBorins commented Oct 24, 2017 via email

Copy link
Copy Markdown
Contributor

refack self-assigned this Oct 24, 2017

refack commented Oct 24, 2017

Copy link
Copy Markdown
Contributor

I'll backport.

refack removed their assignment Oct 12, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL