Need to link ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial from third_party/webrtc_overrides |
|||||
Issue description
To use Synthetic field trials inside webrtc they need a forwarding in third_party/webrtc_overrides (which is a part of chromium repository).
The problem is that it's inside monolithic build target //chrome/browser:browser.
If I try to add it to deps in third_party/webrtc_overrides I get the following error:
ERROR at //skia/BUILD.gn:674:5: Assertion failed.
assert(false, "Need to port cpu specific stuff from skia_library_opts.gyp")
^-----
Need to port cpu specific stuff from skia_library_opts.gyp
See //ppapi/BUILD.gn:383:5: which caused the file to be included.
"//skia",
^-------
ninja: error: rebuilding 'build.ninja': subcommand failed
Adding only "//chrome/browser/metrics/chrome_metrics_service_accessor.cc" to sources doesn't work either, as there are some weird include errors with protobuf:
In file included from ../../chrome/browser/metrics/chrome_metrics_service_accessor.cc:5:
In file included from ../../chrome/browser/metrics/chrome_metrics_service_accessor.h:14:
In file included from ../../chrome/browser/metrics/metrics_reporting_state.h:9:
In file included from ../../components/metrics/metrics_service_client.h:18:
gen/components/metrics/proto/system_profile.pb.h:9:10: fatal error: 'google/protobuf/stubs/common.h' file not found
Any ideas, how can it be done?
,
Jul 24 2017
,
Jul 24 2017
,
Jul 25 2017
I'm not really use how to use core browser stuff within third_party. alexei might know more than me on this.
,
Jul 25 2017
not really sure*
,
Jul 25 2017
Generally, these sorts of things are done by having WebRTC have a Delegate interface whose implementation lives in chrome/. Then, WebRTC uses the functionality through the Delegate and the concrete implementation of that delegate inside chrome/ routes to the stuff in chrome/.
,
Jul 25 2017
Re #4. I am trying to compile that delegate. It is, however located in third_party/webrtc_overrides (which is a part of the chromium repository). Do you think there will be no such problems if I create another layer of abstraction in chrome/? Turns out, this particular assert can be solved by providing target_cpu variable in "gn args". However, there are more asserts surfacing after that (like https://cs.chromium.org/chromium/src/v8/snapshot_toolchain.gni?q=v8/snapshot_toolchain.gni:97&sq=package:chromium&l=97 ) I am missing some kind of configuration in third_party/webrtc_overrides/BUILD.gn or in gn args.
,
Jul 26 2017
Re #6, Alexei, do you have any examples of such delegates? I tried to create a new target in chrome/BUILD.gn, but I really have troubles including only required things to the deps there. If I include browser as a dependency, everything brokes in the same way. It might work, If I had defined a global function in //chrome/browser/metrics/chrome_metrics_service_accessor.c what will call the static method in question. Then declaring it as extern in webrtc_overrides we might hope that linker will resolve while linking chrome. But it will be a terrible hack making a global function just to call a static method. Do you know of any way to make a forward declaration of a class with a static method?
,
Jul 26 2017
Also, RegisterSyntheticFieldTrial is private! Why? How am I even supposed to use it once I manage to resolve all crazy dependencies?
,
Jul 26 2017
Ok, I see the instruction to add a friend declaration in the class.
,
Jul 26 2017
Somehow, I've managed to make it all compile. I was missing third_party/protobuf:protobuf_light dependency. The CL is up.
,
Jul 26 2017
,
Jul 26 2017
For the record, can you link to the fixing changelist?
,
Jul 29 2017
The CL is here: https://chromium-review.googlesource.com/c/586588 |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by ilnik@chromium.org
, Jul 19 2017