-
-
Notifications
You must be signed in to change notification settings - Fork 223
chore(deps): update Cocoa SDK to v8.56.0 #4528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c4a5288
to
690532d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4528 +/- ##
==========================================
+ Coverage 73.39% 73.42% +0.02%
==========================================
Files 479 479
Lines 17506 17506
Branches 3480 3480
==========================================
+ Hits 12849 12854 +5
+ Misses 3776 3773 -3
+ Partials 881 879 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
42d9c05
to
ac37eb7
Compare
Note: I did not write bindings for the new Swift types by hand but generated them with: Crafting the initial Swift types in their current form is quite straight-forward, but maintaining future changes by hand is going to be error-prone. I'll try to get back to generating Swift types automatically to avoid that... |
|
||
// -(NSDictionary<NSString *,id> * _Nonnull)serialize __attribute__((warn_unused_result(""))); | ||
[Export ("serialize")] | ||
NSDictionary<NSString, NSObject> Serialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question new
/CS0108
Why can't (or shouldn't) use new
here (and in ApiDefinitions.cs
),
and rather suppress the diagnostic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And should we, consequently, also remove the other usages of new
?
new NSDictionary<NSString, NSObject> Serialize(); new NSDictionary<NSString, NSObject> Serialize(); new NSDictionary<NSString, NSObject> Serialize();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem was that the error came from SentrySpan.g.cs
, not from ApiDefinitions.cs
:
Error: /Users/runner/work/sentry-dotnet/sentry-dotnet/src/Sentry.Bindings.Cocoa/obj/Release/net8.0-ios17.0/iOS/Sentry.CocoaSdk/SentrySpan.g.cs(134,36): error CS0108: 'ISentrySpan.Serialize()' hides inherited member 'ISentrySerializable.Serialize()'. Use the new keyword if hiding was intended. [/Users/runner/work/sentry-dotnet/sentry-dotnet/src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj::TargetFramework=net8.0-ios17.0]
https://github.com/getsentry/sentry-dotnet/actions/runs/17763516547/job/50481482686?pr=4528
Is there any other way to get around this? If not, we could indeed remove the respective modifications in ApiDefinitions.cs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to elaborate a bit, I had tried changing the regexp to make ApiDefinitions.cs
look like this:
// @protocol SentrySpan <SentrySerializable>
[Protocol]
[Model]
[Internal]
[BaseType (typeof(NSObject))]
interface SentrySpan : SentrySerializable
{
...
// @required -(NSDictionary<NSString *,id> * _Nonnull)serialize;
[Abstract]
[Export ("serialize")]
new NSDictionary<NSString, NSObject> Serialize();
}
Still, SentrySpan.g.cs
generated on the fly looks like this:
namespace Sentry.CocoaSdk {
...
internal partial interface ISentrySpan : INativeObject, IDisposable,
Sentry.CocoaSdk.ISentrySerializable
{
...
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
[Export ("serialize")]
[Preserve (Conditional = true)]
NSDictionary<NSString, NSObject> Serialize ();
}
Which then results in CS0108 :(
Sentry.Bindings.Cocoa net8.0-maccatalyst17.0 failed with 1 error(s) (6.2s)
/Users/jpnurmi/Projects/sentry/sentry-dotnet/src/Sentry.Bindings.Cocoa/obj/Release/net8.0-maccatalyst17.0/MacCatalyst/Sentry.CocoaSdk/SentrySpan.g.cs(134,36): error CS0108: 'ISentrySpan.Serialize()' hides inherited member 'ISentrySerializable.Serialize()'. Use the new keyword if hiding was intended.
Sentry.Bindings.Cocoa net8.0-ios17.0 failed with 1 error(s) (6.8s)
/Users/jpnurmi/Projects/sentry/sentry-dotnet/src/Sentry.Bindings.Cocoa/obj/Release/net8.0-ios17.0/iOS/Sentry.CocoaSdk/SentrySpan.g.cs(134,36): error CS0108: 'ISentrySpan.Serialize()' hides inherited member 'ISentrySerializable.Serialize()'. Use the new keyword if hiding was intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cleaned up the unnecessary modifications now that CS0108 is disabled: e7b1919
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you ignore the CS0108 warning and do not use the
new
keyword, the runtime behavior is identical to what it would be if you had usednew
. Thenew
keyword only affects compile-time intent and clarity, not the actual method hiding at runtime.
- Without
new
: The member still hides the base member, but the compiler warns you (CS0108) to make sure you’re aware.- With
new
: The member explicitly hides the base member, and the warning is suppressed.In both cases, the derived member hides the base member, and calls to the member on the derived type will use the derived implementation. The difference is only at compile time: using
new
makes your intent explicit and silences the warning.Summary:
Ignoring the warning does not change runtime behavior; it only leaves a warning in your build output. The code will work the same way either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see ... thanks for elaborating.
Now I'm wondering, does new
actually have an effect in metadata ... so I'm wondering of removing existing new
s could be a breaking change 🤔 ... so I'm wondering if we should leave it as it was before my "complaint"
UPDATE 1: no ... new
does not seem to be reflected in IL
UPDATE 2: oops ... didn't see your latest comment ... I have no more concerns 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe safer to leave the existing ones intact, after all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's green (so all our tests passed) and I managed to build and run our sample app with it (and catch an exception)... so LGTM!
fixes #4139
Bumps modules/sentry-cocoa.properties from 8.55.1 to 8.56.0.
Auto-generated by a dependency updater.
Changelog
8.56.0
Features
Improvements
SentrySDK.logger
calls toSentrySDKLog
(#5991)enterprise
andadhoc
(#6044)Fixes
beforeSend
(#5916)SentrySDK.start
becomes unusable (#5984)attachScreenshot
too (#5989)This may result in more of the camera screen being redacted. (#6045)
8.56.0-alpha.3
Fixes
8.56.0-alpha.2
Features
Fixes
This may result in more of the camera screen being redacted. (#6045)
8.56.0-alpha.1
8.56.0-alpha.0
Features
Fixes
beforeSend
(#5916)SentrySDK.start
becomes unusable (#5984)attachScreenshot
too (#5989)Improvements
SentrySDK.logger
calls toSentrySDKLog
(#5991)enterprise
andadhoc
(#6044)