New issue
Advanced search Search tips

Issue 811254 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug
Proj-XR



Sign in to add a comment

chrome/browser/vr compiles non-reachable code when enabled_gvr_services=false

Project Member Reported by brat...@opera.com, Feb 12 2018

Issue description

When experimenting with a jumbo build for chrome/browser/vr I realized that something is wrong with the code as it is structured now.

vr/ui_scene_creator.cc uses GltfController from elements/gltf_controller.cc, and elements/gltf_controller.cc uses ControllerMesh from controller_mesh.cc, but controller_mesh.cc is not included in the build (enable_gvr_services=false).

Since it compiles without jumbo I suspect it compiles by some lucky coincidence. I've seen similar problems at other places when some file should not have been included in the build. In this case it's not that easy.

It seems that these need to be removed when enabled_gvr_services=false:

UiElementRenderer::DrawGltfController in ui_element_renderer.cc and ui_element_renderer.h
CreateGltfControllerModel() in ui_scene_creator.cc
Reference to CreateGltfControllerModel() in UiSceneCreator::CreateController() in ui_scene_creator.cc.

There is, as far as I can see, not currently any define for this or the code could just be wrapped in some suitable #ifdefs.



 

Comment 1 by brat...@opera.com, Feb 12 2018

And, which I forgot to include, the whole of gltf_controller.cc and gltf_controller.h should probably also be excluded.

(I don't know this code, this is mostly based on what code calls which other code)

Comment 2 by brat...@opera.com, Feb 12 2018

Seems the reason it normally works is that the root of all references are the ui_* files, ui.cc, ui_element_renderer.cc, ui_input_manager.cc, ui_renderer.cc and ui_scene_creator.cc and they are all unused. Since they are unused, the generated object files will be ignored by the linker and everything they depend on will be ignored so it doesn't matter that they contain dangling references.

So the ui_*.cc files should be moved from "vr_common", but I'm not sure where. To test_support and testapp/BUILD.gn? Or should there be a new mini sourceset with just those?

This doesn't mean that the the code setup in the rest of the code is correct but it explains why it compiles in normal builds.

Comment 3 by tiborg@chromium.org, Feb 12 2018

What are your gn.args, your platform and your build target?

Comment 4 by brat...@opera.com, Feb 12 2018

This was on Linux and I built chrome and vr_common_unittests.

I'm making a stab at moving the ui files to another target in https://chromium-review.googlesource.com/c/chromium/src/+/913611 but my first attempt (moving to test_support) failed because then the android vr_shell didn't get them.


Comment 5 by brat...@opera.com, Feb 12 2018

Oh, and it was a release component build, but you won't get the linker errors that made me notice this with anything checked in so it really doesn't matter.

Comment 6 by tiborg@chromium.org, Feb 12 2018

The UI files need to be in Chrome since they draw the VR UI. I'm unsure, which build failed for you. Can you give me the exact gn.args for that?

Comment 7 by brat...@opera.com, Feb 12 2018

Summary: chrome/browser/vr compiles non-reachable code when enabled_gvr_services=false (was: chrome/browser/vr compiles non-reachable code)
Could it be a difference between Chromium and Chrome?

https://chromium-review.googlesource.com/c/chromium/src/+/913611 compiles fine without those files so they don't seem to be needed in Chromium.

It's a bit complicated to explain how to reproduce the symptoms locally so I made a CL that will fail to compile in some builders https://chromium-review.googlesource.com/c/chromium/src/+/913952 .

So far it has compiled successfully in Android and Mac but failed in liux_chromium_compile_dbg_ng (see https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_compile_dbg_ng/11374 )

For platforms where enabled_gvr_services is true, it should be fine but I don't know which platforms that is (nor what gvr is. :) ).


Comment 8 by tiborg@chromium.org, Feb 12 2018

Thanks for the info. Can I ask what you are trying to do? Splitting the UI from the rest may not be the best solution.

I don't think there is a Chromium vs Chrome problem. I only build with Chromium, too. GVR is Google's VR rendering library and only available on Android ARM in Chrome.

Comment 9 by brat...@opera.com, Feb 12 2018

I tried to jumbo compile chrome/browser/vr ( see https://chromium.googlesource.com/chromium/src/+/master/docs/jumbo.md ) and got some really strange compilation errors. Those made me realize that some code was compiled and then discarded and that the build system even depended on the linker discarding that code (which it stopped doing in a jumbo build).

I am absolutely not familiar with this code so we can discuss (i.e. you can tell me :-) ) what the proper solution would be in the code review.
Components: Internals>VR
Labels: Proj-VR OS-Android
We do want to compile code on platforms where it is not necessarily in the final product. For example, we do this on Linux to enable testing. (This should only occur when those tests are being built.) However, we should avoid linking it into the final product.
Status: Assigned (was: Untriaged)
Status: WontFix (was: Assigned)
GLTF controller and parser has been removed.
Components: Internals>XR

Sign in to add a comment