-
Notifications
You must be signed in to change notification settings - Fork 123
Merging blink into chromium
This wiki page describes the steps we have taken to adapt to upstream's merging of the Blink repository into the main Chromium one. The intention is simply to have it documented somewhere out of historical interest and in case something similar needs to be done in the future.
For a long time after Google forked WebKit and created the Blink project, there had been discussions about whether to merge it into the main Chromium tree for a variety of reasons. The plan took a few years to materialize, and involved, among other things, first migrating Chromium's repository from SVN to git.
The big merge finally happened in September 2015. Since then, Chromium's master branch and all releases made after the merge include src/third_party/WebKit
as part of the main Chromium git repository. This was done by preserving Blink's commit history all the way from the early 2000's and then doing one single merge commit connecting Chromium's and Blink's histories.
The steps described in this page are mainly based on the following two links:
- http://permalink.gmane.org/gmane.comp.web.chromium.devel/67612
- https://www.chromium.org/blink/blink-post-merge-faq
-
Save Crosswalk's custom blink-crosswalk commits somewhere.
cd src/third_party/WebKit git log # Figure out latest upstream commit (e.g. 1234beef). git format-patch 1234beef.. mv *.patch /safe/location
-
Remove blink-crosswalk from the tree.
rm -fr src/third_party/WebKit
-
Note down the hash you are at in chromium-crosswalk (e.g. a49762acd2ab1f2803c7bb8898f50d9109f3cb12).
cd src git rev-parse HEAD a49762acd2ab1f2803c7bb8898f50d9109f3cb12
-
Fetch a new Chromium post-merge. In this example, we are moving from 45.0.2454.93 (pre-merge upstream) to 45.0.2454.101 (post-merge).
cd src git fetch https://chromium.googlesource.com/chromium/src.git +refs/tags/45.0.2454.101:m45-vanilla
This will likely take some time, as it fetches around 1.5GB of new commit data.
-
Do the required git black magic, as described in the chromium-dev email linked above and in the Git Book.
cd src # Assuming you are at a branch called master. git rebase -i --onto m45-vanilla `git merge-base master m45-vanilla` master # Skip the first commit ("Publish DEPS for [...]")
As explained in the references, this translates to "take all the commits between the previous state of master before the merge (i.e. the output of merge-base cmd) and the head of master and replay them on top of the new m45-vanilla (post merge point)".
-
Apply the blink-crosswalk commits saved in the first step.
cd src # -i is for interactive, in case you want to retitle the patches. git am -i -3 --directory third_party/WebKit /safe/location/*.patch
-
Follow the usual rebasing instructions.
-
Make sure you
gclient sync
to sync everything.
-
If you did not remove
src/third_party/WebKit
in the steps above, whengclient sync
is called it will be moved to a different location (likelysrc/../old_src_third_party_WebKit.git
). If you do not have any use for it, you should remove it to free up some disk space. -
The update process can take a very long time on bots that have few resources, so be prepared (fetching the new data before a bot is triggered is a good idea).
-
If you use git caches, you can remove the git cache for blink-crosswalk (the same applies to the bots).