Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Build visionOS project with static Sentry SDK #4462

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Build visionOS project with static Sentry SDK (#4462)

## 8.39.0-beta.1

### Removal of Experimental API
Expand Down
1 change: 1 addition & 0 deletions Sources/Configuration/SDK.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ GCC_PREPROCESSOR_DEFINITIONS_TestCI = DEBUG=1 TEST=1 TESTCI=1
GCC_PREPROCESSOR_DEFINITIONS_Release = RELEASE=1
GCC_PREPROCESSOR_DEFINITIONS_ReleaseWithoutUIKit = RELEASE=1 SENTRY_NO_UIKIT=1
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS_$(CONFIGURATION))
SWIFT_OBJC_INTEROP_MODE[sdk=xr*]=objcxx
5 changes: 3 additions & 2 deletions Sources/Sentry/SentryLevelHelper.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#import "SentryLevelHelper.h"
#import "SentryBreadcrumb+Private.h"

NSUInteger
sentry_breadcrumbLevel(SentryBreadcrumb *breadcrumb)
@implementation SentryLevelBridge : NSObject
+ (NSUInteger)breadcrumbLevel:(SentryBreadcrumb *)breadcrumb
{
return breadcrumb.level;
}
@end
2 changes: 2 additions & 0 deletions Sources/Sentry/SentrySDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import "SentryHub+Private.h"
#import "SentryInternalDefines.h"
#import "SentryLog.h"
#import "SentryLogC.h"
#import "SentryMeta.h"
#import "SentryOptions+Private.h"
#import "SentryProfilingConditionals.h"
Expand Down Expand Up @@ -202,6 +203,7 @@ + (void)startWithOptions:(SentryOptions *)options
{
startOption = options;
[SentryLog configure:options.debug diagnosticLevel:options.diagnosticLevel];
sentry_initializeAsyncLogFile();

// We accept the tradeoff that the SDK might not be fully initialized directly after
// initializing it on a background thread because scheduling the init synchronously on the main
Expand Down
4 changes: 3 additions & 1 deletion Sources/Sentry/include/SentryLevelHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ NS_ASSUME_NONNULL_BEGIN
/**
* This is a workaround to access SentryLevel value from swift
*/
NSUInteger sentry_breadcrumbLevel(SentryBreadcrumb *breadcrumb);
@interface SentryLevelBridge : NSObject
+ (NSUInteger)breadcrumbLevel:(SentryBreadcrumb *)breadcrumb;
@end

NS_ASSUME_NONNULL_END
2 changes: 1 addition & 1 deletion Sources/Swift/Helper/Log/SentryLevel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ class SentryLevelHelper: NSObject {
}

static func breadcrumbLevel(_ breadcrumb: Breadcrumb) -> SentryLevel? {
SentryLevel(rawValue: sentry_breadcrumbLevel(breadcrumb))
SentryLevel(rawValue: SentryLevelBridge.breadcrumbLevel(breadcrumb))
}
}
1 change: 0 additions & 1 deletion Sources/Swift/Tools/SentryLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class SentryLog: NSObject {
self.isDebug = isDebug
self.diagnosticLevel = diagnosticLevel
}
sentry_initializeAsyncLogFile()
}

@objc
Expand Down