commit 2e1d3917340c980026c15ed9cf10e894ec665551 Author: David Fifield david@bamsoftware.com Date: Mon Dec 3 23:13:51 2018 +0000
Bug 28725: Upgrade go-webrtc to dcbfc825aa33471253a5da1834d499257e05d557.
This necessitates an upgrade to webrtc to branch-heads/64. Compare to: https://github.com/keroserene/go-webrtc/commit/1ca4087bc01b9a6726a68c72ac541...
-D_GLIBCXX_USE_CXX11_ABI=1 is no longer required, as the default has changed: https://github.com/keroserene/go-webrtc/commit/a3140c36f9933013ad2e66bc21358...
I needed to add libgtk-3-dev as a build dependency for webrtc. libgtk-3-dev appears in src/build/install-build-deps.sh.
I also had to upgrade depot_tools to 7d9d9233cb657e968831238346917b0b64abb4c1. I got the commit ID from src/DEPS in the webrtc source. Without upgrading depot_tools, I got this error from gclient: Error: 1> dependency url must be either a string, None, File() or From() instead of dict
I needed to add a command to delete src/testing/{gmock,gtest}; otherwise "gclient sync" complains about overwriting unversioned files. https://bugs.torproject.org/25483#comment:15 https://gitweb.torproject.org/user/boklm/tor-browser-build.git/commit/?h=bug... The error is src/testing (ERROR) ---------------------------------------- [0:00:00] Started. [0:00:01] From https://chromium.googlesource.com/chromium/src/testing [0:00:01] 7d7436a8..9805faa0 master -> origin/master ---------------------------------------- Error: Command 'git checkout --quiet 60c665fffe7dc505fdd5d30f9dbcbc50dde1e017' returned non-zero exit status 1 in /home/user/tor-browser-build/gclient/webrtc/src/testing error: The following untracked working tree files would be overwritten by checkout: gmock/include/gmock/gmock-actions.h gmock/include/gmock/gmock-generated-function-mockers.h gmock/include/gmock/gmock-matchers.h gmock/include/gmock/gmock.h gtest/include/gtest/gtest-death-test.h gtest/include/gtest/gtest-message.h gtest/include/gtest/gtest-param-test.h gtest/include/gtest/gtest-spi.h gtest/include/gtest/gtest.h gtest/include/gtest/gtest_prod.h Please move or remove them before you switch branches. Aborting --- projects/depot_tools/config | 2 +- projects/go-webrtc/config | 8 +- projects/webrtc/build | 6 +- projects/webrtc/config | 6 +- projects/webrtc/webrtc-linux.patch | 12 +-- projects/webrtc/webrtc-mac.patch | 204 +++++++++++++++---------------------- 6 files changed, 99 insertions(+), 139 deletions(-)
diff --git a/projects/depot_tools/config b/projects/depot_tools/config index 40a6d85..a1848dc 100644 --- a/projects/depot_tools/config +++ b/projects/depot_tools/config @@ -1,5 +1,5 @@ # vim: filetype=yaml sw=2 version: '[% c("abbrev") %]' -git_hash: 28216cd14b44716db5c83634afbdc6e90492652b +git_hash: 7d9d9233cb657e968831238346917b0b64abb4c1 git_url: https://chromium.googlesource.com/chromium/tools/depot_tools.git filename: '[% project %]-[% c("version") %].tar.gz' diff --git a/projects/go-webrtc/config b/projects/go-webrtc/config index 65be36f..8b171f9 100644 --- a/projects/go-webrtc/config +++ b/projects/go-webrtc/config @@ -1,7 +1,7 @@ # vim: filetype=yaml sw=2 version: '[% c("abbrev") %]' git_url: https://github.com/keroserene/go-webrtc.git -git_hash: 90ac15ae07cc6e820cd922a239dd892598986622 +git_hash: dcbfc825aa33471253a5da1834d499257e05d557 filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
build: '[% c("projects/go/var/build_go_lib") %]' @@ -21,12 +21,8 @@ var: rm -rf include/ lib/ cp -a /var/tmp/dist/webrtc/{include,lib} . [% IF c("var/linux") -%] - # The go-webrtc package sets _GLIBCXX_USE_CXX11_ABI=0 for compatibility with - # the prebuilt libwebrtc-magic.a libraries. Since we build our own - # libwebrtc-magic.a with the C++11 ABI, we have to undo that setting here, - # using CGO_CXXFLAGS. # __STDC_FORMAT_MACROS is needed for a definition of PRIxPTR from inttypes.h. - export CGO_CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=1 -D__STDC_FORMAT_MACROS=1" + export CGO_CXXFLAGS="-D__STDC_FORMAT_MACROS=1" export CGO_LDFLAGS=-latomic [% END -%] [% IF c("var/osx") -%] diff --git a/projects/webrtc/build b/projects/webrtc/build index a1abd92..ecbccb3 100644 --- a/projects/webrtc/build +++ b/projects/webrtc/build @@ -101,6 +101,8 @@ GN_ARGS+=" treat_warnings_as_errors=false" GN_ARGS+=" is_component_build=false" # Do not use bundled utilities. GN_ARGS+=" is_clang=false use_sysroot=false" +# Use libstdc++, not libc++. +GN_ARGS+=" use_custom_libcxx=false" [% IF c("var/linux") -%] GN_ARGS+=" target_os="linux" target_cpu="[% IF c("var/linux-i686") %]x86[% ELSE %]x64[% END %]"" GN_ARGS+=" gold_path="$INSTDIR/binutils/bin"" @@ -116,6 +118,8 @@ GN_ARGS+=" is_clang=false use_sysroot=false" GN_ARGS+=" target_os="mac" target_cpu="x64" mac_deployment_target="10.7"" GN_ARGS+=" clang_use_chrome_plugins=false" GN_ARGS+=" clang_base_path="$clangdir"" + # No lld in our toolchain currently. + GN_ARGS+=" use_lld=false" # Avoid some dependencies. GN_ARGS+=" rtc_include_opus=false rtc_include_ilbc=false rtc_include_internal_audio_device=false" # Tests are needed for field_trial, metrics_default, and pc_test_utils targets @@ -147,7 +151,7 @@ mkdir -p include lib cp -f $builddir/libwebrtc-magic.a [% c("var/webrtc/lib_path") %] INCLUDE_DIR="$PWD/include" cd $builddir -find webrtc/ -type f -name '*.h' -print0 | while IFS= read -r -d '' h; +find . -type f -name '*.h' -print0 | while IFS= read -r -d '' h; do mkdir -p "$INCLUDE_DIR/$(dirname "$h")" cp -f "$h" "$INCLUDE_DIR/$h" diff --git a/projects/webrtc/config b/projects/webrtc/config index da60d2d..2955095 100644 --- a/projects/webrtc/config +++ b/projects/webrtc/config @@ -5,7 +5,7 @@ filename: 'webrtc-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") var: container: use_container: 1 - webrtc_tag: c279861207c5b15fc51069e96595782350e0ac12 + webrtc_tag: 88f5d9180eae78a6162cccd78850ff416eb82483
input_files: - project: container-image @@ -33,6 +33,7 @@ targets: - libexpat1-dev - libglib2.0-dev - libgtk2.0-dev + - libgtk-3-dev - libudev-dev - libx11-dev - libxext-dev @@ -101,6 +102,9 @@ steps: git config diff.ignoreSubmodules all cd .. fi + # Delete the unversioned gmock and gtest directories, which cause "gclient sync" + # to fail when upgrading between webrtc branch-heads/58 and branch-heads/64. + rm -rf src/testing/gmock src/testing/gtest # "gclient" is part of depot_tools. This download takes a long time the first time. gclient sync --no-history --with_branch_heads -r [% c("var/webrtc_tag") %] cd .. diff --git a/projects/webrtc/webrtc-linux.patch b/projects/webrtc/webrtc-linux.patch index b1efb7a..efeebbb 100644 --- a/projects/webrtc/webrtc-linux.patch +++ b/projects/webrtc/webrtc-linux.patch @@ -1,6 +1,6 @@ -From ebc1773a92884bec7d93274b2d729ccf76050197 Mon Sep 17 00:00:00 2001 -From: David Fifield fifield@eecs.berkeley.edu -Date: Wed, 22 Mar 2017 09:53:07 -0400 +From 2d7897d479a13cbf68335140b61228cd5552dfd9 Mon Sep 17 00:00:00 2001 +From: David Fifield david@bamsoftware.com +Date: Mon, 3 Dec 2018 21:14:32 -0700 Subject: [PATCH] Disable some settings in build_overrides.
--- @@ -8,10 +8,10 @@ Subject: [PATCH] Disable some settings in build_overrides. 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build_overrides/build.gni b/build_overrides/build.gni -index af4924d4c..ffaafdebc 100644 +index 81cb3e73ae..5304a64ce8 100644 --- a/build_overrides/build.gni +++ b/build_overrides/build.gni -@@ -14,7 +14,7 @@ mac_sdk_min_build_override = "10.11" +@@ -10,7 +10,7 @@ enable_java_templates = true
# Some non-Chromium builds don't use Chromium's third_party/binutils. @@ -21,5 +21,5 @@ index af4924d4c..ffaafdebc 100644 # Variable that can be used to support multiple build scenarios, like having # Chromium specific targets in a client project's GN file etc. -- -2.12.1 +2.11.0
diff --git a/projects/webrtc/webrtc-mac.patch b/projects/webrtc/webrtc-mac.patch index 6b888bb..d1144af 100644 --- a/projects/webrtc/webrtc-mac.patch +++ b/projects/webrtc/webrtc-mac.patch @@ -1,7 +1,7 @@ -From bd27c327f72ea231353983aa35a0c3e6ae8055d5 Mon Sep 17 00:00:00 2001 +From df1a0923f1534a238e9773000dd03dd7b55e2c72 Mon Sep 17 00:00:00 2001 From: David Fifield david@bamsoftware.com -Date: Mon, 26 Jun 2017 11:26:55 -0700 -Subject: [PATCH 1/8] Disable assertions that prevent cross-compiling for mac. +Date: Mon, 3 Dec 2018 21:03:16 -0700 +Subject: [PATCH 1/6] Disable assertions that prevent cross-compiling for mac.
--- config/BUILDCONFIG.gn | 4 ++-- @@ -9,10 +9,10 @@ Subject: [PATCH 1/8] Disable assertions that prevent cross-compiling for mac. 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index d055e705..78a2023a 100644 +index 48ed140c7..15e06808c 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn -@@ -232,8 +232,8 @@ if (target_os == "android") { +@@ -238,8 +238,8 @@ if (target_os == "android") { } else if (target_os == "ios") { _default_toolchain = "//build/toolchain/mac:ios_clang_$target_cpu" } else if (target_os == "mac") { @@ -22,9 +22,9 @@ index d055e705..78a2023a 100644 + _default_toolchain = "//build/toolchain/mac:clang_$host_cpu" } else if (target_os == "win") { # On Windows we use the same toolchain for host and target by default. - assert(target_os == host_os, "Win cross-compiles only work on win hosts.") + # Beware, win cross builds mostly don't work yet, see docs/win_cross.md diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn -index b417e76a..5f48927d 100644 +index fc113d6a3..7a0171700 100644 --- a/build/toolchain/mac/BUILD.gn +++ b/build/toolchain/mac/BUILD.gn @@ -14,7 +14,7 @@ if (is_ios) { @@ -36,13 +36,13 @@ index b417e76a..5f48927d 100644
import("//build/toolchain/cc_wrapper.gni") import("//build/toolchain/clang_static_analyzer.gni") --- +-- 2.11.0
-From a58bb43ea406939fcc978aa808714d04802074ac Mon Sep 17 00:00:00 2001 +From c9cdc59ebb986392367115105ecbc1f5b511130d Mon Sep 17 00:00:00 2001 From: David Fifield david@bamsoftware.com -Date: Mon, 26 Jun 2017 11:29:14 -0700 -Subject: [PATCH 2/8] Hardcode cross-compiling flags in config/mac/BUILD.gn. +Date: Mon, 3 Dec 2018 21:04:26 -0700 +Subject: [PATCH 2/6] Hardcode cross-compiling flags in config/mac/BUILD.gn.
The build system doesn't provide a general way to set flags externally. "No way to provide extra CFLAGS/CXXFLAGS/LDFLAGS" @@ -52,12 +52,12 @@ https://bugs.chromium.org/p/chromium/issues/detail?id=595653 1 file changed, 5 insertions(+)
diff --git a/build/config/mac/BUILD.gn b/build/config/mac/BUILD.gn -index 84180e6a..2054b46f 100644 +index 4c681e88c..26fbcac2b 100644 --- a/build/config/mac/BUILD.gn +++ b/build/config/mac/BUILD.gn -@@ -83,6 +83,11 @@ config("runtime_library") { +@@ -57,6 +57,11 @@ config("runtime_library") { "-isysroot", - sysroot, + rebase_path(sysroot, root_build_dir), "-mmacosx-version-min=$mac_deployment_target", + "-target", + "x86_64-apple-darwin11", @@ -67,13 +67,47 @@ index 84180e6a..2054b46f 100644 ]
asmflags = common_flags --- +-- +2.11.0 + +From 86d0882084c8b0595d693cce43e96b01182814b7 Mon Sep 17 00:00:00 2001 +From: David Fifield david@bamsoftware.com +Date: Tue, 4 Dec 2018 07:37:42 +0000 +Subject: [PATCH 3/6] Remove -instcombine-lower-dbg-declare=0 from cflags. + +Not supported in our current version of llvm: +clang (LLVM option parsing): Unknown command line argument '-instcombine-lower-dbg-declare=0'. Try: 'clang (LLVM option parsing) -help' +clang (LLVM option parsing): Did you mean '-combiner-use-tbaa=0'? +--- + config/compiler/BUILD.gn | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn +index a6ba4ea6..e775f9f5 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -427,10 +427,10 @@ config("compiler") { + if (is_clang && !is_nacl && current_toolchain == host_toolchain && + target_os != "chromeos") { + cflags += [ +- "-Xclang", +- "-mllvm", +- "-Xclang", +- "-instcombine-lower-dbg-declare=0", ++ # "-Xclang", ++ # "-mllvm", ++ # "-Xclang", ++ # "-instcombine-lower-dbg-declare=0", + ] + } + +-- 2.11.0
-From 4c57d854280a0f0a4f55cba0457ae44f6369ca08 Mon Sep 17 00:00:00 2001 +From 96d243466006263e99b08ebf8b6085c60b736ccc Mon Sep 17 00:00:00 2001 From: David Fifield david@bamsoftware.com -Date: Mon, 26 Jun 2017 11:30:28 -0700 -Subject: [PATCH 3/8] Port build/config/mac/plist_util.py to biplist. +Date: Mon, 3 Dec 2018 21:06:06 -0700 +Subject: [PATCH 4/6] Port build/config/mac/plist_util.py to biplist.
So as not to require the plutil command. plutil was only being used to convert between XML and binary plist formats, because versions of the @@ -105,7 +139,7 @@ OSError: [Errno 2] No such file or directory 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/build/config/mac/plist_util.py b/build/config/mac/plist_util.py -index 0928fa13..898edc1a 100644 +index bba0208a5..019dcf918 100644 --- a/build/config/mac/plist_util.py +++ b/build/config/mac/plist_util.py @@ -3,7 +3,7 @@ @@ -117,7 +151,7 @@ index 0928fa13..898edc1a 100644 import os import re import subprocess -@@ -116,6 +116,7 @@ def Interpolate(plist, substitutions): +@@ -89,6 +89,7 @@ def Interpolate(value, substitutions):
def LoadPList(path): """Loads Plist at |path| and returns it as a dictionary.""" @@ -125,133 +159,55 @@ index 0928fa13..898edc1a 100644 fd, name = tempfile.mkstemp() try: subprocess.check_call(['plutil', '-convert', 'xml1', '-o', name, path]) -@@ -127,6 +128,7 @@ def LoadPList(path): +@@ -100,6 +101,7 @@ def LoadPList(path):
def SavePList(path, format, data): """Saves |data| as a Plist to |path| in the specified |format|.""" + return biplist.writePlist(data, path, {"xml1": False, "binary1": True}[format]) # doesn't handle "json" format fd, name = tempfile.mkstemp() try: - with os.fdopen(fd, 'w') as f: --- -2.11.0 - -From 62a6fa6376194ce673c220eef19fefeebe58fee1 Mon Sep 17 00:00:00 2001 -From: David Fifield david@bamsoftware.com -Date: Mon, 26 Jun 2017 11:41:16 -0700 -Subject: [PATCH 5/8] Include <sys/socket.h> in macifaddrs_converter.cc. - -Without this, when built against MacOSX10.7.sdk, there are errors: - -In file included from ../../webrtc/base/macifaddrs_converter.cc:13: -/home/debian/build/MacOSX10.7.sdk/usr/include/net/if.h:300:19: error: field has incomplete type 'struct sockaddr' - struct sockaddr ifru_addr; - -Related references: -https://trac.macports.org/ticket/49012 -https://trac.macports.org/browser/trunk/dports/gnome/gstreamer1/files/patch-... ---- - webrtc/base/macifaddrs_converter.cc | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/webrtc/base/macifaddrs_converter.cc b/webrtc/base/macifaddrs_converter.cc -index 2ad070e8e..1995f1940 100644 ---- a/webrtc/base/macifaddrs_converter.cc -+++ b/webrtc/base/macifaddrs_converter.cc -@@ -10,6 +10,7 @@ - - #include <memory> - -+#include <sys/socket.h> - #include <net/if.h> - #include <sys/ioctl.h> - #include <unistd.h> + # "plutil" does not replace the destination file but update it in place, -- 2.11.0
- -From e6a421534723408fb1292ce25051a1970f750a4a Mon Sep 17 00:00:00 2001 -From: David Fifield david@bamsoftware.com -Date: Mon, 26 Jun 2017 11:42:34 -0700 -Subject: [PATCH 6/8] Provide definitions of NS_ENUM and NS_OPTIONS. - ---- - webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h -index f9f15c37d..277676d85 100644 ---- a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h -+++ b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCMacros.h -@@ -25,4 +25,17 @@ - #define RTC_FWD_DECL_OBJC_CLASS(classname) typedef struct objc_object classname - #endif - -+// http://iamthewalr.us/blog/2012/11/ns_enum-and-ns_options/ -+#if (__cplusplus && __cplusplus >= 201103L && (__has_extension(cxx_strong_enums) || __has_feature(objc_fixed_enum))) || (!__cplusplus && __has_feature(objc_fixed_enum)) -+#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type -+#if (__cplusplus) -+#define NS_OPTIONS(_type, _name) _type _name; enum : _type -+#else -+#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type -+#endif -+#else -+#define NS_ENUM(_type, _name) _type _name; enum -+#define NS_OPTIONS(_type, _name) _type _name; enum -+#endif -+ - #endif // WEBRTC_BASE_OBJC_RTC_MACROS_H_ --- -2.11.0 - - -From baf5ddbd1e1281cd7c4cdda709e2ea7e07903727 Mon Sep 17 00:00:00 2001 +From eb3787dd670900cc2c3020c9323a9d95983c8887 Mon Sep 17 00:00:00 2001 From: David Fifield david@bamsoftware.com -Date: Mon, 26 Jun 2017 11:43:05 -0700 -Subject: [PATCH 7/8] Replace firstObject with objectAtIndex:0. - -firstObject doesn't exist in our version of the SDK. +Date: Tue, 4 Dec 2018 05:16:04 +0000 +Subject: [PATCH 5/6] Override use_system_xcode=true.
-The two method calls are not exactly the same; on an empty array, -firstObject returns nil while objectAtIndex:0 raises an exception. Let's -hope that doesn't matter. --- - webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm b/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm -index 182056228..93bea08f9 100644 ---- a/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm -+++ b/webrtc/modules/video_capture/objc/rtc_video_capture_objc.mm -@@ -176,7 +176,7 @@ using namespace webrtc::videocapturemodule; + build_overrides/build.gni | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/build_overrides/build.gni b/build_overrides/build.gni +index 81cb3e73ae..b683ea850c 100644 +--- a/build_overrides/build.gni ++++ b/build_overrides/build.gni +@@ -46,3 +46,5 @@ if (host_os == "mac") { + "hermetic toolchain if the minimum OS version is not met.") + use_system_xcode = _result == 0 } - - - (AVCaptureVideoDataOutput*)currentOutput { -- return [[_captureSession outputs] firstObject]; -+ return [[_captureSession outputs] objectAtIndex:0]; - } - - - (void)startCaptureInBackgroundWithOutput: ++ ++use_system_xcode = true -- 2.11.0
- -From 0b5f86af5bc4b7697ee60adf7e1e057a023438e0 Mon Sep 17 00:00:00 2001 +From 5df71ea8f31fd25a05c6b6b881c8126b25b5475c Mon Sep 17 00:00:00 2001 From: David Fifield david@bamsoftware.com -Date: Mon, 26 Jun 2017 11:43:51 -0700 -Subject: [PATCH 8/8] Disable the desktop_capture module. +Date: Mon, 3 Dec 2018 21:11:14 -0700 +Subject: [PATCH 6/6] Disable the desktop_capture module.
It's causing an error related to CoreGraphics.h and hopefully we don't need it. --- - webrtc/modules/BUILD.gn | 1 - + modules/BUILD.gn | 1 - 1 file changed, 1 deletion(-)
-diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn -index e750a8109..590f34275 100644 ---- a/webrtc/modules/BUILD.gn -+++ b/webrtc/modules/BUILD.gn -@@ -18,7 +18,6 @@ group("modules") { +diff --git a/modules/BUILD.gn b/modules/BUILD.gn +index 465f32d3c4..578cdbd57e 100644 +--- a/modules/BUILD.gn ++++ b/modules/BUILD.gn +@@ -17,7 +17,6 @@ group("modules") { "audio_processing", "bitrate_controller", "congestion_controller",