Media/WebRTC/libwebrtc Update Process/automation plan: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(add link from plan to results)
(updated notes on mis-vendoring of sdk in 9314046d89eb)
Line 29: Line 29:
  build (with some changes during vendoring)
  build (with some changes during vendoring)
  third_party
  third_party
* Mozilla added
* Mozilla added
  README.mozilla - generated during vendoring process
  README.mozilla - generated during vendoring process
Line 34: Line 35:
  webrtc_gn - generated by [https://searchfox.org/mozilla-central/source/dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh generate-gn-build-files.sh]
  webrtc_gn - generated by [https://searchfox.org/mozilla-central/source/dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh generate-gn-build-files.sh]
  X11 - imported later by Byron in c91f12b557a1 [https://phabricator.services.mozilla.com/D113830 D113830]
  X11 - imported later by Byron in c91f12b557a1 [https://phabricator.services.mozilla.com/D113830 D113830]
tools/grit - imported later by Nico in 3cce5e6938f0 [https://phabricator.services.mozilla.com/D114027 D114027]
* Mozilla vendored after a93c2d1df066
:- Both of the following were inadvertently vendored from moz-libwebrtc commit bd4a718667.  The only real material difference in sdk/objc/helpers/RTCDispatcher.{h|m} but these files are not currently used.
  sdk/BUILD.gn - imported later by Byron in 9314046d89eb [https://phabricator.services.mozilla.com/D105015 D105015]
  sdk/BUILD.gn - imported later by Byron in 9314046d89eb [https://phabricator.services.mozilla.com/D105015 D105015]
    vendored from incorrect moz-libwebrtc commit (bd4a718667)
  sdk/objc - imported later by Byron in 9314046d89eb [https://phabricator.services.mozilla.com/D105015 D105015]
  sdk/objc - imported later by Byron in 9314046d89eb [https://phabricator.services.mozilla.com/D105015 D105015]
    vendored from incorrect moz-libwebrtc commit (bd4a718667)
:- We don't build the sdk directory (see [https://searchfox.org/mozilla-central/rev/9f61d854547cedbde0773b2893e4f925352be3b3/third_party/libwebrtc/BUILD.gn#471 here]).
tools/grit - imported later by Nico in 3cce5e6938f0 [https://phabricator.services.mozilla.com/D114027 D114027]
:- Only sdk:helpers_objc is used (see [https://searchfox.org/mozilla-central/rev/9f61d854547cedbde0773b2893e4f925352be3b3/third_party/libwebrtc/modules/desktop_capture/BUILD.gn#269 here])
   
:- From sdk/objc/helpers, only sdk/objc/helpers/scoped_cftyperef.h is used:
third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_iosurface.h
third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_provider.h
third_party/libwebrtc/modules/desktop_capture/mac/screen_capturer_mac.mm
  third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_cgimage.h
 
* Untouched from Bug 1665166 - Move media/webrtc/trunk/* to third-party/libwebrtc
* Untouched from Bug 1665166 - Move media/webrtc/trunk/* to third-party/libwebrtc
  README.md  (should have been vendored)
  README.md  (should have been vendored)

Revision as of 19:11, 10 February 2022

This describes the rough plan to document and automate the process to "fast-forward" through webrtc.org libwebrtc change-sets to bring Firefox's libwebrtc version as close as possible to Chrome. This page will be updated as new information is discovered.

Plan Overview

  • repo tasks
- update moz-libwebrtc fork to latest webrtc.org
- update elm to latest moz-central
- check moz-central a93c2d1df066 - Bug 1654112 - Vendor libwebrtc for rel86
- check moz-central d1df4970f4f0 - Bug 1654112 - Vendor libwebrtc/third_party for rel86
- check moz-central a93c2d1df066 - Bug 1654112 - Vendor libwebrtc/build for rel86
- move one changeset forward in webrtc.org history
- verify local build in moz-libwebrtc
- apply moz-libwebrtc-to-upstream patches, verify local build
- vendor moz-libwebrtc
- apply moz-central patches
- full try run
  • write automation scripts "Manually identify how to fast-forward one changeset"

Findings

current third_party/libwebrtc directories and status

  • Additional vendoring
build (with some changes during vendoring)
third_party
  • Mozilla added
README.mozilla - generated during vendoring process
moz.build - generated by generate-gn-build-files.sh
webrtc_gn - generated by generate-gn-build-files.sh
X11 - imported later by Byron in c91f12b557a1 D113830
tools/grit - imported later by Nico in 3cce5e6938f0 D114027
  • Mozilla vendored after a93c2d1df066
- Both of the following were inadvertently vendored from moz-libwebrtc commit bd4a718667. The only real material difference in sdk/objc/helpers/RTCDispatcher.{h|m} but these files are not currently used.
sdk/BUILD.gn - imported later by Byron in 9314046d89eb D105015
sdk/objc - imported later by Byron in 9314046d89eb D105015
- We don't build the sdk directory (see here).
- Only sdk:helpers_objc is used (see here)
- From sdk/objc/helpers, only sdk/objc/helpers/scoped_cftyperef.h is used:
third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_iosurface.h
third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_provider.h
third_party/libwebrtc/modules/desktop_capture/mac/screen_capturer_mac.mm
third_party/libwebrtc/modules/desktop_capture/mac/desktop_frame_cgimage.h
  • Untouched from Bug 1665166 - Move media/webrtc/trunk/* to third-party/libwebrtc
README.md   (should have been vendored)
DEPS        (should have been vendored)
google_apis (is this referenced/used by current code?)
tools/clang (is this referenced/used by current code?)            
chromium_deps                   
dummy_file.txt                  
net                             
Makefile.old                    
peerconnection_client.target.mk 
peerconnection.Makefile

verify generation/build with extra, unused directories

  • Add missing directories
cp -r ~/git-checkouts/moz-libwebrtc/test ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/pc ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/resources ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/docs ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/tools_webrtc ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/examples ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/p2p ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/rtc_tools ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/data ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/style-guide ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/stats ~/mozilla/moz-central/third_party/libwebrtc/
cp -r ~/git-checkouts/moz-libwebrtc/media/sctp ~/mozilla/moz-central/third_party/libwebrtc/media
  • local build file generation produces no build modified build files
  • Full build results here using ./mach try fuzzy -q 'build-'
  • Full linux test results here using ./mach try fuzzy -q 'linux-'

verify current vendoring scripts cmd-line params

  • Vendor libwebrtc (a93c2d1df066)
- The following commands produce a93c2d1df066 with some changes that were checked in on the same commit. We'll need to store a local patch to be applied.
cd dom/media/webrtc/third_party_build
python3 vendor-libwebrtc.py \
        --from-github https://github.com/mozilla/libwebrtc \
        --commit 149d693483e9055f574d9d65b01fe75a186b654b \
        libwebrtc
  • Vendor libwebrtc/third_party (d1df4970f4f0)
cd dom/media/webrtc/third_party_build
python3 vendor-libwebrtc.py \
        --from-googlesource \
        --commit 5dc5a4a45df9592baa8e8c5f896006d9193d8e45 \
        third_party
  • Vendor libwebrtc/build (587c40771588)
- The following commands produce 587c40771588 with some changes that were checked in on the same commit. We'll need to store a local patch to be applied.
cd dom/media/webrtc/third_party_build
python3 vendor-libwebrtc.py \
        --from-googlesource \
        --commit ac22062b465485d3e1196ae9c506b3617cc16fb5 \
        build

build instructions for moz-libwebrtc

  • verify build for webrtc.org
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export DEPOT_TOOLS=`pwd`/depot_tools
(cd depot_tools ; git checkout e7d1862b155ac3ccbef72c4d70629b5c88ffcb32 )
mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc # populates .gclient and .gclient_entries
(cd src ; git checkout edd7f9e94d)
export PATH=$DEPOT_TOOLS:$PATH ; \
  export DEPOT_TOOLS_UPDATE=0 ; \
  export DEPOT_TOOLS_WIN_TOOLCHAIN=0
gclient sync
cd src
gn gen out/Default
ninja -C out/Default
./out/Default/rtc_media_unittests # quick smoke test
  • verify build for moz-libwebrtc
- Use edd7f9e94d because some our patches stacked on top of this upstream revision are specific to building in the moz-central tree.
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export DEPOT_TOOLS=`pwd`/depot_tools
(cd depot_tools ; git checkout e7d1862b155ac3ccbef72c4d70629b5c88ffcb32 )
export PATH=$DEPOT_TOOLS:$PATH ; \
  export DEPOT_TOOLS_UPDATE=0 ; \
  export DEPOT_TOOLS_WIN_TOOLCHAIN=0
mkdir moz-libwebrtc-checkout
cd moz-libwebrtc-checkout
gclient config https://github.com/mozilla/libwebrtc --name src --unmanaged
gclient sync -D --force --reset --with_branch_heads # ~30 min
cd src
git checkout edd7f9e94d
gn gen out/Default
ninja -C out/Default
./out/Default/rtc_media_unittests # quick smoke test

remove dead/unused files

  • Successfully removed:
chromium_deps
dummy_file.txt
net
Makefile.old
peerconnection_client.target.mk
peerconnection.Makefile
- successful try builds
tools/clang
- successful try builds