Skip to content

ref: Add native utility and profiling targets - #9722

Merged
philprime merged 5 commits into
mainfrom
ref/native-utils-target
Nov 30, 2026
Merged

philprime merged 5 commits into
mainfrom
ref/native-utils-target

Conversation

@philprime

@philprime philprime commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

📜 Description

Introduce SentryNativeUtils and SentryProfiling as shared static-library targets in Xcode and SwiftPM. They own the time helpers and profiling system-metrics value object, with the SDK consuming those implementations.

💡 Motivation and Context

Stacked on #9826. The profiling boundary extraction continues in #9608.

SentryNativeUtils contains Objective-C++ utilities without Swift or SDK implementation dependencies. SentryProfiling depends on native utilities, not SDK implementation code or crash backends. The sampler and profiling capability checks remain SDK-side.

Arrows point from consumers to their dependencies:

flowchart TD
    SDK["SDK targets"] --> Profiling["SentryProfiling"]
    SDK --> NativeUtils["SentryNativeUtils"]
    Profiling --> NativeUtils
    ProfilingTests["SentryProfilingTests"] --> Profiling
    NativeUtilsTests["SentryNativeUtilsTests"] --> NativeUtils
Loading

The target boundaries preserve C linkage, SDK exports, static archive dependencies, and strict SDK nullability warnings. Dedicated SwiftPM suites cover the extracted utilities.

#skip-changelog

💚 How did you test it?

  • Formatting, static analysis, manifest/project checks, and the macOS SDK build passed after rebasing onto ref: Standardize test utility directories #9826.
  • Targeted native-utils and profiling package tests passed.
  • Full platform and test-matrix verification is incomplete for the current head.

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed. No wizard changes required.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • If I added a new public API, I also added it to the SentryObjC wrapper. Not applicable: these are internal implementation boundaries.

@philprime philprime added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Nov 23, 2026
@philprime philprime self-assigned this Nov 23, 2026
@sentry

sentry Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Size Analysis

1 component analyzed

iOS Builds

Name Configuration Version Download Size Install Size
SDK-Size (iOS)
io.sentry.sample.SDK-Size
Release 9.36.0 (1) 1.5 MB (N/A) 4.0 MB (N/A)

Configure sentry-cocoa status check rules

@sentry

sentry Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.36.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@philprime
philprime marked this pull request as ready for review November 24, 2026 11:43
@philprime
philprime requested review from a team, donnywals and noahsmartin as code owners November 24, 2026 11:43
@philprime
philprime requested review from NinjaLikesCheez and itaybre and removed request for a team November 24, 2026 11:43
@philprime
philprime marked this pull request as draft November 24, 2026 11:44

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread Sentry.xcodeproj/project.pbxproj Resolved
@philprime
philprime marked this pull request as ready for review November 24, 2026 12:20
@philprime philprime removed the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Nov 24, 2026
@philprime
philprime enabled stacked auto-merge (squash) November 24, 2026 12:24

@itaybre itaybre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but be careful with the PR conflicts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dc6c57d. Configure here.

Comment thread Sentry.xcodeproj/project.pbxproj Resolved
Comment thread Sources/Configuration/Sentry.xcconfig Resolved
@philprime
philprime disabled stacked auto-merge November 25, 2026 09:09
@philprime

Copy link
Copy Markdown
Member Author

I'll postpone this change until after make main our v10 branch

@philprime philprime added the dontmerge A branch that absolutely should not be merged while this label is applied. label Nov 25, 2026
@philprime
philprime marked this pull request as draft November 25, 2026 09:23
@github-actions github-actions Bot removed the approved label Nov 25, 2026
@philprime
philprime force-pushed the ref/native-utils-target branch from dc6c57d to 71bcd3f Compare November 26, 2026 11:56
Comment thread Sources/Configuration/Sentry.xcconfig Resolved
@philprime philprime removed the dontmerge A branch that absolutely should not be merged while this label is applied. label Nov 26, 2026
@philprime
philprime force-pushed the ref/native-utils-target branch from c9e742e to 397417f Compare November 30, 2026 12:56
@philprime
philprime changed the base branch from main to philprime/ref/standardize-test-utils-layout November 30, 2026 12:58
@philprime philprime added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Nov 30, 2026
@philprime
philprime marked this pull request as ready for review November 30, 2026 14:53
@philprime philprime removed the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Nov 30, 2026
@philprime
philprime added this pull request to stack #9837 November 30, 2026 14:54
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 718ea83.

Main concerns: dependencies customers inherit, public contract, reach.

Rules that block low also fired:

  • R1: code was truncated, omitted or a reduced context was used: Sentry.xcodeproj/project.pbxproj, Sentry.xcodeproj/xcshareddata/xcschemes/SentryNativeUtils.xcscheme, Sentry.xcodeproj/xcshareddata/xcschemes/SentryProfiling.xcscheme, Sources/AGENTS.md, Sources/Configuration/SDK.xcconfig and 30 more
  • R5: dependencies or bundled SDK versions changed: Package.swift
  • R6: build or release configuration changed: .github/file-filters.yml, Makefile, Package.swift, Package@swift-6.1.swift, Package@swift-6.2.swift and 9 more

This label is a hint for reviewers, not an approval.

@philprime
philprime removed this pull request from stack #9837 November 30, 2026 14:54
@philprime
philprime added this pull request to stack #9838 November 30, 2026 15:03
Base automatically changed from philprime/ref/standardize-test-utils-layout to main November 30, 2026 16:12
@philprime
philprime force-pushed the ref/native-utils-target branch from 9ae44bc to 718ea83 Compare November 30, 2026 16:12
@github-actions github-actions Bot removed the risk: medium PR risk score: medium label Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • .github/file-filters.yml

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 30, 2026
@philprime
philprime enabled stacked auto-merge (squash) November 30, 2026 16:21
@philprime
philprime merged commit 0896b67 into main Nov 30, 2026
240 checks passed
@philprime
philprime deleted the ref/native-utils-target branch November 30, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants