[HighSierra] Build device/bluetooth with the 10.13 SDK |
|||||
Issue description
OS Version: OS X 10.13.0 (use XCode 9 Beta)
-c ../../device/bluetooth/bluetooth_adapter_mac.mm -o obj/device/bluetooth/bluetooth/bluetooth_adapter_mac.o
../../device/bluetooth/bluetooth_adapter_mac.mm:157:69: error: comparison of two values with different enumeration types ('CBManagerState' and 'CBCentralManagerState') [-Werror,-Wenum-compare]
is_present = is_present || ([low_energy_central_manager_ state] !=
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
../../device/bluetooth/bluetooth_adapter_mac.mm:166:69: error: comparison of two values with different enumeration types ('CBManagerState' and 'CBCentralManagerState') [-Werror,-Wenum-compare]
is_powered = is_powered || ([low_energy_central_manager_ state] ==
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
../../device/bluetooth/bluetooth_adapter_mac.mm:601:43: error: comparison of two values with different enumeration types ('CBManagerState' and 'CBCentralManagerState') [-Werror,-Wenum-compare]
if ([low_energy_central_manager_ state] < CBCentralManagerStatePoweredOn) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
-c ../../device/bluetooth/bluetooth_low_energy_device_mac.mm -o obj/device/bluetooth/bluetooth/bluetooth_low_energy_device_mac.o
../../device/bluetooth/bluetooth_low_energy_device_mac.mm:386:30: error: 'identifier' is only available on macOS 10_13 or newer [-Werror,-Wunguarded-availability]
NSUUID* uuid = [peripheral identifier];
^~~~~~~~~~~
../../../../../../../../Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBPeer.h:24:40: note: 'identifier' has been explicitly marked partial here
@property(readonly, nonatomic) NSUUID *identifier NS_AVAILABLE(10_13, 7_0);
^
../../device/bluetooth/bluetooth_low_energy_device_mac.mm:386:30: note: enclose 'identifier' in an @available check to silence this warning
NSUUID* uuid = [peripheral identifier];
^~~~~~~~~~~
1 error generated.
-c ../../device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm -o obj/device/bluetooth/bluetooth/bluetooth_low_energy_discovery_manager_mac.o
../../device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm:49:32: error: comparison of two values with different enumeration types ('CBManagerState' and 'CBCentralManagerState') [-Werror,-Wenum-compare]
if ([central_manager_ state] != CBCentralManagerStatePoweredOn) {
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
,
Jun 6 2017
It doesn't look like any logic needs to change. I've got a likely fix for this in https://codereview.chromium.org/2924753002
,
Jun 6 2017
Thanks. Could you run device_unittests locally? Our tests don't run on CQ :/
,
Jun 6 2017
The platforms SoTU yesterday (https://developer.apple.com/videos/play/wwdc2017/102/ @14:30) showed `if (@available…)` working. thakis@, does that mean it's available for us to use?
,
Jun 6 2017
I tried out if (@available(..)) -- well, actually if (__builtin_available(..)) which also works in .cc files -- in https://codereview.chromium.org/2924743002/ and hit a link error on __isOSVersionAtLeast(..). See also http://crbug.com/729896#c4 For the fixes needed for the bluetooth stuff, in https://codereview.chromium.org/2924753002, I don't think if(@available(..)) will work anyway though. The errors aren't partial availability warnings. for the 'identifier' error, the problem is actually that the property moved from a child class to a new parent class, and it is marked partially available on the parent. So, for the particular child class, it is always available at runtime.
,
Jun 8 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/724d9901b9f8f44e67a9b9d6da0722bb443e5d0c commit 724d9901b9f8f44e67a9b9d6da0722bb443e5d0c Author: tapted <tapted@chromium.org> Date: Thu Jun 08 03:00:44 2017 Allow device/bluetooth to build on the macOS 10.13 SDK Some CoreBluetooth declarations tweaked in ways that are not compatible. Also changes import/includes to match style guide: https://google.github.io/styleguide/objcguide.xml?showone=_import_and__include#_import_and__include BUG= 729906 Review-Url: https://codereview.chromium.org/2924753002 Cr-Commit-Position: refs/heads/master@{#477867} [modify] https://crrev.com/724d9901b9f8f44e67a9b9d6da0722bb443e5d0c/device/bluetooth/bluetooth_adapter_mac.h [modify] https://crrev.com/724d9901b9f8f44e67a9b9d6da0722bb443e5d0c/device/bluetooth/bluetooth_adapter_mac.mm [modify] https://crrev.com/724d9901b9f8f44e67a9b9d6da0722bb443e5d0c/device/bluetooth/bluetooth_adapter_mac_unittest.mm [modify] https://crrev.com/724d9901b9f8f44e67a9b9d6da0722bb443e5d0c/device/bluetooth/bluetooth_low_energy_device_mac.mm [modify] https://crrev.com/724d9901b9f8f44e67a9b9d6da0722bb443e5d0c/device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm [modify] https://crrev.com/724d9901b9f8f44e67a9b9d6da0722bb443e5d0c/device/bluetooth/test/bluetooth_test_mac.mm [modify] https://crrev.com/724d9901b9f8f44e67a9b9d6da0722bb443e5d0c/device/bluetooth/test/mock_bluetooth_central_manager_mac.h
,
Jun 8 2017
,
Jul 19 2017
,
Jul 19 2017
-Wunguarded-availability-new rendered the checked-in solution broken with the 10.13 SDK. See bug 746559 . |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by ortuno@chromium.org
, Jun 6 2017Cc: jlebel@chromium.org
Components: -OS>Systems>Bluetooth IO>Bluetooth
Status: Available (was: Untriaged)