Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
52f1493
deps: backport GYP fix to fix AIX shared suffix
Nov 14, 2016
f2b0098
build: add shared library support to AIX build
Nov 14, 2016
f8d4577
build: Add option to compile for coverage reports
CurryKitten Oct 14, 2016
8380154
doc: add npm link to README
oscarmorrison Jul 27, 2016
3f39a39
doc: Fix inaccuracy in https.request docs
papandreou Nov 2, 2016
1e06ed7
doc: clarify the exit code part of writing_tests
Fishrock123 Nov 7, 2016
aa25c74
doc: grammar and structure revisions of wg doc
ryanmurakami Nov 6, 2016
6775163
doc: fix minor style issue in code examples
danbev Nov 10, 2016
06732ba
doc: remove Roadmap Working Group
williamkapke Nov 10, 2016
3ad7430
doc: fix the index order in pseudocode of modules
koh110 Nov 12, 2016
229fa69
doc: fix e.g., to e.g. in doc/http.md
ikasumiwt Nov 12, 2016
c799793
doc: fix typo about cluster doc, (eg. -> e.g.)
YutamaKotaro Nov 12, 2016
aca0ede
doc: fix typo e.g., => e.g.
dorako321 Nov 12, 2016
011ee0b
tools: copy run-valgrind.py to tools/
bnoordhuis Nov 8, 2016
7b1b11a
tools: fix run-valgrind.py script
bnoordhuis Nov 8, 2016
e3dc05d
tools: make run-valgrind.py useful
bnoordhuis Nov 8, 2016
198463a
doc: fix a typo in the assert.md
vsemozhetbyt Nov 13, 2016
9b36469
tools: improve docopen target in Makefile
thefourtheye Nov 3, 2016
34405dd
doc: move TSC and CTC meeting minutes out of core repo
jasnell Nov 7, 2016
4eeac8e
doc: add guide for maintaining V8
ofrobots Nov 24, 2016
0f52358
doc: remove Sam Roberts from release team
sam-github Nov 30, 2016
3d45b35
repl: refactor lib/repl.js
Trott Oct 31, 2016
7b4268b
benchmark,lib,test,tools: remove unneeded . escape
Trott Nov 3, 2016
02e8187
test: allow globals to be whitelisted
cjihrig Jul 21, 2016
698bf2e
repl: don't override all internal repl defaults
cjihrig Jul 21, 2016
76245b2
test: refactor large event emitter tests
cjihrig Apr 28, 2016
c5f82b8
assert: fix deepEqual/deepStrictEqual on equivalent typed arrays
feross Aug 6, 2016
c0c5608
test,assert: add deepEqual/deepStrictEqual tests for typed arrays
feross Aug 7, 2016
bb05cd1
async_wrap: mode constructor/destructor to .cc
trevnorris Nov 23, 2016
28dbc46
async_wrap: make Initialize a static class member
trevnorris Nov 23, 2016
60883de
async_wrap: call destroy() callback in uv_idle_t
trevnorris Nov 23, 2016
c0d44df
doc: remove invalid padding from privateEncrypt
JungMinu Nov 15, 2016
fd6b305
tools: use better regexp for manpage references
addaleax Nov 16, 2016
4f2e254
doc: remove backtick escaping for manpage refs
addaleax Nov 16, 2016
16e97ab
doc: fix typo in BUILDING.md
kazu80 Nov 12, 2016
6f1f955
build: default to ppc64 on AIX
gibfahn Nov 16, 2016
550393d
test: add new.target add-on regression test
bnoordhuis Nov 18, 2016
10d4f47
test: enable addons test to pass with debug build
danbev Sep 28, 2016
dc4c348
doc: fix typo in assert code example
vsemozhetbyt Nov 20, 2016
eb5972f
doc: fix crypto "decipher.setAAD()" typo
Amery2010 Nov 24, 2016
107735a
doc: changed order of invocations in https.request() example.
Nov 15, 2016
fd1a48c
doc: minor fixes event-loop-timers-and-nexttick.md
dankoster Oct 17, 2016
9e68b8d
doc: fix crypto Verify cut-n-paste from Sign
Amery2010 Nov 25, 2016
06e8120
tools: remove unneeded escaping in generate.js
Trott Nov 24, 2016
18c3881
doc: improve description of module `exports`
sam-github Nov 15, 2016
a858e98
doc: clarify introductory module material
Trott Nov 27, 2016
c9ed49d
test: run cpplint on files in test/cctest
bnoordhuis Nov 24, 2016
3105bec
doc: remove minor contradiction in debugger doc
Trott Nov 28, 2016
4885573
doc: update Collaborators list in README
Trott Nov 29, 2016
b06b234
doc: it’s -> its in api/child_process.md
drifkin Dec 2, 2016
338014e
doc: rename writing_tests.md to writing-tests.md
captainsafia Dec 1, 2016
ad841a2
doc: clarify fs.createReadStream options
WesTyler Dec 1, 2016
65e134f
meta: whitelist dotfiles in .gitignore
claudiorodriguez Aug 8, 2016
b5eae44
doc: add link to `net.Server` in tls.md
drifkin Dec 4, 2016
724910a
debugger: refactor _debugger.js
Trott Nov 30, 2016
e8c57bb
doc: add people to cc for async_wrap
addaleax Nov 4, 2016
1436fd7
test: convert assert.equal to assert.strictEqual
Dec 1, 2016
b2b2bc2
test: move timer-dependent test to sequential
Trott Nov 6, 2016
4e36a14
test: refactor test-next-tick-error-spin
Trott Nov 10, 2016
eca12d4
test: improve test-stream2-objects.js
kt3k Nov 12, 2016
b87fe25
test: change from setTimeout to setImmediate
fossamagna Nov 12, 2016
29ab76b
test: ensure nextTick is not scheduled in exit
Fishrock123 Nov 11, 2016
cef5b1f
test: add test for broken child process stdio
cjihrig Nov 9, 2016
beb147a
test: check that `process.execPath` is a realpath
addaleax Oct 21, 2016
8345ffb
test: add test case of PassThrough
kt3k Nov 12, 2016
57cc5cb
test: use setImmediate() in test of stream2
mganeko Nov 12, 2016
b59cf58
test: refactor test-async-wrap-*
Trott Nov 17, 2016
81d49aa
test: exclude no_interleaved_stdio test for AIX
mhdawson Nov 23, 2016
4c5d24b
test: refine test-http-status-reason-invalid-chars
Trott Nov 26, 2016
33da22a
test: add toASCII and toUnicode punycode tests
claudiorodriguez Nov 22, 2016
e47195c
test: change equal to strictEqual
kzurawel Dec 1, 2016
1467c96
test: increase coverage for timers
lrlna Dec 1, 2016
2453d64
test: var -> let/const, .equal -> .strictEqual
shiya Dec 1, 2016
27c9171
test: use assert.strictEqual() cluster test
badhikari-godaddy Dec 1, 2016
9103c3d
test: update to const iin cluster test
ghvaldez Dec 1, 2016
76645e8
test: use assert.strictEqual in test-crypto-ecb
daniel-pittman Dec 1, 2016
384c954
test: refactor test-cluster-setup-master-argv
Dec 1, 2016
a486f6b
test: refactor test-cluster-setup-master-argv
Dec 1, 2016
6ecc4ff
test: refactor test for crypto cipher/decipher iv
julianduque Dec 1, 2016
9473fc6
test: refactor test-crypto-cipheriv-decipheriv
Dec 1, 2016
c37ae4a
test: refactor test-vm-static-this.js
dbradf Dec 1, 2016
2890f0d
test: refactor test-tls-friendly-error-message.js
edsadr Dec 1, 2016
457af87
test: use strictEqual in test-cli-eval-event.js
Dec 1, 2016
8257671
test: refactor test-https-truncate
Dec 1, 2016
cff80a5
test: refactor test-tls-destroy-whilst-write
cByst Dec 1, 2016
a4488c3
test: refactor test-vm-syntax-error-stderr.js
Dec 1, 2016
aaab510
test: Changed assert.equal to assert.strictEqual
daniel-pittman Dec 1, 2016
998db3a
test: refactor test-tls-timeout-server-2
drifkin Dec 1, 2016
49900e7
test: replace equal with strictEqual
julianduque Dec 1, 2016
552169e
test: replace equal with strictEqual in crypto
julianduque Dec 1, 2016
1a73cc5
test: swap var->const/let and equal->strictEqual
pmasucci Dec 1, 2016
5cd7e7a
test: Update to const and use regex for assertions
Intregrisist Dec 1, 2016
2a9ab8e
test: change var to const for require and strict equality checks
harishtejwani Dec 1, 2016
7615a0f
test: refactor test-child-process-stdio-inherit
WesTyler Dec 1, 2016
39816a4
test: refactor test-fs-read-stream-inherit.js
Dec 1, 2016
7538dd5
test: use strictEqual in cwd-enoent
jdharmon Dec 1, 2016
f126b44
test: change var to const in test-tls-key-mismatch.js
bjdelro Dec 1, 2016
37d734a
test: polish test-net-better-error-messages-listen
digitalinfinity Dec 2, 2016
6c64f6c
test: improve test for crypto padding
julianduque Dec 1, 2016
d9cca39
test: assert.equal -> assert.strictEqual
Dec 1, 2016
00f0864
test: assert.equal -> assert.strictEqual
Dec 1, 2016
bcbf50d
test: refactor test-http-dns-error
outsideris Dec 1, 2016
30c9474
test: changed vars to const in test-net-better-error-messages-listen-…
anoff Dec 1, 2016
ae9e2a2
test: var to const, assert.equal to assert.strictEqual in net
stv8 Dec 1, 2016
91d27ce
test: refactor test-child-process-constructor
kathytruong Dec 1, 2016
08cc269
test: refactor test-cli-syntax
Dec 1, 2016
815715d
test: refactor test-domain
Dec 1, 2016
59f259c
test: refactor test-crypto-certificate
Dec 1, 2016
89feb8d
test: refactor test-require-exceptions
Dec 1, 2016
57d48ac
test: refactor test-crypto-ecb
michael6 Dec 1, 2016
1e53cf4
test: updated test-stream-pipe-unpipe-stream
Dec 2, 2016
70b4d7d
test: refactor test-child-process-double-pipe
kingnebby Dec 1, 2016
f670b05
test: strictEqual in test-beforeexit-event.js
CodeTheInternet Dec 1, 2016
db3cdd2
test: adding strictEqual to test-buffer-indexof.js
ericgonzalez Dec 1, 2016
a3db544
test: update repl tests
makenova Dec 1, 2016
07680b6
test: refactor test-cluster-worker-events
fmizzell Dec 1, 2016
98afba5
test: use strictEqual() domain-http
cdnadmin Dec 1, 2016
3f9d75c
test: use const or let and assert.strictEqual
crokita Dec 1, 2016
50ce3f9
test: update assert.equal() to assert.strictEqual()
Dec 1, 2016
7391983
test: implemented es6 conventions
ruggertech Dec 3, 2016
16164b5
test: test-file-write-stream3.js refactor
Dec 1, 2016
c94c2fd
test: using const and strictEqual
ftatieze Dec 1, 2016
b5d8756
test: use strictEqual instead of equal
uttampawar Dec 1, 2016
6a485da
test: replace equal with strictEqual
hackygolucky Dec 1, 2016
71ab88c
test: refactor test-fs-read-stream-resume
Dec 1, 2016
9207371
test: refactor test-require-resolve
blugavere Dec 5, 2016
1424c25
test: refactor test-signal-unregister
Dec 1, 2016
cffd51e
test: refactor test-tls-connect-simple
russelltsherman Dec 1, 2016
ad27555
test: use assert.strictEqual in test-cli-eval
NigelKibodeaux Dec 1, 2016
c3a3480
test: refactor test-domain-multi
WesTyler Dec 1, 2016
63f571e
test: changed assert.Equal to asset.strictEqual
pchinjr Dec 1, 2016
e371233
test: update test-stdout-to-file
Dec 1, 2016
b9c4502
test: clean up tls junk test
dguo Dec 1, 2016
ce14c1e
test: refactor test-require-extensions-main
darylthayilporch Dec 1, 2016
a896d4e
test: refactor test-stdin-from-file.js
Dec 1, 2016
a64f406
test: refactor test-domain-exit-dispose
Dec 1, 2016
a2023a9
test: refactor tls-ticket-cluster
shri3k Dec 1, 2016
542b40f
test: refactor test-event-emitter-method-names
Dec 1, 2016
a090899
test: assert.throws() should include a RegExp
cByst Dec 1, 2016
ee038c0
test: refactor test-dgram-bind-default-address
mbchoa Dec 1, 2016
8a9af68
test: use const and strictEqual in test-os-homedir-no-envvar
codeVana Dec 1, 2016
1377ea8
test: refactor test-domain-exit-dispose-again
Ethan-Arrowood Dec 1, 2016
adcd6ea
test: refactor test-domain-from-timer
Dec 1, 2016
52c0229
doc: removing extra space in README
Dec 7, 2016
aecb2ca
doc: adding missing - in README
Dec 7, 2016
9e46af6
test: refactor test-beforeexit-event
radelmann Dec 4, 2016
a1e3967
test: refactor test-https-agent-session-reuse
dpaez Dec 3, 2016
f44e828
test: improves test-tls-client-verify
Dec 1, 2016
b5c60ed
test: renamed assert.Equal to assert.strictEqual
triscuitoraus Dec 1, 2016
5049a10
test: changed assert.equal to assert.strictEqual
zina-olson Dec 1, 2016
bc125bd
test: change assert.equal to assert.strictEqual
Dec 1, 2016
9b974b4
test: use `assert.strictEqual`
anoff Dec 1, 2016
80a7527
test: refactor test-dgram-exclusive-implicit-bind
cesarhq Dec 1, 2016
ae2eff2
build: start comments at beginning of line
thefourtheye Oct 31, 2016
553d95d
timers: use consistent checks for canceled timers
Fishrock123 Nov 18, 2016
759e8fd
timers: bail from intervals if _repeat is bad
Fishrock123 Dec 21, 2016
d1b6407
build: make node-gyp output silent
thefourtheye Oct 9, 2016
38e0f95
build: add MAKEFLAGS="-j1" to node-gyp
danbev Nov 3, 2016
61d377d
build: Make configure file parseable on python3
kalrover Nov 17, 2016
b98813d
test: refactor test-fs-non-number-arguments-throw
targos Nov 29, 2016
b5012f3
test: add expectWarning to common
targos Sep 17, 2016
e2c5f41
crypto: use SSL_get_servername.
agl Oct 28, 2016
54f2ce8
build: prioritise --shared-X-Y over pkg-config
rvagg Oct 30, 2016
5c6d908
tools: enable final newline in .editorconfig
silverwind Nov 1, 2016
b1075f6
benchmark: split timers benchmark and refactor
Trott Nov 7, 2016
c77ba8c
doc: consistent 'Returns:'
silverwind Nov 11, 2016
aebbc96
test: refactor large event emitter tests
cjihrig Apr 28, 2016
13cace1
test: fix helper-debugger-repl.js
Trott Nov 6, 2016
420e7f1
test: fix test-http-status-reason-invalid-chars
saitoxu Nov 12, 2016
0662429
test: fix test-tls-connect-address-family
mkamakura Nov 12, 2016
e849dd0
test: Use strictEqual in test-tls-writewrap-leak
ughitsaaron Nov 17, 2016
8694811
test: refactor test-net-pingpong
targos Nov 26, 2016
d3edaa3
test: replace var with const in test-require-dot
amarzavery Dec 1, 2016
4022579
test: improve domain-top-level-error-handler-throw
codeVana Dec 1, 2016
a779e7f
test: clean up repl-reset-event file
courtnek Dec 1, 2016
e72dfce
test: added validation regex argument to test
Dec 1, 2016
e0c8aaf
test: fix test-buffer-slow
targos Nov 26, 2016
45af785
test: refactor and fix test-crypto
targos Nov 26, 2016
8b733dc
test: refactor test-crypto-binary-default
targos Nov 26, 2016
f5b952b
test: refactor and fix test-dns
targos Nov 26, 2016
1035318
2017-01-03, Version 4.7.1 'Argon' (LTS)
MylesBorins Dec 21, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: add guide for maintaining V8
Ref: nodejs/Release#137
PR-URL: #9777
Reviewed-By: mhdawson - Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
  • Loading branch information
ofrobots authored and MylesBorins committed Dec 13, 2016
commit 4eeac8eb8c9c2a735b2ec20b2cd5e90cea9bcb62
279 changes: 279 additions & 0 deletions doc/guides/maintaining-V8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
# Maintaining V8 in Node

# Background

V8 follows the Chromium release schedule. The support horizon for Chromium is very different from the support horizon that Node.js needs to provide to its users. As a result Node.js needs to support a version of V8 for quite a bit longer than what upstream needs to support. Since V8 doesn't have an LTS supported branch, there is no official process around how the V8 branches in Node are maintained.

This document attempts to document the current processes and proposes a workflow for maintaining the V8 branches in Node.js LTS and Current releases and how the Node and V8 teams at Google can help.

# V8 Release Schedule

V8 and Chromium follow a [roughly 6-week release cadence](https://www.chromium.org/developers/calendar). At any given time there are three V8 branches that are **active**.

For example, at the time of this writing:

* **Stable**: V8 5.4 is currently shipping as part of Chromium stable. This branch was created approx. 6 weeks before from when V8 5.3 shipped as stable.
* **Beta**: V8 5.5 is currently in beta. It will be promoted to stable next; approximately 6 weeks after V8 5.4 shipped as stable.
* **Master**: V8 tip-of-tree corresponds to V8 5.6. This branch gets regularly released as part of the Chromium **canary** builds. This branch will be promoted to beta next when V8 5.5 ships as stable.

All older branches are considered **abandoned**, and are not maintained by the V8 team.

## V8 merge process overview

The process for backporting bug fixes to active branches is officially documented [on the V8 wiki](https://github.com/v8/v8/wiki/Merging%20&%20Patching). The summary of the process is:

* V8 only supports active branches. There is no testing done on any branches older than the current stable/beta/master.
* A fix needing backport is tagged w/ *merge-request-x.x* tag. This can be done by anyone interested in getting the fix backported. Issues with this tag are reviewed by the V8 team regularly as candidates for backporting.
* Fixes need some 'baking time' before they can be approved for backporting. This means waiting a few days to ensure that no issues are detected on the canary/beta builds.
* Once ready, the issue is tagged w/ *merge-approved-x.x* and one can do the actual merge by using the scripts on the [wiki page](https://github.com/v8/v8/wiki/Merging%20&%20Patching).
* Merge requests to an abandoned branch will be rejected.
* Only bug fixes are accepted for backporting.

# Node Support Requirements

At any given time Node needs to be maintaining a few different V8 branches for the various Current, LTS, and nightly releases. At present this list includes the following branches<sup>1</sup>:

<table>
<tr>
<td><strong>Release</strong>
</td>
<td><strong>Support Start</strong>
</td>
<td><strong>Support End</strong>
</td>
<td><strong>V8 version</strong>
</td>
<td><strong>V8 branch released</strong>
</td>
<td><strong>V8 branch abandoned</strong>
</td>
</tr>
<tr>
<td>Node v4.x
</td>
<td>2015-10-01
</td>
<td>2018-04-01
</td>
<td>4.5
</td>
<td>2015-09-01
</td>
<td>2015-10-13
</td>
</tr>
<tr>
<td>Node v6.x
</td>
<td>2016-04-01
</td>
<td>2019-04-01
</td>
<td>5.1
</td>
<td>2016-05-31
</td>
<td>2016-06-26
</td>
</tr>
<tr>
<td>Node v7.x
</td>
<td>2016-10-01
</td>
<td>2017-04-01
</td>
<td>5.4
</td>
<td>2016-10-18
</td>
<td>~2016-12-01
</td>
</tr>
<tr>
<td>master
</td>
<td>N/A
</td>
<td>N/A
</td>
<td>5.4
</td>
<td>2016-10-18
</td>
<td>~2016-12-01
</td>
</tr>
</table>


The versions of V8 used in Node v4.x and v6.x have already been abandoned by upstream V8. However, Node.js needs to continue supporting these branches for many months (Current branches) or several years (LTS branches).

# Maintenance Process

Once a bug in Node.js has been identified to be caused by V8, the first step is to identify the versions of Node and V8 affected. The bug may be present in multiple different locations, each of which follows a slightly different process.

* Unfixed bugs. The bug exists in the V8 master branch.
* Fixed, but needs backport. The bug may need porting to one or more branches.
* Backporting to active branches.
* Backporting to abandoned branches.
* Backports identified by the V8 team. Bugs identified by upstream V8 that we haven't encountered in Node yet.

## Unfixed Upstream Bugs

If the bug can be reproduced on the [`vee-eight-lkgr` branch](https://github.com/v8/node/tree/vee-eight-lkgr), Chromium canary, or V8 tip-of-tree, and the test case is valid, then the bug needs to be fixed upstream first.

* Start by opening a bug upstream [using this template](https://bugs.chromium.org/p/v8/issues/entry?template=Node.js%20upstream%20bug).
* Make sure to include a link to the corresponding Node.js issue (if one exists).
* If the fix is simple enough, you may fix it yourself; [contributions](https://github.com/v8/v8/wiki/Contributing) are welcome.
* V8's build waterfall tests your change.
* Once the bug is fixed it may still need backporting, if it exists in other V8 branches that are still active or are branches that Node cares about. Follow the process for backporting below.

## Backporting to Active Branches

If the bug exists in any of the active V8 branches, we may need to get the fix backported. At any given time there are [two active branches](https://build.chromium.org/p/client.v8.branches/console) (beta and stable) in addition to master. The following steps are needed to backport the fix:

* Identify which version of V8 the bug was fixed in.
* Identify if any active V8 branches still contain the bug:
* A tracking bug is needed to request a backport.
* If there isn't already a V8 bug tracking the fix, open a new merge request bug using this [Node.js specific template](https://bugs.chromium.org/p/v8/issues/entry?template=Node.js%20merge%20request).
* If a bug already exists
* Add a reference to the GitHub issue.
* Attach *merge-request-x.x* labels to the bug for any active branches that still contain the bug. (e.g. merge-request-5.3, merge-request-5.4)
* Add ofrobots-at-google.com to the cc list.
* Once the merge has been approved, it should be merged using the [merge script documented in the V8 wiki](https://github.com/v8/v8/wiki/Merging%20&%20Patching). Merging requires commit access to the V8 repository. If you don't have commit access you can indicate someone on the V8 team can do the merge for you.
* It is possible that the merge request may not get approved, for example if it is considered to be a feature or otherwise too risky for V8 stable. In such cases we float the patch on the Node side. See the process on 'Backporting to Abandoned branches'.
* Once the fix has been merged upstream, it can be picked up during an update of the V8 branch, (see below).

## Backporting to Abandoned Branches

Abandoned V8 branches are supported in the Node.js V8 repository. The fix needs to be cherry-picked in the Node.js repository and V8-CI must test the change.

* For each abandoned V8 branch corresponding to an LTS branch that is affected by the bug:
* Open a cherry-pick PR on nodejs/node targeting the appropriate *vY.x-staging* branch (e.g. *v6.x-staging* to fix an issue in V8-5.1).
* Increase the patch level version in v8-version.h. This will not cause any problems with versioning because V8 will not publish other patches for this branch, so Node.js can effectively bump the patch version.
* In some cases the patch may require extra effort to merge in case V8 has changed substantially. For important issues we may be able to lean on the V8 team to get help with reimplementing the patch.
* Run Node's [V8-CI](https://ci.nodejs.org/job/node-test-commit-v8-linux/) in addition to the [Node CI](https://ci.nodejs.org/job/node-test-pull-request/).

An example for workflow how to cherry-pick consider the following bug: https://crbug.com/v8/5199. From the bug we can see that it was merged by V8 into 5.2 and 5.3, and not into V8 5.1 (since it was already abandoned). Since Node.js `v6.x` uses V8 5.1, the fix needed to cherry-picked. To cherry-pick, here's an example workflow:

* Download and apply the commit linked-to in the issue (in this case a51f429). `curl -L https://github.com/v8/v8/commit/a51f429.patch | git apply --directory=deps/v8`. If the branches have diverged significantly, this may not apply cleanly. It may help to try to cherry-pick the merge to the oldest branch that was done upstream in V8. In this example, this would be the patch from the merge to 5.2. The hope is that this would be closer to the V8 5.1, and has a better chance of applying cleanly. If you're stuck, feel free to ping @ofrobots for help.
* Modify the commit message to match the format we use for V8 backports. You may want to add extra description if necessary to indicate the impact of the fix on Node. In this case the original issue was descriptive enough. Example:
```
deps: cherry-pick a51f429 from V8 upstream

Original commit message:
[regexp] Fix case-insensitive matching for one-byte subjects.

The bug occurs because we do not canonicalize character class ranges
before adding case equivalents. While adding case equivalents, we abort
early for one-byte subject strings, assuming that the ranges are sorted.
Which they are not.

R=marja@chromium.org
BUG=v8:5199

Review-Url: https://codereview.chromium.org/2159683002
Cr-Commit-Position: refs/heads/master@{#37833}

PR-URL: <pr link>
```
* Open a PR against the `v6.x-staging` branch in the Node.js repo. Launch the normal and [V8-CI](https://ci.nodejs.org/job/node-test-commit-v8-linux/) using the Node.js CI system. We only needed to backport to `v6.x` as the other LTS branches weren't affected by this bug.

## Backports Identified by the V8 team

For bugs found through the browser or other channels, the V8 team marks bugs that might be applicable to the abandoned branches in use by Node.js. This is done through manual tagging by the V8 team and through an automated process that tags any fix that gets backported to the stable branch (as it is likely candidate for backporting further).

Such fixes are tagged with the following labels in the V8 issue tracker:

* `NodeJS-Backport-Review` ([V8](https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Review), [Chromium](https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Review)): to be reviewed if this is applicable to abandoned branches in use by Node.js. This list if regularly reviewed by the node team at Google to determine applicability to Node.js.
* `NodeJS-Backport-Approved` ([V8](https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Approved), [Chromium](https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Approved)): marks bugs that are deemed relevant to Node.js and should be backported.
* `NodeJS-Backport-Done` ([V8](https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Done), [Chromium](https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Done)): Backport for Node.js has been performed already.
* `NodeJS-Backport-Rejected` ([V8](https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Rejected), [Chromium](https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Rejected)): Backport for Node.js is not desired.

The backlog of issues with such is regularly reviewed by the node-team at Google to shepherd through the backport process. External contributors are welcome to collaborate on the backport process as well. Note that some of the bugs may be security issues and will not be visible to external collaborators.

# Updating V8

Node keeps a vendored copy of V8 inside of deps/ directory. In addition Node may need to float patches that do not exist upstream. This means that some care may need to be taken to update the vendored copy of V8.

## Minor updates (patch level)

Because there may be floating patches on the version of V8 in Node.js, it is safest to apply the patch level updates as a patch. For example, imagine that upstream V8 is at 5.0.71.47 and Node.js is at 5.0.71.32. It would be best to compute the diff between these tags on the V8 repository, and then apply that patch on the copy of V8 in Node.js. This should preserve the patches/backports that Node.js may be floating (or else cause a merge conflict).

The rough outline of the process is:

```shell
# Assuming your fork of Node.js is checked out in $NODE_DIR
# and you want to update the Node.js master branch.
# Find the current (OLD) version in
# $NODE_DIR/deps/v8/include/v8-version.h
cd $NODE_DIR
git checkout master
git merge --ff-only origin/master
git checkout -b V8_NEW_VERSION
curl -L https://github.com/v8/v8/compare/${V8_OLD_VERSION}...${V8_NEW_VERSION}.patch | git apply --directory=deps/v8
# You may want to amend the commit message to describe the nature of the update
```

V8 also keeps tags of the form *5.4-lkgr* which point to the *Last Known Good Revision* from the 5.4 branch that can be useful in the update process above.


## Major Updates

We upgrade the version of V8 in Node.js master whenever a V8 release goes stable upstream, that is, whenever a new release of Chrome comes out.

Upgrading major versions would be much harder to do with the patch mechanism above. A better strategy is to

1. Audit the current master branch and look at the patches that have been floated since the last major V8 update.
1. Replace the copy of V8 in Node.js with a fresh checkout of the latest stable V8 branch. Special care must be taken to recursively update the DEPS that V8 has a compile time dependency on (at the moment of this writing, these are only trace_event and gtest_prod.h)
1. Refloat (cherry-pick) all the patches from list computed in 1) as necessary. Some of the patches may no longer be necessary.

To audit for floating patches:

```shell
git log --oneline deps/v8
```

To replace the copy of V8 in Node, use the '[update-v8](https://gist.github.com/targos/8da405e96e98fdff01a395bed365b816)' script<sup>2</sup>. For example, if you want to replace the copy of V8 in Node.js with the branch-head for V8 5.1 branch:

```shell
cd $NODE_DIR
rm -rf deps/v8
path/to/update-v8 branch-heads/5.1
```

You may want to look at the commits created by the above scripts, and squash them once you have reviewed them.

This should be followed up with manual refloating of all relevant patches.

# Proposal: Using a fork repo to track upstream V8

The fact that Node.js keeps a vendored, potentially edited copy of V8 in deps/ makes the above processes a bit complicated. An alternative proposal would be to create a fork of V8 at nodejs/v8 that would be used to maintain the V8 branches. This has several benefits:

* The process to update the version of V8 in Node.js could be automated to track the tips of various V8 branches in nodejs/v8.
* It would simplify cherry-picking and porting of fixes between branches as the version bumps in v8-version.h would happen as part of this update instead of on every change.
* It would simplify the V8-CI and make it more automatable.
* The history of the V8 branch in nodejs/v8 becomes purer and it would make it easier to pull in the V8 team for help with reviewing.
* It would make it simpler to setup an automated build that tracks Node.js master + V8 lkgr integration build.

This would require some tooling to:

* A script that would update the V8 in a specific Node branch with V8 from upstream (dependent on branch abandoned vs. active).
* We need a script to bump V8 version numbers when a new version of V8 is promoted from nodejs/v8 to nodejs/node.
* Enabled the V8-CI build in Jenkins to build from the nodejs/v8 fork.

# Proposal: Dealing with the need to float patches to a stable/beta

Sometimes upstream V8 may not want to merge a fix to their stable branches, but we might. An example of this would be a fix for a performance regression that only affects Node.js and not the browser. At the moment we don't have a mechanism to deal with this situation. If we float a patch and bump the V8 version, we might run into a problem if upstream releases a fix with the same version number.

One idea we have been kicking around is that we could move to a 5-place version number in V8, e.g.: 5.4.500.30.${embedder}. The ${embedder} represents the number of patches an embedder is floating on top of an official V8 version. This would also help with auditing the floating patches in the Node commit history.

We are trying this out in https://github.com/nodejs/node/pull/9754. If this ends up working, we will investigate making this change upstream.

<!-- Footnotes themselves at the bottom. -->
## Notes

<sup>1</sup>Node.js 0.12 and older are intentionally omitted from this document as their support is ending soon.

<sup>2</sup>It seems that @targos is working on port of this script here https://github.com/targos/update-v8.