docs: update node upgrade doc (#13891)

Updates the node upgrade doc to take path changes into account as well as to incorporate the new `get-patch` script which simplifies work significantly.
This commit is contained in:
Shelley Vohr 2018-08-01 23:33:37 -07:00 committed by GitHub
parent c068bc7d3d
commit 48ae9b7a9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,50 +61,22 @@ We need to generate a patch file from each patch applied to V8.
2. Run `script/update` to get the latest libcc
- This will be time-consuming
3. Remove our copies of the old Node v8 patches
- (In libchromiumcontent repo) Read `patches/v8/README.md` to see which patchfiles
- (In libchromiumcontent repo) Read `patches/common/v8/README.md` to see which patchfiles
were created during the last update
- Remove those files from `patches/v8/`:
- Remove those files from `patches/common/v8/`:
- `git rm` the patchfiles
- edit `patches/v8/README.md`
- edit `patches/common/v8/README.md`
- commit these removals
4. Inspect Node [repo](https://github.com/electron/node) to see what patches upstream Node
used with their v8 after bumping its version
- `git log --oneline deps/V8`
- `git log --oneline "deps/v8"`
5. Create a checklist of the patches. This is useful for tracking your work and for
having a quick reference of commit hashes to use in the `git diff-tree` step below.
6. Read `patches/v8/README.md` to see which patchfiles came from the previous version of V8 and therefore need to be removed.
- Delete each patchfile referenced in `patches/v8/README.md`
7. For each patch, do:
- (In node repo) `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"
- (remainder of steps in libchromium repo)
Manually edit the `.patch` file to match upstream V8's directory:
- If a diff section has no instances of `deps/V8`, remove it altogether.
- We dont want those patches because were only patching V8.
- Replace instances of `a/deps/v8/filename.ext` with `a/filename.ext`
- This is needed because upstream Node keeps its V8 files in a subdirectory
- Ensure that local status is clean: `git status` to make sure there are no unstaged changes.
- Confirm that the patch applies cleanly with
`script/patch.py -r src/V8 -p patches/v8/xxx-patch_name.patch.patch`
- Create a new copy of the patch:
- `cd src/v8 && git diff > ../../test.patch && cd ../..`
- This is needed because the first patch has Node commit checksums that we don't want
- Confirm that checksums are the only difference between the two patches:
- `diff -u test.patch patches/v8/xxx-patch_name.patch`
- Replace the old patch with the new:
- `mv test.patch patches/v8/xxx-patch_name.patch`
- Add the patched code to the index _without_ committing:
- `cd src/v8 && git add . && cd ../..`
- We don't want to commit the changes (they're kept in the patchfiles)
but need them locally so that they don't show up in subsequent diffs
while we iterate through more patches
- Add the patch file to the index:
- `git add a patches/v8/`
- (Optionally) commit each patch file to ensure you can back up if you mess up a step:
- `git commit patches/v8/`
8. Update `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.
6. Read `patches/common/v8/README.md` to see which patchfiles came from the previous version of V8 and therefore need to be removed.
- Delete each patchfile referenced in `patches/common/v8/README.md`
7. Apply all patches with the [`get-patch` script](https://github.com/electron/libchromiumcontent/blob/master/script/README.md#get-patch):
- `./script/get-patch --repo src/v8 --output-dir patches/v8 --commit abc123 def456 ...`
8. Update `patches/common/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.
9. Update Electron's submodule references:
```sh
$ cd electron/vendor/node
@ -115,8 +87,8 @@ We need to generate a patch file from each patch applied to V8.
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$ git commit -m "update submodule references for node and libcc"
electron$ git push origin upgrade-to-chromium-<VERSION>
electron$ script/bootstrap.py -d
electron$ script/build.py -c -D
```