Repository navigation
fix(cli): Compile out profiling in the Apple wizard snippet on watchOS, tvOS, and visionOS - #2791
Conversation
…S, tvOS, and visionOS sentry-cocoa defines Options.configureProfiling only outside watchOS, tvOS, and visionOS, so the SentrySDK.start snippet that sentry wizard ios writes failed to compile on those platforms. Wrap the profiling block in the same compile-time platform check the SDK uses, which also covers multiplatform targets. Co-Authored-By: Antonis Lilis <antonis.lilis@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Tested end to end with the packed npm build of a local branch:
Before this PR, tvOS failed with Merge note: this PR conflicts with #2790 in |
…iling-platform-check Resolve the templates.test.ts conflict with #2790 by keeping both new describe blocks: the profiling platform check and the 9.x API check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found while testing
sentry wizard ioson a fresh tvOS app. TheSentrySDK.startsnippet the wizard writes doesn't build:In sentry-cocoa 9.x,
Options.swiftdefinesconfigureProfilingonly under#if !(os(watchOS) || os(tvOS) || os(visionOS)). So tvOS, watchOS, and visionOS apps fail, and so does a multiplatform target that includes any of them.This wraps the profiling block (with its comment line) in each template in a compile-time check that matches the SDK's guard, instead of detecting the platform from the Xcode project. That way a multiplatform target keeps profiling on iOS and macOS:
#if !(os(watchOS) || os(tvOS) || os(visionOS))…#endif#if !(TARGET_OS_WATCH || TARGET_OS_TV || TARGET_OS_VISION)…#endifThe directives use the same indentation as the statements around them, so the injected snippet stays aligned. The existing-init detection in
code-tools.ts(SentrySDK.start/[SentrySDK start) is unaffected.via Antonis Lilis.
--
View Session [Sentry]