1 of 25

Up-to-date

Node.js Collaborator Summit 2018-10-12

Yang Guo Google/V8 @hashseed @v8js

2 of 25

Agenda

Release schedules

Versions

ABI stability

Deprecation policy

Bisection

3 of 25

Prague astronomical clock, source: wikipedia.org

4 of 25

Chromium release schedule

Current tip-of-tree version: 71

Every 6 weeks:

  • current_version++
  • beta_version = current_version - 1
  • stable_version = beta_version - 1

Code committed today reaches

  • Canary channel within a day
  • Dev channel within a week
  • Beta channel within 6 weeks
  • Stable channel in 6-12 weeks

Source: www.chromium.org/getting-involved/dev-channel� www.chromium.org/developers/calendar

@v8js

@hashseed

5 of 25

V8 release schedule

Current tip-of-tree version: 7.1

Version bump and new branch every 6 weeks

Version X.Y corresponds to Chrome XY�(no semantic versioning)

Autoroll several times per day�(updating Chrome with new V8 version)

API freeze 7 days before branch

Continuously tested against Node.js and Chromium

Maintained until next branch is promoted to stable

Source: github.com/v8/v8/wiki/Release-Process

@v8js

@hashseed

6 of 25

V8 release schedule

6 weeks

branch point

stable

stable

beta

stable

current (master)

current (master)

beta

beta

current (master)

backmerges

@v8js

@hashseed

7 of 25

Backmerges of V8 commits

V8

stable and beta branches

security fixes

stability fixes

performance improvements

new features

API changes

Node

master and LTS branches

security fixes

stability fixes

performance improvements

new features

API changes

API reverts

“Float” patches downstream

Source: github.com/nodejs/node/issues/19354#issuecomment-373157341

@v8js

@hashseed

8 of 25

V8 version

node -e "console.log(process.versions.v8)"

7.0.276.24-node.5

not semver

@v8js

@hashseed

9 of 25

V8 version

node -e "console.log(process.versions.v8)"

7.0.276.24-node.5

V8 version

Build number

Patch level

Embedder string

@v8js

@hashseed

10 of 25

Node release schedule

Node.js master

  • https://github.com/nodejs/node/tree/master
  • development branch
  • updates to latest stable V8 release

Node.js canary

  • https://github.com/nodejs/node-v8/tree/canary
  • maintained by @targos
  • daily builds with current V8
  • simplifies updating master

@v8js

@hashseed

11 of 25

Node release schedule

vee-eight-lkgr

  • https://github.com/v8/node/tree/vee-eight-lkgr
  • lkgr = last-known good revision
  • fork maintained by the V8 team
  • infrequently syncs with upstream master
  • used for integration test and commit queue
  • does not update gyp
  • floating fixes

@v8js

@hashseed

12 of 25

Node release schedule

LTS branch

  • currently: 10
  • once a year
  • initial release April
  • LTS from October
  • 3 year lifetime

non-LTS branch

  • currently: 11
  • once a year in October

Source: github.com/nodejs/Release

@v8js

@hashseed

13 of 25

V8 in Node 10

Node 10

initial release Apr. 24

LTS promotion Oct.

V8

6.5 Mar. 06

6.6 Apr. 17

6.7 May 29

6.8 July 24

6.9 Sep. 04

7.0 Oct. 16

Source: github.com/nodejs/node/issues/19354#issuecomment-373157341

@v8js

@hashseed

14 of 25

Compatibility table, source: astrology-zodiac-signs.com

15 of 25

ABI stability

API compatibility = can compile

ABI compatibility = can link

add new API

append enum element

remove/rename API

add optional function parameter

reorder enum, change constant value

change inline implementation in the header

@v8js

@hashseed

16 of 25

ABI stability

Node.js

  • same version guarantees ABI stability to addons
  • exposes v8.h directly
  • same version can only upgrade to ABI-compatible V8

For Node 10

  • API for 6.7 is frozen at initial release
  • initially release 6.6 w/ forward compat patch
  • after 6 weeks 6.7 w/o patch
  • Another 6 weeks 6.8 w/ backward compat patch
  • @psmarshall and @targos

Source: github.com/nodejs/node/issues/19354#issuecomment-373157341

@v8js

@hashseed

17 of 25

V8 in Node 10

Node 10

initial release Apr. 24

LTS promotion Oct.

V8

6.5 Mar. 06

6.6 Apr. 17

6.7 May 29

6.8 July 24

6.9 Sep. 04

7.0 Oct. 16

Source: github.com/nodejs/node/issues/19354#issuecomment-373157341

@v8js

@hashseed

18 of 25

Deprecation policy

V8

  • Mark as V8_DEPRECATED_SOON
  • Remove uses in Chrome and V8
  • Mark as V8_DEPRECATED
  • Wait at least 1 version bump (6 weeks)
  • Remove

Node.js

  • Mark as deprecated
  • Wait at least 1 version bump (6 months)
  • Remove

Source: bit.ly/2OD9HFY

@v8js

@hashseed

19 of 25

Bisection, in a nutshell

20 of 25

Bisection

Node 8 .. Node 10 ~3600 commits

V8 6.2 .. V8 6.8 ~5800 commits

  • Try to find pure JavaScript repro for d8
  • Bisection with Node.js is more involved
  • Patience

@v8js

@hashseed

21 of 25

Bisection in V8

Start bisection

git bisect start

Test current revision

gclient sync�tools/dev/gm.py x64.release.d8�out/x64.release/d8 -e "console.log(BigInt === undefined)"�false�git bisect bad

Choose candidate and test again. Rinse and repeat

git checkout branch-heads/6.5�gclient sync�tools/dev/gm.py x64.release.d8�out.gn/x64.release/d8 -e "console.log(BigInt === undefined)"�true�git bisect good

@v8js

@hashseed

22 of 25

Bisection in Node.js

Bisected to

commit 6a31d05340b22fc413ee83eaacd0a5565bbbe799�Author: Michaël Zasso <[email protected]>�Date: Wed Jul 25 19:30:07 2018 +0200�� deps: update V8 to 6.8.275.24�� PR-URL: https://github.com/nodejs/node/pull/21079� Reviewed-By: James M Snell <[email protected]>� Reviewed-By: Matteo Collina <[email protected]>� Reviewed-By: Colin Ihrig <[email protected]>� Reviewed-By: Yang Guo <[email protected]>

Now what?

@v8js

@hashseed

23 of 25

Finding V8 commit range

git diff 6a31d05340b^ 6a31d05340b deps/v8/include/v8-version.h��diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h�index 09c47d7e91..e57efc3084 100644�--- a/deps/v8/include/v8-version.h�+++ b/deps/v8/include/v8-version.h�@@ -9,9 +9,9 @@� // NOTE these macros are used by some of the tool scripts and the build� // system so their names cannot be changed without changing the scripts.� #define V8_MAJOR_VERSION 6�-#define V8_MINOR_VERSION 7�-#define V8_BUILD_NUMBER 288�-#define V8_PATCH_LEVEL 49+#define V8_MINOR_VERSION 8�+#define V8_BUILD_NUMBER 275�+#define V8_PATCH_LEVEL 24

Source: https://github.com/v8/v8/wiki/Using-Git

@v8js

@hashseed

24 of 25

Bisect in V8, test in Node.js

Set bisection range

cd path/to/v8�git checkout 6.7.288.49�git bisect start�git bisect bad�git checkout 6.8.275.24�git bisect good

Update Node.js with V8

tools/node/update_node.py . path/to/node --gclient

Build Node.js (and hope API did not change)

cd path/to/node�./configure --build-v8-with-gn # to not rely on up-to-date gyp configs�make -j4 node

@v8js

@hashseed

25 of 25

New Chrome and V8 release every 6 weeks

New Node.js release every 6 months

V8 is updated between initial release and LTS promotion ABI needs to stay stable

Bisection is easier if the repro does not rely on Node.js

Reach out: @hashseed