Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

V8 upgrade process

Julien Gilli edited this page Apr 21, 2015 · 26 revisions

Introduction

This document aims at describing what needs to be done when upgrading the version of V8 that is included in Node.js' source tree.

Floating patches

How to land a patch from upstream V8?

Sometimes, it is necessary to cherry-pick changes made to newer V8 versions upstream and land them in the current V8 version used in deps/v8. In order to do that, you'll need to do two things:

  1. Cherry-pick the commit from V8's GitHub mirror into node's repository.
  2. Change the commit message to mention that it's a back-port from V8 upstream, and add the appropriate metadata.

Cherry-picking commits from V8's GitHub mirror

Clone V8's GitHub mirror: git clone git@github.com:v8/v8-git-mirror.git. Identify the commit to backport, and within your node local repository, use the following command:

git --git-dir=../../v8-git-mirror/.git format-patch -k -1 --stdout sha1 | git am -k --directory=deps/v8

where ../../v8-git-mirror/ is the path to V8's GitHub mirror relative to your local node repository, and sha1 is the sha of the commit you want to cherry-pick.

At this point, the original commit from V8 should be committed in your local tree. It's time to change the commit message with git commit --amend to alter the first line and add in the body that this commit is a back-port from V8.

A good example of such a commit message is https://github.com/joyent/node/commit/2fc5eeb3da0cbc5c17674818bc679d3d564d0d06. Note that in this commit message, the following lines:

PR-URL: #9200
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Julien Gilli <julien.gilli@joyent.com>

were added by the Jenkins job that merges changes, you don't need to add that yourself.

Existing floating patches

Patches that need to be upstreamed

Testing

Node.js tests suite

The first step is to run the standard Node.js tests suite. The best way to do that is to push the branch that contains the V8 upgrade to joyent/node in a feature branch (something like v8-upgrade) and to run the the node-review-unix Jenkins job on that branch.

Testing post-mortem debugging on SmartOS

Post-mortem debugging on SmartOS relies on information generated both by the build process and by V8 at runtime. When V8 changes, sometimes the metadata generated at build time needs to change to match V8's runtime data structures.

In order to test post-mortem debugging on SmartOS, simply build a node binary with the default build options and run the following tests: test/pummel/test-postmortem-details.js, test/pummel/test-postmortem-findjsobjects.js, test/pummel/test-postmortem-jsstack.js. All these tests must exit with a 0 exit code.