-Wunguarded-availability-new error: 'authorizationStatusForMediaType:' is only available on macOS 10.14 or newer
Categories
(Core :: Widget: Cocoa, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox64 | --- | affected |
People
(Reporter: cpeterson, Assigned: haik)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review |
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 3•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
Reporter | ||
Comment 5•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 6•6 years ago
|
||
I ran into this today on my new laptop. Thanks for the patch! It'd bitrotted, so here's a rebased version. Any news on landing it?
I probably won't follow up, since it looks like
ac_add_options --enable-warnings-as-errors
is a lost cause. It compiles futher, but I hit more error-warnings:
2:13.41 /Users/Jan/moz/mozilla-central/toolkit/xre/MacApplicationDelegate.mm:335:47: error: conflicting parameter types in implementation of 'application:continueUserActivity:restorationHandler:': 'void (^ _Nonnull)(NSArray<id<NSUserActivityRestoring>> * _Nonnull)' vs 'void (^ _Nonnull)(NSArray *)' [-Werror,-Wmismatched-parameter-types]
2:13.41 restorationHandler:(void (^)(NSArray *))restorationHandler {
Comment 7•6 years ago
|
||
Haik, could we get this reviewed? Is it ready for that?
Assignee | ||
Comment 8•6 years ago
|
||
(In reply to Mark Banner (:standard8) from comment #7)
Haik, could we get this reviewed? Is it ready for that?
I didn't originally attempt to land the fix because there was no way to validate the fix on 10.14 due to bug 1494022. That's still true, but I don't think we need to be so cautious. This is low risk and our official builds don't use the 10.14 SDK so not testing with it isn't an issue right now. And I hate to block the use of ac_add_options --enable-warnings-as-errors
. I will make sure jib's rebase is still clean and then post this for review.
Note: I assume that anyone hitting this bug is building on 10.14 using the 10.14 SDK (which is the default.) Our official shipping builds are built with the 10.11 SDK. I recommend using the 10.11 SDK so that the build you test with locally will be representative of what our users will use. You can build with the earlier SDK on newer OS versions.
You can get the 10.11 SDK from Xcode 7.3.1 from support.apple.com.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 9•6 years ago
|
||
(In reply to Jan-Ivar Bruaroey [:jib] (needinfo? me) from comment #6)
@jib, could you post your mozconfig? I can't seem to reproduce the build failure with ac_add_options --enable-warnings-as-errors
Comment 10•6 years ago
|
||
So I too realized after posting this patch that I wasn't going to get anywhere with the 10.14 SDK—some other problem popped up—and I've since added --with-macos-sdk
to use 10.13 SDK, and I don't have the problem anymore. Except for that, my mozconfig should be unchanged:
. $topsrcdir/browser/config/mozconfig
ac_add_options --disable-debug
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-x86_64-apple-darwin12.2.1-opt
mk_add_options AUTOCONF=~/bin/autoconf
mk_add_options MOZ_MAKE_FLAGS="-s -j10"
mk_add_options AUTOCLOBBER=1
ac_add_options --with-ccache=/usr/local/bin/ccache
ac_add_options --enable-warnings-as-errors
ac_add_options --with-macos-sdk=/Users/Jan/moz/git/MacOSX-SDKs/MacOSX10.13.sdk
export MOZ_WEBRTC_TESTS=1
export MOZ_WEBRTC_MEDIACONDUIT_TESTS=1
export CCACHE_SLOPPINESS=time_macros,file_macro
export DYLD_LIBRARY_PATH=/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-opt/dist/Nightly.app/Contents/MacOS
Comment 11•5 years ago
|
||
Something changed that means I can now no longer build central (on 09d43bf72fa6 ). I'm on 10.13, my mozconfig looks like this:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../builds/opt
ac_add_options --enable-warnings-as-errors
Errors:
6:36.06 In file included from path/to/opt/widget/cocoa/Unified_mm_widget_cocoa0.mm:137:
6:36.06 mozilla-unified/widget/cocoa/nsCocoaUtils.mm:1114:24: error: 'authorizationStatusForMediaType:' is only available on macOS 10.14 or newer [-Werror,-Wunguarded-availability-new]
6:36.06 [AVCaptureDevice authorizationStatusForMediaType:aMediaType]);
6:36.06 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6:36.06 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:1479:1: note: 'authorizationStatusForMediaType:' has been marked as being introduced in macOS 10.14 here, but the deployment target is macOS 10.9.0
6:36.07 + (AVAuthorizationStatus)authorizationStatusForMediaType:(AVMediaType)mediaType API_AVAILABLE(macos(10.14), ios(7.0));
6:36.07 ^
6:36.07 mozilla-unified/widget/cocoa/nsCocoaUtils.mm:1114:24: note: enclose 'authorizationStatusForMediaType:' in an @available check to silence this warning
6:36.07 [AVCaptureDevice authorizationStatusForMediaType:aMediaType]);
6:36.07 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6:36.11 mozilla-unified/widget/cocoa/nsCocoaUtils.mm:1209:20: error: 'requestAccessForMediaType:completionHandler:' is only available on macOS 10.14 or newer [-Werror,-Wunguarded-availability-new]
6:36.11 [AVCaptureDevice requestAccessForMediaType:aType completionHandler:aHandler];
6:36.11 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6:36.11 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:1502:1: note: 'requestAccessForMediaType:completionHandler:' has been marked as being introduced in macOS 10.14 here, but the deployment target is macOS 10.9.0
6:36.11 + (void)requestAccessForMediaType:(AVMediaType)mediaType completionHandler:(void (^)(BOOL granted))handler API_AVAILABLE(macos(10.14), ios(7.0));
6:36.11 ^
6:36.11 mozilla-unified/widget/cocoa/nsCocoaUtils.mm:1209:20: note: enclose 'requestAccessForMediaType:completionHandler:' in an @available check to silence this warning
6:36.12 [AVCaptureDevice requestAccessForMediaType:aType completionHandler:aHandler];
6:36.12 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6:37.66 2 warnings and 2 errors generated.
Things were fine last week.
Assignee | ||
Comment 12•5 years ago
|
||
(In reply to :Gijs (he/him) from comment #11)
Something changed that means I can now no longer build central (on 09d43bf72fa6 ). I'm on 10.13, my mozconfig looks like this:
I'm not aware of anything that could have changed recently to cause this if you were always building with --enable-warnings-as-errors
.
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../builds/opt ac_add_options --enable-warnings-as-errors
Errors:
All the errors appear to be issues resolved by the posted patch that :jib rebased on Comment 6. We should just get this landed.
@:Gijs I'll check the patch hasn't bitrotted further and then would you be willing to test the patch on 10.13?
Comment 13•5 years ago
|
||
(In reply to Haik Aftandilian [:haik] from comment #12)
@:Gijs I'll check the patch hasn't bitrotted further and then would you be willing to test the patch on 10.13?
Sure. Looks like the very first hunk has already been applied (formatting change) but otherwise the patch at least applies sanely. It'll take me an hour or so to verify that this fixes the errors.
Comment 14•5 years ago
|
||
The patch fixes this particular error but builds still fail, now with:
toolkit/xre/MacApplicationDelegate.mm:348:46: error: conflicting parameter types in implementation of 'application:continueUserActivity:restorationHandler:': 'void (^ _Nonnull)(NSArray<id<NSUserActivityRestoring>> * _Nonnull)' vs 'void (^ _Nonnull)(NSArray *)' [-Werror,-Wmismatched-parameter-types]
4:52.52 restorationHandler:(void (^)(NSArray*))restorationHandler {
4:52.53 ~~~~~~~~~~~~~~~~~~ ^
4:52.55 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:405:187: note: previous definition is here
4:52.55 - (BOOL)application:(NSApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray<id<NSUserActivityRestoring>> *restorableObjects))restorationHandler NS_AVAILABLE_MAC(10_10);
which looks like it's the same as comment 6.
Comment 16•5 years ago
|
||
(In reply to :Gijs (he/him) from comment #11)
Things were fine last week.
Yeah, I had the same thing happen, where it just suddenly stopped working in the last week.
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 17•5 years ago
|
||
This was addressed in bug 1564216.
Description
•