-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
fix: [iOS / Native AOT] - prevent use of unsupported marshalling behaviour #3729
base: main
Are you sure you want to change the base?
Conversation
…dException` as a replacement for ExceptionMode
…lManagedException` to disable MarshalException settings
…bleMarshelManagedException
Co-authored-by: Bruno Garcia <[email protected]>
Co-authored-by: Bruno Garcia <[email protected]>
Co-authored-by: Bruno Garcia <[email protected]>
… MarshalManagedException event if compiled with Native AOT
That link is interesting... it seems to imply this setting could be controlled at build time, rather than runtime (what we're doing)... so it might be possible to set this automatically to the appropriate value via our transitive build script rather than waiting until runtime. If we are going to do it at runtime, it might be possible to pick an appropriate value automatically based on whether or not the user's application is compiled AOT or not (rather than hoping they configure the right value via the native options). We have an |
Looking at the implementation of AotHelper .IsAOT, I got the same impression. Should we do
I like this idea |
…aviour: move the AOT check to compilation
src/Sentry.Bindings.Cocoa/buildTransitive/Sentry.Bindings.Cocoa.targets
Outdated
Show resolved
Hide resolved
… compilation instead of runtime
There are a few more hoops to jump through before you can do this right? You have to setup a provisioning profile for the app in the apple developer portal first? I'm just waiting for Apple to renew my annual membership to the developer portal so I can test. |
maybe? I'm not sure. I think Xcode creates a temporary one you can also use a simulator I think, btw |
is this waiting on validation? Can I help? or we put an alpha out and as folks reporting the issue? |
Yes @jamescrosswell is going to run some tests to validate this.
I think it would be a good idea so James doesn't have to jump through hoops to test this, and I can also create a repo. |
Sorry for the delay. I've been trying to resolve #3764 (which is blocking this PR and anything else that targets |
src/Sentry.Bindings.Cocoa/buildTransitive/Sentry.Bindings.Cocoa.targets
Outdated
Show resolved
Hide resolved
src/Sentry.Bindings.Cocoa/buildTransitive/Sentry.Bindings.Cocoa.targets
Outdated
Show resolved
Hide resolved
…a.targets Co-authored-by: James Crosswell <[email protected]>
@bricefriha I finally carved out some time to setup a provisioning profile etc. so that I can test this. At the moment, I'm not able to publish this to test though - I'm running into trim analysis errors like:
This may be unrelated to your PR and more related to the fact that we bumped to net9.0... it's coming from the source generators, which is a bit odd. We might be referencing the wrong version of something. It does, however, still prevent me from being able to test this 😞 |
That shouldn't be related because you should at least be able to publish the app entirely. I would try again with .net8.0 (for troubleshooting sake) |
UpdateI experience the same issue now with .net9 |
This PR aims to fix #3280, preventing the use of unsupported marshalling behaviour
UnwindNativeCode
for Native AOT by disabling Marshal Exceptions when the code is compiled via native AOT (as advised here).Testing
Testing these changes is more tricky than usual since we did find a way to run this from Unit Tests.
The best way to do this is to: [on a MAC with xcode installed]
sentry-dotnet
repository (make sure you don't do it on a directory that is linked to iCloud)fix/#3680
cd /Samples/Sentry.Samples.Maui
Known error while testing (and their workaround)
error : strip exited with code 13
: this is a known issue with Xcode 16 (now fixed on Xcode16.2 beta) If you get this error, add the following line to the .csproj of the maui project: