From 31144f3917092f8574e4523da636f497077fa1aa Mon Sep 17 00:00:00 2001 From: Nick Dowell Date: Tue, 9 Mar 2021 15:01:59 +0000 Subject: [PATCH 1/2] Enable Mac Catalyst for examples/objective-c-ios --- .../Bugsnag Test App.xcodeproj/project.pbxproj | 6 ++++++ .../Bugsnag Test App/Bugsnag Test App.entitlements | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 examples/objective-c-ios/Bugsnag Test App/Bugsnag Test App.entitlements diff --git a/examples/objective-c-ios/Bugsnag Test App.xcodeproj/project.pbxproj b/examples/objective-c-ios/Bugsnag Test App.xcodeproj/project.pbxproj index 2b1f36a9e..35f06d32e 100644 --- a/examples/objective-c-ios/Bugsnag Test App.xcodeproj/project.pbxproj +++ b/examples/objective-c-ios/Bugsnag Test App.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ /* Begin PBXFileReference section */ 0013DB142449E934003DB182 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 00C3ED5723F2D6D800757DBD /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 01CD18D525F7BA4700009EC3 /* Bugsnag Test App.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Bugsnag Test App.entitlements"; sourceTree = ""; }; 89117F5055F6B6F9FA00FBEC /* Pods-Bugsnag Test App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bugsnag Test App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Bugsnag Test App/Pods-Bugsnag Test App.debug.xcconfig"; sourceTree = ""; }; 8A4882E1224BCC130035B94C /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; 8A4882E3224BCD5D0035B94C /* OutOfMemoryController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OutOfMemoryController.h; sourceTree = ""; }; @@ -122,6 +123,7 @@ F40B875016AA233500676BB2 /* Bugsnag Test App */ = { isa = PBXGroup; children = ( + 01CD18D525F7BA4700009EC3 /* Bugsnag Test App.entitlements */, A1F5109A249A5C4000AFF4DE /* CxxException.h */, A1F51099249A5C4000AFF4DE /* CxxException.mm */, F40B875916AA233500676BB2 /* AppDelegate.h */, @@ -391,6 +393,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Bugsnag Test App/Bugsnag Test App.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; @@ -408,6 +411,7 @@ PROVISIONING_PROFILE = ""; SEPARATE_STRIP = YES; STRIP_INSTALLED_PRODUCT = YES; + SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 4.0; WRAPPER_EXTENSION = app; }; @@ -419,6 +423,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Bugsnag Test App/Bugsnag Test App.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEPLOYMENT_POSTPROCESSING = YES; @@ -434,6 +439,7 @@ PROVISIONING_PROFILE = ""; SEPARATE_STRIP = YES; STRIP_INSTALLED_PRODUCT = YES; + SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 4.0; WRAPPER_EXTENSION = app; }; diff --git a/examples/objective-c-ios/Bugsnag Test App/Bugsnag Test App.entitlements b/examples/objective-c-ios/Bugsnag Test App/Bugsnag Test App.entitlements new file mode 100644 index 000000000..ee95ab7e5 --- /dev/null +++ b/examples/objective-c-ios/Bugsnag Test App/Bugsnag Test App.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + From c6d9a0ef48125b4745c710dcf6c08a9bc7e340db Mon Sep 17 00:00:00 2001 From: Nick Dowell Date: Tue, 9 Mar 2021 15:04:42 +0000 Subject: [PATCH 2/2] Fix os_proc_available_memory runtime link error on Mac Catalyst --- Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c | 4 ++-- CHANGELOG.md | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c b/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c index fe4aff40e..d9c3903e9 100644 --- a/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c +++ b/Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c @@ -38,7 +38,7 @@ #include #include -#if __has_include() && TARGET_OS_IPHONE +#if __has_include() && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST #include #endif @@ -71,7 +71,7 @@ static pthread_t bsg_g_topThread; static size_t (* get_available_memory)(void); static void bsg_ksmachfreeMemory_init(void) { -#if __has_include() && TARGET_OS_IPHONE +#if __has_include() && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST if (__builtin_available(iOS 13.0, tvOS 13.0, watchOS 6.0, *)) { // Only use `os_proc_available_memory` if it appears to be working. // 0 is returned if the calling process is not an app or is running diff --git a/CHANGELOG.md b/CHANGELOG.md index 06d8c7190..7ac41441c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ Changelog ### Bug fixes +* Fix `os_proc_available_memory` runtime link error on Mac Catalyst. + [#1025](https://github.com/bugsnag/bugsnag-cocoa/pull/1025) + * Fix missing `osName` and `osVersion` for errors reported from app extensions that do not link against UIKit. [#1022](https://github.com/bugsnag/bugsnag-cocoa/pull/1022)