Angle Branch Merge angle-branch-merge
Use when merging, cherry-picking, or rebasing an ANGLE CL onto a Chromium milestone release branch (e.g., chromium/8127 or M158), or resolving conflicts on a chrome-cherry-picker ANGLE merge CL.
- Our test
- 8/10✓ Verified
- tested Dec 6, 2026
- GitHub stars
- 26k
- chromium/chromium
- Added by
- 0
- members
- Updated
- Dec 6
- commit 8cf236c
- Content
- 2 files
- no scripts · 16 KB
- License
- BSD 3-Clause
- free to use
What our test found
The skill gives detailed, ANGLE-specific backport guidance with useful safeguards for branch state, conflict resolution, testing, and Gerrit uploads.
Limits spotted
- The long, highly procedural workflow may be difficult to apply without carefully tracking placeholders and the current checkout state.
- Some recovery commands, such as `git reset --hard`, can discard work if used without confirming repository status.
- The instructions rely on Chromium-specific tools, branch conventions, and Gerrit access.
name: angle-branch-merge description: >- Use when merging, cherry-picking, or rebasing an ANGLE CL onto a Chromium milestone release branch (e.g., chromium/8127 or M158), or resolving conflicts on a chrome-cherry-picker ANGLE merge CL.
Merging an ANGLE CL to a Release Branch
ANGLE release branches live in the standalone angle/angle repository as refs/heads/chromium/{branch_num} while the corresponding Chromium milestone branch lives in chromium/src as refs/branch-heads/{branch_num}. Performing and validating an ANGLE merge inside third_party/angle of a Chromium release branch checkout ensures the backport compiles cleanly with chrome and passes angle_unittests and angle_end2end_tests against the exact milestone dependencies. Follow the Chromium Merge Request Process alongside the ANGLE-specific steps below.
Prerequisites & Inputs
Before modifying any branches, confirm or gather:
- Source CL & Target Branch:
- Original
angle/anglemainCL number orChange-Id(I...). - Milestone number
M{milestone}and 4-digit branch number{branch_num}(for example, M158 ->8127, meaning Chromiumbranch-heads/8127and ANGLEchromium/8127). - Build Directory (`{out_dir}`):
- Confirm which Chromium output directory to use (for example,
out/Releaseorout/Default) before syncing or building. Ask the user if unclear. - Upload State (WIP vs. Ready for Review):
- Confirm whether the uploaded patchset should stay Work-in-Progress (no mail sent) or be sent for review (
-r <reviewer> --send-mail). - `depot_tools` on `PATH`:
- Non-interactive subshells often skip
~/.bashrcand fail withgit: 'cl' is not a git command. Checkwhich gclient git-cl autoninja vpython3upfront; if missing, locatedepot_toolsand prepend it toPATHin every command invocation.
Workflow
Step 1: Check Gerrit for an Existing Cherry-Pick CL First
When a merge is approved on Chromium Issue Tracker, automation (chrome-cherry-picker@chops-service-accounts.iam.gserviceaccount.com) usually creates a WIP cherry-pick CL on angle/angle branch chromium/{branch_num} sharing the original Change-Id. If cherry-picking hit conflicts, Gerrit creates the WIP CL anyway with literal <<<<<<< conflict markers committed in Patchset 1.
Always query Gerrit before creating a cherry-pick so you do not create a duplicate CL or lose cherry_pick_of_change tracking metadata:
# 1. Inspect the original main CL to get its Change-Id, Bug, and file list:
curl -s "https://chromium-review.googlesource.com/changes/angle%2Fangle~{source_cl}?o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES" \
| tail -n +2
# 2. Search for an existing cherry-pick CL on chromium/{branch_num}:
curl -s "https://chromium-review.googlesource.com/changes/?q=project:angle/angle+branch:chromium/{branch_num}+change:{change_id}&o=CURRENT_REVISION&o=CURRENT_COMMIT" \
| tail -n +2- If `{merge_cl}` already exists on `chromium/{branch_num}`: Reuse it in Step 3. ANGLE committers can upload new patchsets directly onto
chrome-cherry-picker-owned CLs. - If no CL exists on `chromium/{branch_num}`: Create one via
git cl cherry-pick --host="https://chromium-review.googlesource.com" --branch="refs/heads/chromium/{branch_num}" --allow-conflicts {main_commit_sha}rather than a rawgit cherry-pick, so Gerrit recordscherry_pick_of_changeand creates{merge_cl}even when conflicts are present (without blocking on an interactive prompt). Fall back to a localgit cherry-pick -x {main_commit_sha}in Step 3 only ifgit cl cherry-pickcannot create a server-side CL; if so, prefix the commit title with[M{milestone}]and keep the originalChange-Id:.
Step 2: Checkout and Sync the Chromium Release Branch Safely
Order matters when switching a Chromium main checkout to a release branch:
- Check for uncommitted changes and detach `third_party/angle` first:
- Inspect
git status -sbinsrc/andgit -C third_party/angle status -sb. Do not clobber uncommitted work; ask or stash first. - Gotcha: If
third_party/angleis sitting on a local feature branch trackingorigin/main,gclient syncwill attempt to rebase that local branch ontochromium/{branch_num}and fail mid-sync with rebase conflicts. Detachthird_party/anglefirst so local branches remain untouched at their commits: ``bash git -C third_party/angle checkout --detach``
- Fetch `branch-heads/{branch_num}`, sync with `--with_branch_heads`, then set `git cl upstream`:
- Gotcha: Running
git cl upstream branch-heads/{branch_num}beforegclient sync --with_branch_headsfails withstarting point 'branch-heads/...' is not a branchwhen the checkout has not yet configured thebranch-headsfetch refspec.
git fetch origin "refs/branch-heads/{branch_num}:refs/remotes/branch-heads/{branch_num}"
git checkout -B "m{milestone}-{branch_num}" "refs/remotes/branch-heads/{branch_num}"
gclient sync --with_branch_heads
git cl upstream "branch-heads/{branch_num}"- Watch out for moved nested `DEPS` subrepos (avoid `gclient sync -D`):
- Gotcha: Omit
-Dwhen switching betweenmainand an older release branch. When a nestedDEPSentry onmain(for example,third_party/wayland-protocols/kde/src) replaces a directory that was tracked directly inside a parent subrepo on the release branch (third_party/wayland-protocols/kde),gclient sync -Ddeletes the nested directory after syncing the parent repo, causing missing-file build errors. - If
-Dwas already used orgit checkoutprintedwarning: unable to rmdir '...': Directory not empty, checkgit statusinside the affectedthird_party/subrepo and restore deleted tracked files: ``bash git -C third_party/<affected_subrepo> reset --hard HEAD``
Step 3: Patch (or Locally Cherry-Pick) the Merge CL in third_party/angle and Fix Upstream
Inside third_party/angle, create a clean local branch off origin/chromium/{branch_num}, patch {merge_cl}, and immediately fix the branch upstream:
cd third_party/angle
git fetch origin "refs/heads/chromium/{branch_num}:refs/remotes/origin/chromium/{branch_num}"
git checkout -B "m{milestone}-merge-{merge_cl}" "origin/chromium/{branch_num}"
git cl patch -f "https://chromium-review.googlesource.com/c/angle/angle/+/{merge_cl}"
git cl upstream "origin/chromium/{branch_num}"- CRITICAL GOTCHA:
git cl patchsetsbranch.<name>.gerritissue = {merge_cl}, but resets `branch.<name>.merge` to `refs/heads/main`, even if the branch started fromorigin/chromium/{branch_num}or-bwas passed! Always rungit cl upstream "origin/chromium/{branch_num}"aftergit cl patchand verify both settings before proceeding: ``bash git config --get-regexp "branch\.m{milestone}-merge-{merge_cl}\.(merge|gerritissue)" # Expected: # branch.m{milestone}-merge-{merge_cl}.merge refs/heads/chromium/{branch_num} # branch.m{milestone}-merge-{merge_cl}.gerritissue {merge_cl}`` - Local cherry-pick fallback (if no `{merge_cl}` exists on Gerrit yet): Skip
git cl patchand cherry-pick directly onto the local branch offorigin/chromium/{branch_num}: ``bash cd third_party/angle git fetch origin "refs/heads/main:refs/remotes/origin/main" \ "refs/heads/chromium/{branch_num}:refs/remotes/origin/chromium/{branch_num}" git checkout -B "m{milestone}-merge-{source_cl}" "origin/chromium/{branch_num}" git cl upstream "origin/chromium/{branch_num}" git cherry-pick -x "{main_commit_sha}"`In this fallback path,branch.<name>.gerritissuewill only be populated after the firstgit cl uploadin Step 6 creates{merge_cl}`.
Step 4: Resolve ANGLE-Specific Conflicts and Audit Semantic Drift
Locate all conflict markers (git grep -n '<<<<<<<'). Apply ANGLE's domain-specific rules rather than blindly picking --ours or --theirs:
- `include/GLSLANG/ShaderLang.h` (`ANGLE_SH_VERSION`):
- Never copy
main's higherANGLE_SH_VERSIONnumber onto a release branch. ANGLE's_CheckShaderVersionInShaderLangHeaderpresubmit requires incrementing the target release branch's currentANGLE_SH_VERSIONby+1: ``bash git show "origin/chromium/{branch_num}:include/GLSLANG/ShaderLang.h" \ | grep "define ANGLE_SH_VERSION"`` - If
ShCompileOptionsbitfields changed, verify bitfield declarations and surrounding members againstorigin/chromium/{branch_num}.
- *ANGLE Features (`include/platform/_features.json
and_autogen.`)**:
- Do not hand-merge conflict markers in
include/platform/autogen/Features*_autogen.horutil/autogen/angle_features_autogen.{h,cpp}— manual resolution easily retainsmain-only or renamedFeature::*enums that do not exist in the branch's JSON definitions and breaks compilation. - Resolve only the JSON source files (
include/platform/*_features.json), then regenerate and verify usinginclude/platform/gen_features.py: ``bash ( cd include/platform && vpython3 gen_features.py && vpython3 gen_features.py --verify-only )`` - Note:
gen_features.pyis not listed underscripts/code_generation_hashes/. If the CL modifies other generated files, inspectscripts/run_code_generation.pyfor the corresponding generator script.
- Semantic C++ Drift Audit:
- Even in files without git conflict markers, review every touched function against
origin/chromium/{branch_num}to confirm all helper functions, struct fields, renderer feature flags, and enum values referenced by the cherry-pick exist with compatible semantics on the release branch.
Step 5: Build and Run Chrome & ANGLE Test Suites
Return to the Chromium src/ root, then build chrome, angle_end2end_tests, and angle_unittests:
cd ../..
autoninja --quiet -C "{out_dir}" chrome angle_end2end_tests angle_unittestsRun both test suites (use testing/xvfb.py on headless Linux):
- Run `angle_unittests`:
testing/xvfb.py "{out_dir}/angle_unittests"- Run `angle_end2end_tests` (targeted + related suites):
- First run the exact test(s) added or modified by the CL: ``
bash testing/xvfb.py "{out_dir}/angle_end2end_tests" \ --gtest_filter="*MyAddedOrModifiedTest*"`` - For broader suites (hundreds or thousands of tests), always pass `--bot-mode` and `--results-file`: ``
bash testing/xvfb.py "{out_dir}/angle_end2end_tests" \ --bot-mode \ --results-file="/tmp/angle_end2end_results.json" \ --gtest_filter="*RelevantSuite*"`` - Why `--bot-mode`: Running thousands of
Vulkan_SwiftShadertests in a single process without--bot-modecan segfault during process teardown inmarl::Scheduler::unbind(), whereas--bot-moderuns isolated multiprocess batches in parallel like CQ bots. - Why `--results-file`: Without
--results-file,--bot-modewritesoutput.jsoninto the current working directory (src/), leaving untracked artifacts in the checkout. - Headless Linux OpenGL note: Under Xvfb's software Mesa
llvmpipedriver, some unrelatedES3_1_OpenGLdesktop GL tests may fail due to software driver limitations; verify your new/relevant tests pass across supported backends (Vulkan_SwiftShader,ES3_OpenGL, etc.) and compare against unpatchedorigin/chromium/{branch_num}if in doubt.
Step 6: Format, Stage Explicitly, Presubmit, and Upload
Inside third_party/angle:
- Format and stage explicit file paths only:
cd third_party/angle
git cl format- Gotcha: Stage explicit file paths only (
git add <file1> <file2>), nevergit add -uorgit commit -a. Inside a Chromium checkout,third_party/anglehas unbootstrapped/dirty nested submodule gitlinks (such asthird_party/VK-GL-CTS/srcandthird_party/rapidjson/src) that-uor-acan accidentally stage into your commit. - Amend the patched commit without altering the commit message footers (
Change-Id:,Bug:,(cherry picked from commit ...)): ``bash GIT_EDITOR=true git commit --amend --no-edit`If you used the localgit cherry-pick -xfallback and Git is paused atCHERRY_PICK_HEAD, complete the cherry-pick withgit commitinstead of--amend, prefixing the commit title with[M{milestone}]and keeping the originalChange-Id:`. - Verify
git show --stat,git diff "origin/chromium/{branch_num}", and confirmgit grep -n '<<<<<<<'returns no matches in tracked files.
- Handle `PRESUBMIT.py` in an un-bootstrapped `third_party/angle`:
- Run
git cl presubmit --upload. - In a standard Chromium checkout (where
third_party/anglehas not been standalone-bootstrapped viascripts/bootstrap.py), ANGLE'sPRESUBMIT.pyfails on two standalone-only checks that expect standalonethird_party/angle/third_party/checkouts: scripts/export_targets.py(third_party/depot_tools/gn.pymissing)scripts/run_code_generation.py --verify-no-dirty(third_party/spirv-headers/vulkan-headersmissing)- Verify that every other presubmit check passes (formatting, commit footers,
_CheckShaderVersionInShaderLangHeader, andvpython3 gen_features.py --verify-only), report the two standalone-only presubmit failures clearly, and ask the user for confirmation before passing--bypass-hooks.
- Upload the resolved patchset to Gerrit:
- Re-verify
branch.<name>.mergeisrefs/heads/chromium/{branch_num}andbranch.<name>.gerritissueis{merge_cl}(for the localgit cherry-pick -xfallback,gerritissueis unset before upload and is populated once this firstgit cl uploadcreates{merge_cl}). - To keep the CL WIP (no email notifications): ``
bash # Updating an existing {merge_cl}: git cl upload -f --title="Resolve merge conflicts" # Or initial upload from local cherry-pick fallback (omit --title): git cl upload -f`(append--bypass-hooks` only if approved by the user in step 2). - To mark Ready for Review, pass
-r <reviewer> --send-mail(typically the reviewer of the originalmainCL). - Query Gerrit afterward to confirm the new patchset landed on
{merge_cl}targetingchromium/{branch_num}with the expected parent commit and changed files: ``bash curl -s "https://chromium-review.googlesource.com/changes/angle%2Fangle~{merge_cl}?o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES" \ | tail -n +2``
Step 7 (Optional): Return the Checkout to origin/main
If switching the Chromium workspace back to origin/main after uploading, first return from third_party/angle to the Chromium src/ root:
- Return to the Chromium
src/root and detachthird_party/anglefirst sogclient syncdoes not try to rebasem{milestone}-merge-{merge_cl}ontoorigin/main: ``bash cd ../.. git -C third_party/angle checkout --detach`` - Fetch
origin/mainand switch to an existing local branch or create/reset a branch offorigin/main: ``bash git fetch origin main # Switch back to an existing local branch: git checkout <branch_name> # Or create a new branch off origin/main (use -B to reset an existing branch): git checkout -b <branch_name> origin/main`` - Gotcha: If a
third_party/<subrepo>directory was a separateDEPSgit repo on the release branch (for example,third_party/libunwindstack) but is tracked directly insidechromium/srconmain,git checkoutaborts withThe following untracked working tree files would be overwritten. Verifygit -C third_party/<subrepo> status --porcelainis empty, remove that directory, and re-rungit checkout. - From the Chromium
src/root, rungclient syncto re-align all subrepositories and hooks withmain.