One upgrade issue is building all of Electron with a single copy of V8 to ensure compatibility. This is important because upstream Node and libchromiumcontent both use their own versions of V8.
Upgrading Node is much easier than upgrading libchromiumcontent, so fewer conflicts arise if one upgrades libchromiumcontent first, then chooses the upstream Node release whose V8 is closest to it.
Electron has its own Node fork with modifications for the V8 build details mentioned above and for exposing API needed by Electron. Once an upstream Node release is chosen, it's placed in a branch in Electron's Node fork and any Electron Node patches are applied there.
Another factor is that the Node project patches its version of V8. As mentioned above, Electron builds everything with a single copy of V8, so Node's V8 patches must be ported to that copy.
Once all of Electron's dependencies are building and using the same copy of V8, the next step is to fix any Electron code issues caused by the Node upgrade.
[FIXME] something about a Node debugger in Atom that we (e.g. deepak) use and need to confirm doesn't break with the Node upgrade?
So in short, the primary steps are:
master
on electron/node
has updated release tags from nodejs/node
electron-node-vX.X.X
where the base that you're branching from is the tag for the desired update
vX.X.X
Must use a version of node compatible with our current version of chromiumvY.Y.Y
) to v.X.X.X
vY.Y.Y
& v.X.X.X
git cherry-pick FIRST_COMMIT_HASH..LAST_COMMIT_HASH
git add <conflict-file>
git cherry-pick --continue
We need to generate a patch file from each patch applied to V8.
$ git clone https://github.com/electron/libchromiumcontent
script/update
to get the latest libcc
patches/v8/README.md
to see which patchfiles
were created during the last updatepatches/v8/
:git rm
the patchfilespatches/v8/README.md
git log --oneline deps/V8
git diff-tree
step below.patches/v8/README.md
to see which patchfiles came from the previous version of V8 and therefore need to be removed.
patches/v8/README.md
git diff-tree --patch HASH > ~/path_to_libchromiumcontent/patches/v8/xxx-patch_name.patch
xxx
is an incremented three-digit number (to force patch order)patch_name
should loosely match the node commit messages,
e.g. 030-cherry_pick_cc55747,patch
if the Node commit message was "cherry-pick cc55747".patch
file to match upstream V8's directory:deps/V8
, remove it altogether.
a/deps/v8/filename.ext
with a/filename.ext
git status
to make sure there are no unstaged changes.script/patch.py -r src/V8 -p patches/v8/xxx-patch_name.patch.patch
cd src/v8 && git diff > ../../test.patch && cd ../..
diff -u test.patch patches/v8/xxx-patch_name.patch
mv test.patch patches/v8/xxx-patch_name.patch
cd src/v8 && git add . && cd ../..
git add a patches/v8/
git commit patches/v8/
patches/v8/README.md
with references to all new patches that have been added so that the next person will know which need to be removed.sh
$ cd electron/vendor/node
electron/vendor/node$ git fetch
electron/vendor/node$ git checkout electron-node-vA.B.C
electron/vendor/node$ cd ../libchromiumcontent
electron/vendor/libchromiumcontent$ git fetch
electron/vendor/libchromiumcontent$ git checkout upgrade-to-chromium-X
electron/vendor/libchromiumcontent$ cd ../..
electron$ git add vendor
electron$ git commit -m "update submodule referefences for node and libc"
electron$ git pso upgrade-to-chromium-62
electron$ script/bootstrap.py -d
electron$ script/build.py -c -D
node/common.gypi