Skip to content

build: switch objective sharpie version - #5583

Open
ric-oliv wants to merge 3 commits into
mainfrom
build/switch-obj-sharpie-version
Open

ric-oliv wants to merge 3 commits into
mainfrom
build/switch-obj-sharpie-version

Conversation

@ric-oliv

@ric-oliv ric-oliv commented Sep 16, 2026

Copy link
Copy Markdown

Summary

Replace usage of the old objectivesharpie Homebrew cask with the currently maintained Sharpie.Bind.Tool.

Rationale

The homebrew version is an outdated x86_64 Mono application that needs Rosetta, and it only emits usable bindings alongside a separate Xamarin.iOS installation which also needs Rosetta.
The dotnet tool runs natively on Apple silicon and carries its own .NET binding profile, so neither is required.

Rosetta support will be dropped on macOS 28, so this change already addresses this future breakage.

Notes

Regenerating the bindings with the newer Sharpie, besides changing the ApiDefinitions.cs file name (plural -> singular), changes the generated binding for the NSUrlSessionDelegate (generated as INSUrlSessionDelegate instead).

-    NSUrlSessionDelegate UrlSessionDelegate { get; set; }
+    INSUrlSessionDelegate UrlSessionDelegate { get; set; }

This is not a breaking change, as this is not part of our public API:

  1. The changed type is internal: The generated SentryObjCOptions is marked [Internal] by patch-cocoa-bindings.cs, so it compiles to an internal type in Sentry.Bindings.Cocoa and never appears in any public contract.
  2. The public API is untouched: SentryOptions.Native.UrlSessionDelegate is still public NSUrlSessionDelegate? - that file isn't in this diff.
  3. The one crossing point still compiles as before: SentrySdk.cs assigns the public NSUrlSessionDelegate? into the binding's INSUrlSessionDelegate property; that's an implicit reference conversion, since Foundation.NSUrlSessionDelegate implements Foundation.INSUrlSessionDelegate.

Verified with Microsoft.DotNet.ApiCompat.Tool by building Sentry.dll and Sentry.Bindings.Cocoa.dll before and after the change: no breaking changes on either assembly, including --strict-mode (which also flags additions). Reading the property straight out of both assemblies' metadata gives the identical public signature Sentry.SentryOptions+NativeOptions.UrlSessionDelegate : Foundation.NSUrlSessionDelegate.

Incidentally the interface is the more faithful mapping: the Cocoa header declares @property (nonatomic, weak, nullable) id<NSURLSessionDelegate> urlSessionDelegate;, and an id conforming to a protocol maps to the I-prefixed interface rather than the concrete class.

#skip-changelog

ric-oliv and others added 2 commits September 16, 2026 14:07
Remove usage of the objectivesharpie Homebrew cask to avoid dependency on Rosetta.

This homebrew version is an outdated x86_64 Mono application that needs Rosetta, and it only emits usable bindings alongside a separate Xamarin.iOS installation which also needs Rosetta.
The dotnet tool runs natively on Apple silicon and carries its own .NET binding
profile, so neither is required.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The newest version of Sharpie generates the ApiDefinition.cs file name as singular instead of plural.
This commit changes our files to the new standard.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ric-oliv
ric-oliv requested review from bruno-garcia and jamescrosswell and removed request for jamescrosswell September 16, 2026 13:07
@github-actions github-actions Bot added the risk: high PR risk score: high label Sep 16, 2026

@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 and found 1 potential issue.

Fix All in Cursor

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

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4b177b9. Configure here.

Comment thread src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj
@codecov

codecov Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.75%. Comparing base (c5af37d) to head (4c872ca).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5583      +/-   ##
==========================================
- Coverage   74.76%   74.75%   -0.01%     
==========================================
  Files         515      515              
  Lines       18963    18963              
  Branches     3694     3694              
==========================================
- Hits        14177    14176       -1     
- Misses       3908     3909       +1     
  Partials      878      878              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ric-oliv
ric-oliv force-pushed the build/switch-obj-sharpie-version branch from c0eaa0c to 4c872ca Compare September 16, 2026 13:56
@ric-oliv ric-oliv changed the title build: switch objetive sharpie version build: switch objective sharpie version Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant