Advertisement
robertbira

Italian Translation Report: Node.js [Part 15 - 1098 words]

Jul 27th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.09 KB | None | 0 0
  1. An example for workflow how to cherry-pick consider the bug RegExp show inconsistent result with other browsers
  2. 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).
  3. Since Node.js uses V8 5.1, the fix needed to be cherry-picked.
  4. To cherry-pick, here's an example workflow:
  5. Download and apply the commit linked-to in the issue (in this case).
  6. If the branches have diverged significantly, this may not apply cleanly
  7. It may help to try to cherry-pick the merge to the oldest branch that was done upstream in V8.
  8. 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 for help.
  9. Modify the commit message to match the format we use for V8 backports and replace yourself as the author.
  10. You may want to add extra description if necessary to indicate the impact of the fix on Node.js. In this case the original issue was descriptive enough. Example:
  11. cherry-pick from V8 upstream
  12. Original commit message:
  13. Fix case-insensitive matching for one-byte subjects.
  14. 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.
  15. Open a PR against the branch in the Node.js repo. Launch the normal and V8 CI using the Node.js CI system. We only needed to backport to as the other LTS branches weren't affected by this bug.
  16. Backports Identified by the V8 team
  17. 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).
  18. Such fixes are tagged with the following labels in the V8 issue tracker:
  19. to be reviewed if this is applicable to abandoned branches in use by Node.js. This list if regularly reviewed by the Node.js team at Google to determine applicability to Node.js.
  20. marks bugs that are deemed relevant to Node.js and should be backported.
  21. Backport for Node.js has been performed already.
  22. Backport for Node.js is not desired.
  23. 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.
  24. Updating V8
  25. Node.js keeps a vendored copy of V8 inside of the deps/ directory. In addition, Node.js 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.
  26. Minor updates (patch level)
  27. 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).
  28. The rough outline of the process is:
  29. # Assuming your fork of Node.js is checked out in
  30. # and you want to update the Node.js master branch.
  31. # Find the current (OLD) version in
  32. # You may want to amend the commit message to describe the nature of the update
  33. V8 also keeps tags of the form which point to the Last Known Good Revision from the 5.4 branch that can be useful in the update process above.
  34. The tool can be used to simplify this task. Run minor to apply a minor update.
  35. Major Updates
  36. 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.
  37. Upgrading major versions would be much harder to do with the patch mechanism above. A better strategy is to
  38. Audit the current master branch and look at the patches that have been floated since the last major V8 update.
  39. 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 and)
  40. Reset the variable to in
  41. Refloat (cherry-pick) all the patches from list computed in 1) as necessary. Some of the patches may no longer be necessary.
  42. To audit for floating patches:
  43. To replace the copy of V8 in Node.js, use the tool. For example, if you want to replace the copy of V8 in Node.js with the branch-head for V8 5.1 branch:
  44. This should be followed up with manual refloating of all relevant patches.
  45. Proposal: Using a fork repo to track upstream V8
  46. The fact that Node.js keeps a vendored, potentially edited copy of V8 in makes the above processes a bit complicated. An alternative proposal would be to create a fork of V8 at that would be used to maintain the V8 branches. This has several benefits:
  47. The process to update the version of V8 in Node.js could be automated to track the tips of various V8 branches in
  48. It would simplify cherry-picking and porting of fixes between branches as the version bumps in would happen as part of this update instead of on every change.
  49. It would simplify the V8-CI and make it more automatable.
  50. The history of the V8 branch in becomes purer and it would make it easier to pull in the V8 team for help with reviewing.
  51. It would make it simpler to setup an automated build that tracks Node.js master + V8 lkgr integration build.
  52. This would require some tooling to:
  53. A script that would update the V8 in a specific Node.js branch with V8 from upstream (dependent on branch abandoned vs. active).
  54. We need a script to bump V8 version numbers when a new version of V8 is promoted from to
  55. Enabled the V8-CI build in Jenkins to build from the fork.
  56. Notes
  57. Node.js 0.12 and older are intentionally omitted from this document as their support has ended.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement