Skip to content

Commit

Permalink
Merge pull request #1025 from bugsnag/nickdowell/fix-mac-catalyst-lin…
Browse files Browse the repository at this point in the history
…k-error

Fix os_proc_available_memory runtime link error on Mac Catalyst
  • Loading branch information
nickdowell authored Mar 9, 2021
2 parents 2222e97 + c6d9a0e commit 48dfb28
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <mach/mach_time.h>
#include <sys/sysctl.h>

#if __has_include(<os/proc.h>) && TARGET_OS_IPHONE
#if __has_include(<os/proc.h>) && TARGET_OS_IPHONE && !TARGET_OS_MACCATALYST
#include <os/proc.h>
#endif

Expand Down Expand Up @@ -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(<os/proc.h>) && TARGET_OS_IPHONE
#if __has_include(<os/proc.h>) && 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
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
/* Begin PBXFileReference section */
0013DB142449E934003DB182 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
00C3ED5723F2D6D800757DBD /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
01CD18D525F7BA4700009EC3 /* Bugsnag Test App.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Bugsnag Test App.entitlements"; sourceTree = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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;
Expand All @@ -408,6 +411,7 @@
PROVISIONING_PROFILE = "";
SEPARATE_STRIP = YES;
STRIP_INSTALLED_PRODUCT = YES;
SUPPORTS_MACCATALYST = YES;
SWIFT_VERSION = 4.0;
WRAPPER_EXTENSION = app;
};
Expand All @@ -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;
Expand All @@ -434,6 +439,7 @@
PROVISIONING_PROFILE = "";
SEPARATE_STRIP = YES;
STRIP_INSTALLED_PRODUCT = YES;
SUPPORTS_MACCATALYST = YES;
SWIFT_VERSION = 4.0;
WRAPPER_EXTENSION = app;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

0 comments on commit 48dfb28

Please sign in to comment.