From bee4d7421c3b92a847dee2294f98b5f0184527d6 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Fri, 14 Feb 2025 12:39:56 -0900 Subject: [PATCH 1/3] change(profiling): deprecate old trace-and continuous profiling API --- Sources/Sentry/Public/SentryOptions.h | 15 +++++++++++---- Sources/Sentry/Public/SentrySDK.h | 6 ++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index d904f4bf47..198cf3fd20 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -525,7 +525,9 @@ NS_SWIFT_NAME(Options) * whether to set this property to @c YES or @c NO . * @note Profiling is automatically disabled if a thread sanitizer is attached. */ -@property (nonatomic, assign) BOOL enableAppLaunchProfiling; +@property (nonatomic, assign) BOOL enableAppLaunchProfiling DEPRECATED_MSG_ATTRIBUTE( + "This property will be removed in a future version of the SDK. See startProfilerOnAppStart and " + "profileLifecycle."); /** * @note Profiling is not supported on watchOS or tvOS. @@ -550,7 +552,8 @@ NS_SWIFT_NAME(Options) * @warning The new continuous profiling mode is experimental and may still contain bugs. * @note Profiling is automatically disabled if a thread sanitizer is attached. */ -@property (nullable, nonatomic, strong) NSNumber *profilesSampleRate; +@property (nullable, nonatomic, strong) NSNumber *profilesSampleRate DEPRECATED_MSG_ATTRIBUTE( + "This property will be removed in a future version of the SDK. See profileSessionSampleRate."); /** * @note Profiling is not supported on watchOS or tvOS. @@ -562,7 +565,10 @@ NS_SWIFT_NAME(Options) * disk for use on the next app launch. * @note Profiling is automatically disabled if a thread sanitizer is attached. */ -@property (nullable, nonatomic) SentryTracesSamplerCallback profilesSampler NS_SWIFT_SENDABLE; +@property (nullable, nonatomic) + SentryTracesSamplerCallback profilesSampler NS_SWIFT_SENDABLE DEPRECATED_MSG_ATTRIBUTE( + "This property will be removed in a future version of the SDK. See " + "profileSessionSampleRate."); /** * If profiling should be enabled or not. @@ -574,7 +580,8 @@ NS_SWIFT_NAME(Options) * set, otherwise @c NO. * @note Profiling is automatically disabled if a thread sanitizer is attached. */ -@property (nonatomic, assign, readonly) BOOL isProfilingEnabled; +@property (nonatomic, assign, readonly) BOOL isProfilingEnabled DEPRECATED_MSG_ATTRIBUTE( + "This property will be removed in a future version of the SDK. See profileLifecycle."); /** * @brief Whether to enable the sampling profiler. diff --git a/Sources/Sentry/Public/SentrySDK.h b/Sources/Sentry/Public/SentrySDK.h index b93a824334..1916c32045 100644 --- a/Sources/Sentry/Public/SentrySDK.h +++ b/Sources/Sentry/Public/SentrySDK.h @@ -363,14 +363,16 @@ SENTRY_NO_INIT * @warning Continuous profiling mode is experimental and may still contain bugs. * @seealso https://docs.sentry.io/platforms/apple/guides/ios/profiling/#continuous-profiling */ -+ (void)startProfiler; ++ (void)startProfiler DEPRECATED_MSG_ATTRIBUTE( + "This property will be removed in a future version of the SDK. See startProfileSession."); /** * Stop a continuous profiling session if there is one ongoing. * @warning Continuous profiling mode is experimental and may still contain bugs. * @seealso https://docs.sentry.io/platforms/apple/guides/ios/profiling/#continuous-profiling */ -+ (void)stopProfiler; ++ (void)stopProfiler DEPRECATED_MSG_ATTRIBUTE( + "This property will be removed in a future version of the SDK. See stopProfileSession."); #endif // SENTRY_TARGET_PROFILING_SUPPORTED @end From c277fa0ec4903cf2b575090dbd64029112b83125 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Fri, 14 Feb 2025 13:02:59 -0900 Subject: [PATCH 2/3] NOMAIN: temporarily disable warnings as errors until we figure out how to deal with the deprecated usage in SentryEnabledFeaturesBuilder --- Sources/Configuration/SDK.xcconfig | 5 ++--- Tests/Configuration/SentryTests.xcconfig | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Configuration/SDK.xcconfig b/Sources/Configuration/SDK.xcconfig index 8b4b99721d..f40c8a55dc 100644 --- a/Sources/Configuration/SDK.xcconfig +++ b/Sources/Configuration/SDK.xcconfig @@ -119,8 +119,6 @@ ENABLE_NS_ASSERTIONS = $(ENABLE_NS_ASSERTIONS_$(CONFIGURATION)) ENABLE_STRICT_OBJC_MSGSEND = YES -GCC_TREAT_WARNINGS_AS_ERRORS = YES - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES CLANG_WARN_COMMA = YES CLANG_WARN_DOCUMENTATION_COMMENTS = YES @@ -163,7 +161,8 @@ SWIFT_OPTIMIZATION_LEVEL_Test = -Onone SWIFT_OPTIMIZATION_LEVEL_TestCI = -Onone SWIFT_OPTIMIZATION_LEVEL = $(SWIFT_OPTIMIZATION_LEVEL_$(CONFIGURATION)) -SWIFT_TREAT_WARNINGS_AS_ERRORS = YES +GCC_TREAT_WARNINGS_AS_ERRORS = NO +SWIFT_TREAT_WARNINGS_AS_ERRORS = NO MTL_ENABLE_DEBUG_INFO_Debug = YES MTL_ENABLE_DEBUG_INFO_DebugWithoutUIKit = YES diff --git a/Tests/Configuration/SentryTests.xcconfig b/Tests/Configuration/SentryTests.xcconfig index 436c687a4b..f8e8bbd211 100644 --- a/Tests/Configuration/SentryTests.xcconfig +++ b/Tests/Configuration/SentryTests.xcconfig @@ -13,3 +13,6 @@ CLANG_ENABLE_OBJC_ARC = YES CLANG_ENABLE_MODULES = YES OTHER_CFLAGS = -Wall -Wextra APPLICATION_EXTENSION_API_ONLY = NO + +GCC_TREAT_WARNINGS_AS_ERRORS = NO +SWIFT_TREAT_WARNINGS_AS_ERRORS = NO From 3b04d2d0262ebc21f829789a4e1d8a9f8277f6c0 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 17 Feb 2025 22:02:53 -0900 Subject: [PATCH 3/3] add doc comment entries --- Sources/Sentry/Public/SentryOptions.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index 198cf3fd20..23654ef53b 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -524,10 +524,13 @@ NS_SWIFT_NAME(Options) * launch; if you desire sampling profiled launches, you must compute your own sample rate to decide * whether to set this property to @c YES or @c NO . * @note Profiling is automatically disabled if a thread sanitizer is attached. + * @deprecated See @c SentryProfilingOptions.startOnAppStart and + * @c SentryProfilingOptions.lifecycle . */ @property (nonatomic, assign) BOOL enableAppLaunchProfiling DEPRECATED_MSG_ATTRIBUTE( - "This property will be removed in a future version of the SDK. See startProfilerOnAppStart and " - "profileLifecycle."); + "This property will be removed in a future version of the SDK. See " + "SentryProfilingOptions.startOnAppStart and " + "SentryProfilingOptions.lifecycle."); /** * @note Profiling is not supported on watchOS or tvOS. @@ -551,9 +554,11 @@ NS_SWIFT_NAME(Options) * @note The default is @c nil (which implies continuous profiling mode). * @warning The new continuous profiling mode is experimental and may still contain bugs. * @note Profiling is automatically disabled if a thread sanitizer is attached. + * @deprecated See @c SentryProfilingOptions.sessionSampleRate . */ @property (nullable, nonatomic, strong) NSNumber *profilesSampleRate DEPRECATED_MSG_ATTRIBUTE( - "This property will be removed in a future version of the SDK. See profileSessionSampleRate."); + "This property will be removed in a future version of the SDK. See " + "SentryProfilingOptions.sessionSampleRate."); /** * @note Profiling is not supported on watchOS or tvOS. @@ -564,11 +569,12 @@ NS_SWIFT_NAME(Options) * with @c SentrySamplingContext.forNextAppLaunch set to @c YES, and the result will be persisted to * disk for use on the next app launch. * @note Profiling is automatically disabled if a thread sanitizer is attached. + * @deprecated See @c SentryProfilingOptions.sessionSampleRate . */ @property (nullable, nonatomic) SentryTracesSamplerCallback profilesSampler NS_SWIFT_SENDABLE DEPRECATED_MSG_ATTRIBUTE( "This property will be removed in a future version of the SDK. See " - "profileSessionSampleRate."); + "SentryProfilingOptions.sessionSampleRate."); /** * If profiling should be enabled or not. @@ -579,9 +585,10 @@ NS_SWIFT_NAME(Options) * @returns @c YES if either @c profilesSampleRate > @c 0 and \<= @c 1 , or @c profilesSampler is * set, otherwise @c NO. * @note Profiling is automatically disabled if a thread sanitizer is attached. + * @deprecated This property will be removed in a future release. */ @property (nonatomic, assign, readonly) BOOL isProfilingEnabled DEPRECATED_MSG_ATTRIBUTE( - "This property will be removed in a future version of the SDK. See profileLifecycle."); + "This property will be removed in a future version of the SDK."); /** * @brief Whether to enable the sampling profiler.