New issue
Advanced search Search tips

Issue 709850 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 0
Type: Bug



Sign in to add a comment

Mac developer builds spew BidiResolver.h:534:64: error: reference to 'kRightToLeft' is ambiguous after Blink rename

Project Member Reported by tapted@chromium.org, Apr 10 2017

Issue description

Chrome Version       : ToT
OS Version: OS X 10.12.3

$ cat args.gn
is_component_build = true
is_debug = true

In file included from ../../third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp:49:
In file included from ../../third_party/WebKit/Source/core/layout/line/InlineIterator.h:27:
In file included from ../../third_party/WebKit/Source/core/layout/BidiRun.h:28:
../../third_party/WebKit/Source/platform/text/BidiResolver.h:460:32: error: reference to 'kLeftToRight' is ambiguous
        status_.last_strong == kLeftToRight ? kLeftToRight : kRightToLeft;
                               ^
/Volumes/bdd/tapted/git/2chromium/src/build/mac_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h:74:3: note:
      candidate found by name lookup is 'kLeftToRight'
  kLeftToRight                  = 0,
  ^
/Users/tapted/bdd/git/2chromium/src/out/gn_Debug/../../third_party/WebKit/Source/platform/wtf/text/icu/UnicodeIcu.h:34:3: note: candidate found by name lookup is 'WTF::Unicode::CharDirection::kLeftToRight'
  kLeftToRight = U_LEFT_TO_RIGHT,
  ^

$ git show 1c4d759e4425 -- third_party/WebKit/Source/platform/wtf/text/icu/UnicodeIcu.h

:
commit 1c4d759e44259650dfb2c426a7f997d2d0bc73dc
Author: Blink Reformat <blink-reformat@chromium.org>
Date:   Sun Apr 9 09:34:54 2017 -0700

    The Blink Rename

 enum CharDirection {
-  LeftToRight = U_LEFT_TO_RIGHT,
-  RightToLeft = U_RIGHT_TO_LEFT,
/* snip */
+  kLeftToRight = U_LEFT_TO_RIGHT,
+  kRightToLeft = U_RIGHT_TO_LEFT,

AVLTree.h is compiled as part of third_party/WebKit/Source/core/layout/layout/Precompile-core.h-cc.gch - I don't think there's an easy fix by hiding that header.

BidiResolver.h has a ton of `using namespace WTF::Unicode;`

I think the fix is going to be just to remove those using directives.
 

Comment 1 by tapted@chromium.org, Apr 10 2017

Components: Blink

Comment 2 by tapted@chromium.org, Apr 10 2017

The include path is

In file included from ../../third_party/WebKit/Source/core/Precompile-core.h:13:
In file included from ../../third_party/WebKit/Source/build/mac/Prefix.h:51:
In file included from /Volumes/bdd/tapted/git/2chromium/src/build/mac_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:
In file included from /Volumes/bdd/tapted/git/2chromium/src/build/mac_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20:
In file included from /Volumes/bdd/tapted/git/2chromium/src/build/mac_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:200:
/Volumes/bdd/tapted/git/2chromium/src/build/mac_files/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h

Removing the CoreServices.h include moves it to

Cocoa.h -> Foundation.h -> NSURLError.h -> CoreServices.h

That makes it only included for .mm files. This might prevent AVLTree.h polluting the global namespace with `kRightToLeft` in places where we care about it.

(why is this not breaking on the bots? I have no idea..)

Comment 4 by tapted@chromium.org, Apr 10 2017

Ohhh using goma disables precompiled headers, which is why this isn't affecting the bots.

Comment 5 by tapted@chromium.org, Apr 10 2017

Status: Started (was: Unconfirmed)
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 10 2017

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

commit 25921a3c76075db1aefb91ebceb216c0dd2556db
Author: tapted <tapted@chromium.org>
Date: Mon Apr 10 05:33:04 2017

Remove CoreServices.h from Blink's precompiled headers on Mac

Its presence is causing compile failures in non-goma builds since the
Blink identifier renames in r463139. (goma builds disable precompiled
headers, so this problem isn't appearing on the bots).

Blink Mac code doesn't seem to use anything from it. The framework
includes deprecated Carbon framework headers such as AVLTree.h which
pollute the global namespace with `kLeftToRight` which is causing
ambiguity with WTF::Unicode::kLeftToRight when it is used in
WebKit/Source/platform/text/BidiResolver.h

Note that Objective C code in blink (there is not much of it) will still
see symbols from CoreServices.h when it's included via Cocoa.h.

BUG= 709850 
TBR=thakis@chromium.org

Review-Url: https://codereview.chromium.org/2800343002
Cr-Commit-Position: refs/heads/master@{#463173}

[modify] https://crrev.com/25921a3c76075db1aefb91ebceb216c0dd2556db/third_party/WebKit/Source/build/mac/Prefix.h

Components: -Blink Blink>Internals
Owner: tapted@chromium.org

Comment 8 by tapted@chromium.org, Apr 10 2017

Status: Fixed (was: Started)

Sign in to add a comment