QtWebEngine/Rebase on New Chromium
Qt WebEngine keeps its branch of Chromium in the src/3rdparty/chromium submodule.
The submodule is a flattened and trimmed version of chromium where all the submodules of Chromium have been imported into a single module, and many large parts we don't need have been removed to save overhead.
The qtwebengine-chromium submodule has multiple branches.
- upstream-master is the pure snapshotted Chromum upstream
- xx-based are patched branches of Chromium xx with our patches applied to it.
In tools/scripts are a few scripts meant to help with the rebasing.
- init-repository.py can check out new version of Chromium matching requested versions
- take-snapshot.py can take a snapshot of an upstream Chromium version and apply our trimming logic to it, while copying it into src/3rdparty.
Rebase on new patch release
When updating to a new patch release of Chromium.
- Update tools/scripts/version_resolver.py with the new version
- Run "tools/scripts/init-repository.py --baseline-upstream" this will create src/3rdparty_upstream directory with Chromium from the given version
- Make sure src/3rdparty is checked out to 'upstream-master', and you have no files or changes there you want to preserve.
- Run "tools/script/take-snapshot.py" this will copy a trimmed version of src/3rdparty_upstream to src/3rdparty
- Stage all changes (new files and deleted files "git add -A") in src/3rdparty
- Commit and push to upstream-master
- Switch to latest xx-based branch
- Call "git merge upstream-master" and push the merge change to gerrit.
- Create commit in the main qtwebengine module where you include the update update version_resolver.py and the src/3rdparty SHA1 at the same time.
These steps can also be used if you need to use a new Chromium component that was previously trimmed away, or other files we trimmed away. Instead of changing version_resolver.py, you update take_snapshot.py so it includes the wanted files, but perform the same steps.
Cherry-picking patches
Google does not maintain older versions of Chrome. So if we need security patches or important bug fixes in a branch that is no longer Google's stable version, we need to cherry-pick patches.
The easiest way is usually to find the commit in Chromium git, and store it using 'git show >' or similar, and then apply and commit in our submodule. It is important to maintain most of the original commit message when doing so, especially the link to the Chromium review. Ensure though that the commit message clearly indicates that this is a cherry-pick or backported patch so we will know to skip it when rebasing on a new version.
After cherry-picking a patch, again remember to update the src/3rdparty submodule in the main module using a separate commit.