Background

For stability reasons, Node master uses a V8 branch, that is at stable or older. For additional integration, the V8 team builds Node with V8 master, i.e., with a V8 version that is several weeks newer than the V8 version in the official Node master.

If you get an email, that the Node integration build fails with your V8 CL, there is either a legitimate problem with your CL (you should revert the CL and fix it) or Node must be modified. If the tests failed, search for “Not OK” in the logfiles. This document describes how to reproduce the problem locally and how to make changes to V8’s Node fork if your V8 CL causes the build to fail.

Note: Patches in V8’s fork are usually cherry-picked by the person who updates V8 in Node (usually several weeks or month later). If you merged a fix to V8’s Node fork, there’s nothing else you need to do.

Reproduce locally

Clone V8’s Node repository and check out the lkgr branch.

git clone git@github.com:v8/node.git

If you already have a Node checkout, add v8/node as remote.

cd $NODE
git remote add v8-fork git@github.com:v8/node.git 
git checkout -b vee-eight-lkgr v8-fork/vee-eight-lkgr

Apply your patch, i.e., replace node/deps/v8 with a copy of v8 (lkgr branch) and build Node.

$V8/tools/release/update_node.py $V8 $NODE
cd $NODE
./configure && make -j48 test

You can run single tests.

./node test/parallel/test-that-you-want.js

For debug builds, set v8_optimized_debug in common.gypi to true and run

./configure --debug && make -j48 test

Make changes to Node.js

If you need to change something in Node so your CL doesn’t break the build anymore, do the following. You need a GitHub account for this.

Get the Node sources

Fork V8’s Node repository on Github (click the fork button). Clone your Node repository and check out the lkgr branch.

git clone git@github.com:your_user_name/node.git

If you already have a checkout of your fork of Node, you do not fork the repo. Instead, add v8/node as remote:

cd $NODE
git remote add v8-fork git@github.com:v8/node.git 
git checkout -b vee-eight-lkgr v8-fork/vee-eight-lkgr

Make sure you have the correct branch and check that the current version builds and runs. Then create a new branch for your fix.

git checkout vee-eight-lkgr
./configure && make -j48 test
git checkout -b fix-something

Apply your patch

Replace node/deps/v8 with a copy of v8 (lkgr branch) and build Node.

$V8/tools/release/update_node.py $V8 $NODE
cd $NODE
./configure && make -j48 test

Make fixes to Node

Make your changes to Node (not to deps/v8) and commit them.

git commit -m "subsystem: fix something"

Note: if you make several commits, please squash them into one and format according to Node’s guidelines. Github’s review works differently than V8 Chromium and your commit messages will end up in Node exactly how you wrote them locally (doesn’t matter what you type in the PR message). It’s OK to force push onto your fix-something branch.

Build and run the tests again. Double check that your formatting looks like the rest of the file.

./configure && make -j48 test
make lint
git push origin fix-something

Once you have pushed the fixes to your repository, open a Pull Request on GitHub. This will send an email to the V8 node-js team. They will review and merge your PR. If you have specific questions, ping the V8 node-js team maintainers.