New issue
Advanced search Search tips

Issue 817302 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

macviews trybot compile error blocking CQ jobs: undefined symbol WebContentsModalDialogManager::IsCocoaBrowser()

Project Member Reported by tapted@chromium.org, Feb 28 2018

Issue description

There's currently a compile failure on the macviews trybot, which is blocking jobs.

It's not happening on go/macviewsbuilder - might be an is_component_build thing.

The same compile error is in runs from multiple CLs so I don't think any of those are at fault. Examples:

https://ci.chromium.org/buildbot/tryserver.chromium.mac/mac_chromium_10.10_macviews/269
https://ci.chromium.org/buildbot/tryserver.chromium.mac/mac_chromium_10.10_macviews/266
https://ci.chromium.org/buildbot/tryserver.chromium.mac/mac_chromium_10.10_macviews/262
https://ci.chromium.org/buildbot/tryserver.chromium.mac/mac_chromium_10.10_macviews/256

The error is

Undefined symbols for architecture x86_64:
  "web_modal::WebContentsModalDialogManager::IsCocoaBrowser()", referenced from:
      constrained_window::ShowModalDialog(NSWindow*, content::WebContents*) in libconstrained_window.a(show_modal_dialog_views.o)
  "web_modal::WebContentsModalDialogManager::CreateNativeWebModalManager(NSWindow*, web_modal::SingleWebContentsDialogManagerDelegate*)", referenced from:
      constrained_window::ShowModalDialogCocoa(NSWindow*, content::WebContents*) in libconstrained_window.a(show_modal_dialog_cocoa.o)
ld: symbol(s) not found for architecture x86_64


it might be from the following commit, but it was a really long time ago -- I'm not sure what's changed

commit 1a37b1651971b41c71ba51040bee38a51584697c
Author: Leonard Grey <lgrey@chromium.org>
Date:   Fri Feb 23 18:32:04 2018 +0000

    [MacViews] Shim |ShowModalDialog| for Polychrome



Should we make this bot FYI until it's in the waterfall? Sheriffs have no visibility on it, so it shouldn't block jobs IMO.  (We also need more bots in the pool - it seems to time out frequently for me).

(sorry - I don't have time to investigate further - it's late!)
 
Cc: lgrey@chromium.org
Owner: blundell@chromium.org
Status: Started (was: Assigned)
That commit is the issue. Defining a static function in //components and implementing it in //chrome is an anti-pattern; if there's a need for dependency injection, it should be done explicitly (e.g. by taking in a callback from the embedder or something). In this case components_unittests is failing to compile because there's no definition for the static function in that target. The reason that only some builds are failing with this error is that analyze.py skips building components_unittests for CLs that don't affect it.

I'm going to try reverting the CL as the approach here needs to be rethought.
Cc: -lgrey@chromium.org blundell@chromium.org
Labels: -Pri-0 -Sheriff-Chromium Pri-3
Owner: lgrey@chromium.org
Status: Assigned (was: Started)
The revert landed, so the compile issue should be fixed. Leaving the bug open as it has useful info for what will be needed to reland this functionality.
It looks like we missed adding this kind of stub: <https://cs.chromium.org/chromium/src/components/constrained_window/test_create_native_web_modal_manager_cocoa.cc?type=cs&q=CreateNativeWebModalManager&l=10>

blundell@: I agree that it's an anti-pattern, but it's already done here: <https://cs.chromium.org/chromium/src/components/web_modal/web_contents_modal_dialog_manager.h?type=cs&q=CreateNativeWebModalManager&l=36>. Perhaps we can do something with WebContentsModalDialogManagerDelegate instead (?).
ellyjones@: That one should also be fixed :). Apart from any issue about these kinds of compile failures, having static functions that are implemented in the embedder is a requirement on the embedder that would be invisible to new embedders looking to use the component. There should be some way to hook in either via a delegate or just by passing state into //components-level functions/objects from //chrome explicitly.
Project Member

Comment 6 by bugdroid1@chromium.org, Mar 6 2018

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

commit f9f3bc00ce408ccf0e08aed82d68fb6a77c016a8
Author: Leonard Grey <lgrey@chromium.org>
Date: Tue Mar 06 16:50:53 2018

[Mac] Move Polychrome feature to ui/base

This is needed because ShowModal needs to know if a Polychrome browser
is in Views or Cocoa, and it live in components/, which can't depend on
chrome/

This leaves the views_mode_controller version of |IsViewsBrowserCocoa|
in place to avoid changing all its callers.

Bug:  817302 
Change-Id: Ia8e06927410fb9aad3fe696a2446418b4d115a7c
Reviewed-on: https://chromium-review.googlesource.com/949362
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541125}
[modify] https://crrev.com/f9f3bc00ce408ccf0e08aed82d68fb6a77c016a8/chrome/browser/ui/views_mode_controller.cc
[modify] https://crrev.com/f9f3bc00ce408ccf0e08aed82d68fb6a77c016a8/chrome/common/chrome_features.cc
[modify] https://crrev.com/f9f3bc00ce408ccf0e08aed82d68fb6a77c016a8/chrome/common/chrome_features.h
[modify] https://crrev.com/f9f3bc00ce408ccf0e08aed82d68fb6a77c016a8/ui/base/ui_base_features.cc
[modify] https://crrev.com/f9f3bc00ce408ccf0e08aed82d68fb6a77c016a8/ui/base/ui_base_features.h

ooh neat - that will help fix  Issue 798944  as well

Comment 8 by lgrey@chromium.org, Mar 8 2018

Status: Fixed (was: Assigned)

Sign in to add a comment