Media/WebRTC/Legacy Updating Process

From MozillaWiki
< Media‎ | WebRTC
Jump to: navigation, search

Process: rough, can use fleshing out

Get a copy of a stable branch from the webrtc.org repository

  • Make a local clone of the webrtc.org repository:
     git clone https://chromium.googlesource.com/external/webrtc
  • Move into the new repository.
  • Edit the file .git/config. In the [remote "origin"] section, add the line:
     fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
  • Save the file
  • Run "git fetch". This will add references to the individual release branches.
  • Run "git branch -r" to list the available branch heads. (If new branches are later added to the origin repository you will not see them unless you run git fetch.)
  • Check out one of the branches. For example, for branch 49 you could run:
     git checkout -b rel49 branch-heads/49

(To pick up later updates to this branch, run git pull.)
Replace the old webrtc.org code with the new version

  • rm -rf media/webrtc/trunk/webrtc
  • cp -r somewhere/40/webrtc media/webrtc/trunk
  • copy over any files in somewhere/40 to media/webrtc/trunk that are needed (few if any - DEPS, OWNERS, etc)
  • rm -rf media/webrtc/trunk/webrtc/examples/ media/webrtc/trunk/webrtc/libjingle
  • hg addremove --similarity 70 --dry-run media/webrtc/trunk/webrtc 2>&1 >/tmp/addremove.out
  • look for any false positives on renames and fix them (perhaps by adding them to an --exclude list when doing the real addremove)
    • near-empty files often result in false renames
    • For 40, I had to use "--exclude media/webrtc/trunk/webrtc/modules/desktop_capture/mac/osx_version.h --exclude media/webrtc/trunk/webrtc/test/testsupport/android/root_path_android.cc --exclude media/webrtc/trunk/webrtc/voice_engine/output_mixer_unittest.cc"
  • look for any false negatives (typically fiddle the '70') or correct by hand after - less critical
  • hg revert files removed from media/webrtc/trunk/webrtc/modules/video_capture/windows/
    • do this before the real addremove! (can be undone later if needed)
  • hg addremove --exclude <whatever> --similarity 70 media/webrtc/trunk/webrtc 2>&1 >/tmp/addremove.out
    • or you can --exclude the directory if there are no renames, adds or removals there
    • These are files we added to avoid including/using DirectShow/etc files from Microsoft examples
  • hg qnew webrtc_revXXX -m "Bug xxxxxx: Webrtc updated to branch N.MM rev XXXX; pull made <date_from_/tmp/date>"
  • hg qref
    • If the patch file is very large, which it usually is in this case, hg will not actually create the new patch but show a warning that it is very large. You will need to do the qref in order to finalize that new patch file. If the file has been created, this last step is a no-op.
  • hg qpop
  • find the last update changeset - there will be two, one for landing the upstream code, one for the rollup of any changes
    • We'll call these revs "upstream_changeset" and "rollup_changeset"
  • hg diff -r upstream_changeset media/webrtc/trunk/webrtc >/tmp/rollup.patch
  • hg qpush
  • hg qimport /tmp/rollup.patch
  • hg qpush 2>&1 >/tmp/apply.out
  • Have much fun resolving conflicts!
    • Watch for renamed files, or removed files with the code merged into others
    • I use an Emacs keyboard macro to go to the next file in apply.out with an error and pull it and the .rej file into emacs: Media/WebRTC/Updating_Process/merge.macro
  • hg qnew rollup_fixes
    • don't merge them in yet to rollup, since likely you'll need to revise this for a while and it helps to see what your merge-resolution was
  • do builds, resolve any errors, hg qref
  • submit Try builds
  • Go back and fix any android/b2g-specific files where we didn't merge the diffs earlier
  • Test in person-to-person calls

Now groom for release when ready

  • hg qpop -a
  • record the current changeset from hg log ("old_head")
  • hg pull -u
  • hg diff -r old_head media/webrtc/trunk/webrtc >/tmp/updates
    • If empty, jump ahead to land (unlikely)
  • patch -p1 -R </tmp/updates
  • hg qnew undo_new_head_back_to_old_head.patch
    • new_head is the new hg tip changeset id, old_head is the old one
  • hg qref
    • Not sure why this is needed, but it is normally
  • hg qpush (hopefully shouldn't get conflicts -- should be webrtc_revXXXX)
  • hg qpop
  • hg qfold
  • hg qrename webrtc_revXXXXX
    • Now we should have one webrtc_revXXXX patch
  • hg qpush (should be rollup.patch)
  • hg qfold rollup_fixes (merges into rollup.patch)
  • hg qimport /tmp/updates
  • hg qpush
  • resolve any conflicts
  • build
  • test
  • hg qpop
  • hg qfold updates
  • Verify that there are no changes to media/webrtc/trunk/webrtc since the diff that generated /tmp/apply (hg qpop -a; hg log ("new_head"); hg pull -u; hg diff -r new_head -> should yield nothing)
  • land

(incomplete, WIP)