feat: Add iOS-ObjectiveCpp-NoModules sample reproducing #4543#7433
feat: Add iOS-ObjectiveCpp-NoModules sample reproducing #4543#7433philprime wants to merge 3 commits intophilprime/spm-samplefrom
Conversation
Add a sample project that reproduces the ObjC++ without-modules issue where SentrySDK is undeclared when using #import <Sentry/Sentry.h> with CLANG_ENABLE_MODULES=NO. Since SDK 8.54, SentrySDK is a Swift class and only visible via Sentry-Swift.h or @import Sentry, both of which are unusable from ObjC++ without modules. This sample serves as a test case for the pure ObjC SDK wrapper proposed in #6342. It is intentionally not in CI since it does not build with the current SDK. Refs #4543 Refs #6342
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## philprime/spm-sample #7433 +/- ##
==========================================================
- Coverage 85.770% 85.315% -0.455%
==========================================================
Files 480 480
Lines 28616 28615 -1
Branches 12380 12374 -6
==========================================================
- Hits 24544 24413 -131
- Misses 4023 4154 +131
+ Partials 49 48 -1 see 9 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
The build-sample-iOS-ObjectiveCpp-NoModules target was missing the -destination flag, which would cause xcodebuild to resolve a destination automatically. This is unreliable on CI and may target the wrong platform. Refs #4543
Performance metrics 🚀
|
This PR needs to be merged after #7430
Summary
Samples/iOS-ObjectiveCpp-NoModules) that reproduces the ObjC++ without-modules issue from Replay options not visible from Objective-C without @import #4543.mmfiles withCLANG_ENABLE_MODULES=NOand#import <Sentry/Sentry.h>, which fails witherror: use of undeclared identifier 'SentrySDK'since SDK 8.54 movedSentrySDKto SwiftBackground
Since SDK 8.54,
SentrySDKis a Swift class only visible viaSentry-Swift.hor@import Sentry. Projects that cannot enable Clang modules (React Native ≤0.76, Haxe, custom build systems) can only use#import <Sentry/Sentry.h>, which no longer includesSentrySDK. The sample is intentionally not in the CI build matrix since it does not build with the current SDK.Test plan
xcodegen --spec Samples/iOS-ObjectiveCpp-NoModules/iOS-ObjectiveCpp-NoModules.ymlgenerates the projectiOS-ObjectiveCpp-NoModulesfails witherror: use of undeclared identifier 'SentrySDK'— confirming the reproducer works#skip-changelog
Refs #4543
Refs #6342