Skip to content

Commit 20c8177

Browse files
philprimearmcknightgetsentry-bot
authored
fix(profiling): Change path of non-sandboxed macOS app launch profile configuration (#5154)
Co-authored-by: Andrew McKnight <andrew.mcknight@sentry.io> Co-authored-by: getsentry-bot <bot@sentry.io> Co-authored-by: Philip Niedertscheider <phil.niedertscheider@sentry.io>
1 parent c40037e commit 20c8177

40 files changed

+1856
-154
lines changed

.github/last-release-runid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14595118725
1+
14735024914

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@
2525
- Use wider compatible video encoding options for Session Replay (#5134)
2626
- GA of better session replay view renderer V2 (#5054)
2727

28+
## 8.49.2
29+
30+
> [!Important]
31+
> Version 8.21.0 introduced an issue for app launch profiling **only for macOS apps that run without a sandbox** (i.e. distributed outside the Mac App Store).
32+
> This issue could lead to starting the app launch profiler even when it's not configured via the options.
33+
> We recommend upgrading to at least this version.
34+
35+
### Fixes
36+
37+
- Non-sandboxed macOS app launch profile configuration are now respected (#5144)
38+
2839
## 8.49.1
2940

3041
### Fixes
@@ -42,7 +53,7 @@
4253
- New continuous profiling configuration API (#4952 and #5063)
4354

4455
> [!Important]
45-
> With the addition of the new profiling configuation API, the previous profiling API are deprecated and will be removed in the next major version of the SDK:
56+
> With the addition of the new profiling configuration API, the previous profiling API are deprecated and will be removed in the next major version of the SDK:
4657
>
4758
> - `SentryOptions.enableProfiling`
4859
> - `SentryOptions.isProfilingEnabled`
@@ -922,6 +933,11 @@ The following two features, disabled by default, were mistakenly added to the re
922933

923934
## 8.21.0
924935

936+
> [!Important]
937+
> This version introduced an issue for app launch profiling **only for macOS apps that run without a sandbox** (i.e. distributed outside the Mac App Store).
938+
> This issue could lead to starting the app launch profiler even when it's not configured via the options.
939+
> We recommend upgrading to at least version 8.49.2.
940+
925941
### Features
926942

927943
- Add support for Sentry [Spotlight](https://spotlightjs.com/) (#3642), which is basically Sentry

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ let package = Package(
1212
targets: [
1313
.binaryTarget(
1414
name: "Sentry",
15-
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.49.1/Sentry.xcframework.zip",
16-
checksum: "05ca333d2022c1fb17c08ce8b4c845bda56b8b9a14d9e58dad0be4d402b2df36" //Sentry-Static
15+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.49.2/Sentry.xcframework.zip",
16+
checksum: "85cf16b4fa2dd0ae58b1e5c62fd8c829c94e5dc92251c3a1de8e71b3fed195ef" //Sentry-Static
1717
),
1818
.binaryTarget(
1919
name: "Sentry-Dynamic",
20-
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.49.1/Sentry-Dynamic.xcframework.zip",
21-
checksum: "e85968c3b8abf5bdbb0eb27808b19b9c2204632c369f60a866b20d8bc9ce6935" //Sentry-Dynamic
20+
url: "https://github.com/getsentry/sentry-cocoa/releases/download/8.49.2/Sentry-Dynamic.xcframework.zip",
21+
checksum: "a35caf34219721170f53a3a25281f9f06efd2aa36847d1b604d83ee6b9ae424d" //Sentry-Dynamic
2222
),
2323
.target ( name: "SentrySwiftUI",
2424
dependencies: ["Sentry", "SentryInternal"],

Plans/iOS13-Swift_Base.xctestplan

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
"defaultOptions" : {
1212
"codeCoverage" : false,
1313
"commandLineArgumentEntries" : [
14-
{
15-
"argument" : "--io.sentry.profiling.enable",
16-
"enabled" : false
17-
}
14+
1815
],
1916
"targetForVariableExpansion" : {
2017
"containerPath" : "container:iOS-Swift.xcodeproj",

Plans/macOS-Swift_Base.xctestplan

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
"defaultOptions" : {
1212
"codeCoverage" : false,
1313
"commandLineArgumentEntries" : [
14-
{
15-
"argument" : "--io.sentry.profiling.enable",
16-
"enabled" : false
17-
}
14+
1815
],
1916
"targetForVariableExpansion" : {
2017
"containerPath" : "container:macOS-Swift.xcodeproj",
@@ -24,7 +21,13 @@
2421
"uiTestingScreenshotsLifetime" : "keepAlways"
2522
},
2623
"testTargets" : [
27-
24+
{
25+
"target" : {
26+
"containerPath" : "container:macOS-Swift.xcodeproj",
27+
"identifier" : "84B5A90E2DBD1AA4003327C9",
28+
"name" : "macOS-Swift-UITests"
29+
}
30+
}
2831
],
2932
"version" : 1
3033
}

Samples/iOS-Swift/iOS-Swift-UITests/UserFeedbackUITests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class UserFeedbackUITests: BaseUITest {
88
let fm = FileManager.default
99

1010
/// The Application Support directory is different between this UITest runner app and the target app under test. We have to retrieve the target app's app support directory using UI elements and store it here for usage.
11+
/// - note: The SDK does not use application support for anything. We only use the app support directory for these tests to write marker files from the app indicating which feedback hooks have fired.
1112
var appSupportDirectory: String?
1213

1314
override func setUp() {

Samples/iOS-Swift/iOS-Swift.xcodeproj/xcshareddata/xcschemes/iOS13-Swift.xcscheme

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@
6666
ReferencedContainer = "container:iOS-Swift.xcodeproj">
6767
</BuildableReference>
6868
</BuildableProductRunnable>
69-
<CommandLineArguments>
70-
<CommandLineArgument
71-
argument = "--io.sentry.profiling.enable"
72-
isEnabled = "NO">
73-
</CommandLineArgument>
74-
</CommandLineArguments>
7569
</LaunchAction>
7670
<ProfileAction
7771
buildConfiguration = "Release"

Samples/iOS-Swift/iOS-Swift/Profiling/NSObject+SentryAppSetup.m

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ + (void)load
55
{
66
NSLog(@"[iOS-Swift] Starting app launch work");
77
if ([NSProcessInfo.processInfo.arguments containsObject:@"--io.sentry.slow-load-method"]) {
8-
NSMutableString *a = [NSMutableString string];
9-
// 1,000,000 iterations takes about 225 milliseconds in the iPhone 15 simulator on an
10-
// M2 macbook pro; we might have to adapt this for CI
11-
for (NSUInteger i = 0; i < 4000000; i++) {
12-
[a appendFormat:@"%d", arc4random() % 12345];
13-
}
8+
[self sentry_slowLoadWork];
149
}
1510
NSLog(@"[iOS-Swift] Finishing app launch work");
1611
}
12+
13+
+ (void)sentry_slowLoadWork
14+
{
15+
NSMutableString *a = [NSMutableString string];
16+
// 1,000,000 iterations takes about 225 milliseconds in the iPhone 15 simulator on an
17+
// M2 macbook pro; we might have to adapt this for CI
18+
for (NSUInteger i = 0; i < 4000000; i++) {
19+
[a appendFormat:@"%d", arc4random() % 12345];
20+
}
21+
}
1722
@end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MARKETING_VERSION = 8.49.1
1+
MARKETING_VERSION = 8.49.2

Samples/macOS-Swift/macOS-Swift/AppDelegate.swift renamed to Samples/macOS-Swift/Shared/AppDelegate.swift

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,30 @@ import Sentry
55
class AppDelegate: NSObject, NSApplicationDelegate {
66

77
func applicationDidFinishLaunching(_ aNotification: Notification) {
8-
98
// Insert code here to initialize your application
109
SentrySDK.start { options in
1110
options.dsn = "https://6cc9bae94def43cab8444a99e0031c28@o447951.ingest.sentry.io/5428557"
1211
options.debug = true
1312
options.tracesSampleRate = 1.0
1413

1514
let args = ProcessInfo.processInfo.arguments
16-
17-
if args.contains("--io.sentry.profiling.enable") {
18-
options.profilesSampleRate = 1
15+
16+
// Set the profilesSampleRate to `nil` to enable the configureProfiling block
17+
options.profilesSampleRate = nil
18+
options.configureProfiling = {
19+
$0.profileAppStarts = ProcessInfo.processInfo.arguments.contains("--io.sentry.enable-profile-app-starts")
20+
$0.sessionSampleRate = 1
21+
}
22+
23+
if args.contains("--disable-auto-performance-tracing") {
24+
options.enableAutoPerformanceTracing = false
1925
}
26+
2027
if #available(macOS 12.0, *), !args.contains("--disable-metrickit-integration") {
2128
options.enableMetricKit = true
2229
options.enableMetricKitRawPayload = true
2330
}
24-
31+
2532
options.initialScope = { scope in
2633
if let path = Bundle.main.path(forResource: "Tongariro", ofType: "jpg") {
2734
scope.addAttachment(Attachment(path: path, filename: "Tongariro.jpg", contentType: "image/jpeg"))

0 commit comments

Comments
 (0)