New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 805946 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug

Blocking:
issue 177475



Sign in to add a comment

webrtc_overrides makes changing chromium's base/ harder

Project Member Reported by thakis@chromium.org, Jan 25 2018

Issue description

I added an FALLTHROUGH macro to base/compiler_specific. The trybots came back red because apparently some files include webrtc's version and base's, due to webrtc_overrides:

https://ci.chromium.org/buildbot/tryserver.chromium.linux/cast_shell_linux/528094

FAILED: obj/third_party/webrtc/p2p/rtc_p2p/basicpacketsocketfactory.o 
/b/c/goma_client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/webrtc/p2p/rtc_p2p/basicpacketsocketfactory.o.d -DV8_DEPRECATION_WARNINGS -DDCHECK_ALWAYS_ON=1 -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCR_CLANG_REVISION=\"321529-2\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_RESTRICT_LOGGING -DHAVE_SCTP -DENABLE_EXTERNAL_AUTH -DHAVE_WEBRTC_VIDEO -DHAVE_WEBRTC_VOICE -DLOGGING_INSIDE_WEBRTC -DUSE_WEBRTC_DEV_BRANCH -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DFEATURE_ENABLE_VOICEMAIL -DGTEST_RELATIVE_PATH -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DFEATURE_ENABLE_VOICEMAIL -DNO_MAIN_THREAD_WRAPPING -I../.. -Igen -I../../third_party/webrtc_overrides -I../../third_party/webrtc -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -pthread -fcolor-diagnostics -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -fdebug-prefix-map=/b/c/b/cast_shell_linux/src/out/Release=. -no-canonical-prefixes -m64 -march=x86-64 -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-tautological-unsigned-zero-compare -Wno-null-pointer-arithmetic -Wno-tautological-constant-compare -Wtautological-constant-out-of-range-compare -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g1 -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -std=gnu++14 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_stretch_amd64-sysroot -fvisibility-inlines-hidden -c ../../third_party/webrtc/p2p/base/basicpacketsocketfactory.cc -o obj/third_party/webrtc/p2p/rtc_p2p/basicpacketsocketfactory.o
In file included from ../../third_party/webrtc/p2p/base/basicpacketsocketfactory.cc:21:
In file included from ../../third_party/webrtc/rtc_base/nethelpers.h:24:
In file included from ../../third_party/webrtc/rtc_base/signalthread.h:18:
In file included from ../../third_party/webrtc/rtc_base/nullsocketserver.h:14:
In file included from ../../third_party/webrtc_overrides/rtc_base/event.h:9:
In file included from ../../base/synchronization/waitable_event.h:30:
In file included from ../../base/memory/ref_counted.h:14:
../../base/compiler_specific.h:226:9: error: 'FALLTHROUGH' macro redefined [-Werror,-Wmacro-redefined]
#define FALLTHROUGH [[clang::fallthrough]]
        ^
../../third_party/webrtc/typedefs.h:98:9: note: previous definition is here
#define FALLTHROUGH() [[clang::fallthrough]]
        ^


In this concrete case it's not the end of the world (I can just add an #if !defined(FALLTHROUGH)) but abstractly this is pretty big problem and kind of violates the "things not in src.git shouldn't depend on base" maxim (since webrtc now indirectly, via webrtc_overrides, does depend on base.)

Maybe it's possible to implement webrtc_overrides so that no _header_ file includes stuff from base?
 

Comment 1 by tommi@chromium.org, Jan 25 2018

Owner: kwiberg@chromium.org
Karl - can you triage and/or find an owner?

What we've done in the past, is to add an RTC_ prefix to the equivalent macros in WebRTC.  E.g. RTC_DCHECK, RTC_LOG, RTC_DEPRECATED, RTC_UNUSED...
Looks like not all macros in typedefs.h have been updated, but I'd guess that would be the way forward (do you agree Karl?). 

Comment 2 by guidou@chromium.org, Jan 26 2018

Status: Assigned (was: Untriaged)

Comment 3 by thakis@chromium.org, Jan 31 2018

Note that prefixing the macro only works if the macro isn't defined in a public header, see the "it is important" paragraph in https://bugs.chromium.org/p/chromium/issues/detail?id=807632
But this one has to land first: https://chromium-review.googlesource.com/c/chromium/src/+/897495
Project Member

Comment 6 by bugdroid1@chromium.org, Feb 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/67c7f57d87619e98b1acf8f4e5f3367c2d567848

commit 67c7f57d87619e98b1acf8f4e5f3367c2d567848
Author: Karl Wiberg <kwiberg@chromium.org>
Date: Thu Feb 01 13:04:14 2018

Don't rely on WebRTC's FALLTHROUGH macro

It's going away.

Bug:  chromium:805946 
Change-Id: I6e766358970ba7cba39748f76b57fb9a80898fed
Reviewed-on: https://chromium-review.googlesource.com/897495
Commit-Queue: Tommi <tommi@chromium.org>
Reviewed-by: Tommi <tommi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533646}
[modify] https://crrev.com/67c7f57d87619e98b1acf8f4e5f3367c2d567848/third_party/libjingle_xmpp/xmpp/xmpplogintask_unittest.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Feb 5 2018

The following revision refers to this bug:
  https://webrtc.googlesource.com/src.git/+/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4

commit 80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4
Author: Karl Wiberg <kwiberg@webrtc.org>
Date: Mon Feb 05 11:24:59 2018

Move FALLTHROUGH macro to a separate header, and give it an RTC_ prefix

Bug:  chromium:805946 
Change-Id: Ibb5dce9af27d0e48c9aee6b0a860b6f62b3c76a0
Reviewed-on: https://webrtc-review.googlesource.com/46145
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21889}
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/audio_coding/BUILD.gn
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/audio_coding/neteq/neteq_impl.cc
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/audio_device/BUILD.gn
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/audio_device/ios/voice_processing_audio_unit.mm
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/remote_bitrate_estimator/BUILD.gn
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/remote_bitrate_estimator/test/bwe.cc
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/rtp_rtcp/BUILD.gn
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/rtp_rtcp/source/rtp_format_h264.cc
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/video_coding/BUILD.gn
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/video_coding/jitter_buffer.cc
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/modules/video_coding/rtp_frame_reference_finder.cc
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/rtc_base/BUILD.gn
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/rtc_base/httpbase.cc
[add] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/rtc_base/system/BUILD.gn
[add] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/rtc_base/system/fallthrough.h
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/typedefs.h
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/video/BUILD.gn
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/video/rtp_video_stream_receiver.cc
[modify] https://crrev.com/80ba333fc58e3c8ddb6c7eec1905e48b67ede4f4/video/video_stream_encoder.cc

Status: Fixed (was: Assigned)
As of the commit in comment 7, WebRTC's macro is now called RTC_FALLTHROUGH, and is defined in a much less public header than before.

Comment 9 by thakis@chromium.org, Feb 15 2018

Blocking: 177475
Project Member

Comment 10 by bugdroid1@chromium.org, Feb 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/feebe345bbc5612808b474dbd47e8d687ad18361

commit feebe345bbc5612808b474dbd47e8d687ad18361
Author: Nico Weber <thakis@chromium.org>
Date: Thu Feb 15 18:08:41 2018

Define FALLTHROUGH unconditionally now that that works.

Bug:  805946 
Change-Id: I5c47751c5803104124913b669d7bdee07d40bfa8
Reviewed-on: https://chromium-review.googlesource.com/922001
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537069}
[modify] https://crrev.com/feebe345bbc5612808b474dbd47e8d687ad18361/base/compiler_specific.h

Sign in to add a comment