build: sync the WebRTC checkout without git history - #298
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The WebRTC checkout was created with
fetch webrtc, which clonessrcand every git dependency with their full history before checking out the branch. This makes the first build download far more than it needs.Changes
.gclientitself, with the branch pinned in the solution URL (src.git@refs/branch-heads/7977), and runsgclient sync --no-history --shallow(hooks run afterwards throughgclient runhooks).webrtc.branchvalues map to refs:branch-heads/Nbecomesrefs/branch-heads/N, other names becomerefs/heads/<name>, andrefs/...is used as is.--depth 1.checkout_instrumented_librariesis set to False; those libraries only serve sanitizer builds on Linux.Size
Fresh Windows checkout of
branch-heads/7977, excluding build output:fetch webrtc(before)Almost all of the difference is git history (15.9 GB of
.gitdirectories before, 1.5 GB after).Looked at but kept:
catapult(//testing/BUILD.gnreferences it, sogn genfails without it),tfliteandperfetto(referenced unconditionally), andrust-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 verifyagainst a fresh shallow checkout: the WebRTC build, the JNI build, and all 175webrtctests 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; thecheckout_instrumented_librariessetting only takes effect on Linux, so CI is its first test there.