Skip to content

build: sync the WebRTC checkout without git history - #298

Merged
devopvoid merged 1 commit into
mainfrom
build/shallow-webrtc-checkout
Sep 27, 2026
Merged

devopvoid merged 1 commit into
mainfrom
build/shallow-webrtc-checkout

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

The WebRTC checkout was created with fetch webrtc, which clones src and every git dependency with their full history before checking out the branch. This makes the first build download far more than it needs.

Changes

  • CMake now writes .gclient itself, with the branch pinned in the solution URL (src.git@refs/branch-heads/7977), and runs gclient sync --no-history --shallow (hooks run afterwards through gclient runhooks). webrtc.branch values map to refs: branch-heads/N becomes refs/branch-heads/N, other names become refs/heads/<name>, and refs/... is used as is.
  • depot_tools is cloned with --depth 1.
  • checkout_instrumented_libraries is set to False; those libraries only serve sanitizer builds on Linux.

Size

Fresh Windows checkout of branch-heads/7977, excluding build output:

Checkout Size
fetch webrtc (before) 26.6 GB
shallow sync (after) ~12.2 GB

Almost all of the difference is git history (15.9 GB of .git directories before, 1.5 GB after).

Looked at but kept: catapult (//testing/BUILD.gn references it, so gn gen fails without it), tflite and perfetto (referenced unconditionally), and rust-toolchain (a GCS dependency keyed per archive hash, with no DEPS variable to switch it off).

Testing

On Windows, mvn -pl webrtc-jni,webrtc -am verify against a fresh shallow checkout: the WebRTC build, the JNI build, and all 175 webrtc tests passed. The sync lands on the same commit as a full checkout. Linux and macOS are covered by CI, which rebuilds WebRTC here because the cache key hashes this CMakeLists.txt; the checkout_instrumented_libraries setting only takes effect on Linux, so CI is its first test there.

The checkout was created with "fetch webrtc", which clones src and every
git dependency with full history, and only then checks out the branch.
The branch is now pinned in a .gclient written by CMake and synced with
--no-history --shallow, and depot_tools is cloned at depth 1. The
instrumented libraries, used only by sanitizer builds on Linux, are no
longer checked out.

A fresh Windows checkout of branch-heads/7977 shrinks from 26.6 GB to
about 12 GB, nearly all of it git history.
@devopvoid
devopvoid merged commit 15da33c into main Sep 27, 2026
20 of 21 checks passed
@devopvoid
devopvoid deleted the build/shallow-webrtc-checkout branch September 27, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant