Skip to content

Commit 9413ea5

Browse files
committed
fix e2e tests for linux.
1 parent bf52ad6 commit 9413ea5

6 files changed

Lines changed: 64 additions & 62 deletions

webrtc-sys/libwebrtc/build_linux.sh

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v
7777
git apply "$COMMAND_DIR/patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7878
git apply "$COMMAND_DIR/patches/fix_desktop_capture_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7979
git apply "$COMMAND_DIR/patches/external_audio_source.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
80-
git apply "$COMMAND_DIR/patches/fix_payload_type_picker_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
8180
git apply "$COMMAND_DIR/patches/fix_pipewire_utils_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
82-
git apply "$COMMAND_DIR/patches/fix_ssl_stream_adapter_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
83-
git apply "$COMMAND_DIR/patches/fix_copy_on_write_buffer_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
8481

8582
# Disable CREL (compact relocations). Chromium's build enables experimental
8683
# CREL via -Wa,--crel which causes segfaults on aarch64-linux (and is known
@@ -89,6 +86,15 @@ git apply "$COMMAND_DIR/patches/fix_copy_on_write_buffer_compile.patch" -v --ign
8986
# See: https://github.com/zed-industries/zed/pull/51433#discussion_r2944567608
9087
git -C build apply "$COMMAND_DIR/patches/disable_crel.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
9188

89+
# is_clang=false selects the //build/toolchain/linux GCC toolchains, which pass a bare
90+
# "ar" to be resolved from PATH. gcc_toolchain.gni rebases that against root_out_dir and
91+
# declares the result as an input, so ninja refuses to run any alink edge.
92+
git -C build apply "$COMMAND_DIR/patches/fix_gcc_toolchain_ar_input.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
93+
94+
# GCC reports -Wchanges-meaning as an error rather than a warning, so
95+
# treat_warnings_as_errors=false does not cover it and WebRTC does not build without this.
96+
git -C build apply "$COMMAND_DIR/patches/disable_gcc_changes_meaning.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
97+
9298
cd third_party
9399

94100
git apply "$COMMAND_DIR/patches/david_disable_gun_source_macro.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
@@ -111,6 +117,19 @@ fi
111117
# Note: use_clang_modules=false is required to avoid C++ module compilation issues.
112118
# Without this flag, the build may fail partway through, resulting in missing
113119
# or incomplete artifacts.
120+
#
121+
# The C++ standard library choice is an ABI contract with webrtc-sys, which is compiled
122+
# by the cc crate against whatever the host toolchain provides:
123+
#
124+
# use_custom_libcxx=false keeps every std type in libwebrtc.a mangled the way
125+
# libstdc++ mangles it, instead of Chromium's std::__Cr:: ABI namespace.
126+
# use_sysroot=false makes the build use the host's libstdc++ headers rather
127+
# than the bundled Debian Bullseye sysroot's libstdc++ 10. This matters beyond
128+
# mangling: libstdc++ reordered the members of std::span in GCC 15, so a libwebrtc
129+
# built against libstdc++ 10 headers and a webrtc-sys built against 15 agree on the
130+
# mangled name of CopyOnWriteBuffer::Set(std::span<const uint8_t>) while disagreeing
131+
# on which register holds the pointer and which holds the length.
132+
# is_clang=false builds with the host GCC, so the compiler matches too.
114133
args="is_debug=$debug \
115134
target_os=\"linux\" \
116135
target_cpu=\"$arch\" \
@@ -119,6 +138,8 @@ args="is_debug=$debug \
119138
use_llvm_libatomic=false \
120139
use_custom_libcxx=false \
121140
use_custom_libcxx_for_host=false \
141+
use_sysroot=false \
142+
is_clang=false \
122143
use_clang_modules=false \
123144
rtc_include_tests=false \
124145
rtc_build_tools=false \
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
2+
index e9668caab..87fe8c71b 100644
3+
--- a/config/compiler/BUILD.gn
4+
+++ b/config/compiler/BUILD.gn
5+
@@ -1857,6 +1849,12 @@ config("default_warnings") {
6+
# -Wno-class-memaccess warns about hash table and vector in blink.
7+
# But the violation is intentional.
8+
"-Wno-class-memaccess",
9+
+
10+
+ # WebRTC has several members that shadow a class of the same name, e.g.
11+
+ # PortInterface::Network() alongside class Network. GCC diagnoses that as
12+
+ # an error by default, not a warning, so treat_warnings_as_errors=false
13+
+ # does not help. webrtc-sys passes this same flag.
14+
+ "-Wno-changes-meaning",
15+
]
16+
17+
# -Wunused-local-typedefs is broken in gcc,

webrtc-sys/libwebrtc/patches/fix_copy_on_write_buffer_compile.patch

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni
2+
index a6b425828..f8bcd860d 100644
3+
--- a/toolchain/gcc_toolchain.gni
4+
+++ b/toolchain/gcc_toolchain.gni
5+
@@ -409,8 +409,16 @@ template("single_gcc_toolchain") {
6+
command = "cmd /s /c \"\"$python_path\" $tool_wrapper_path delete-file {{output}} && $command\""
7+
} else {
8+
command = "rm -f {{output}} && $command"
9+
- inputs =
10+
- [ get_path_info(rebase_path(ar, ".", root_out_dir), "abspath") ]
11+
+
12+
+ # Only declare the archiver as an input when it actually is a path. The
13+
+ # GCC toolchains in //build/toolchain/linux pass a bare command name
14+
+ # ("ar") to be resolved from PATH, and rebasing that against
15+
+ # root_out_dir names a file that does not exist, which makes ninja
16+
+ # refuse to run every alink edge.
17+
+ if (string_replace(ar, "/", "") != ar) {
18+
+ inputs =
19+
+ [ get_path_info(rebase_path(ar, ".", root_out_dir), "abspath") ]
20+
+ }
21+
}
22+
23+
# Almost all targets build with //build/config/compiler:thin_archive which

webrtc-sys/libwebrtc/patches/fix_payload_type_picker_compile.patch

Lines changed: 0 additions & 22 deletions
This file was deleted.

webrtc-sys/libwebrtc/patches/fix_ssl_stream_adapter_compile.patch

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)