-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Windows native support #380
Conversation
edit: moved to a new issue: #543 |
# Conflicts: # src/Sentry.Unity.Editor/SentryWindow.cs
…main` branch git history shows the files as moved to sentry.dll.meta and Sentry.unity.native.dll.meta
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.
Looks really good to me!
{ | ||
if (options.WindowsNativeSupportEnabled) | ||
{ | ||
SentryNativeBridge.Init(options.Dsn!, options.Release!); |
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.
SentryNativeBridge.Init(options.Dsn!, options.Release!); | |
SentryNativeBridge.Init(options.Dsn, options.Release); |
Personally, I'd like to be a bit more defensive here and for example, pass the values down to the bridge and check/deal with them there.
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.
- passing
options
down to Init() - dsn is asserted to be non-null on android as well, so keeping as is
- making the
release
setting conditional
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 !
is set here I assume the method doesn't accept nullable. So either we need to check for null before calling, or make the Init
method take null and deal with it later.
If we can't have Init
do its thing with null arguments, we should just check for those values here before we call and log in case we're not calling due to missing options.
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.
Note: DSN is not null because options.Validate()
must have returned true in SentryInitialization.cs for this to be called at all. I've added a comment.
Co-authored-by: Stefan Jandl <stefan.jandl@sentry.io>
Co-authored-by: Stefan Jandl <stefan.jandl@sentry.io>
Co-authored-by: Stefan Jandl <stefan.jandl@sentry.io>
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.
Looking great!
{ | ||
if (options.WindowsNativeSupportEnabled) | ||
{ | ||
SentryNativeBridge.Init(options.Dsn!, options.Release!); |
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 !
is set here I assume the method doesn't accept nullable. So either we need to check for null before calling, or make the Init
method take null and deal with it later.
If we can't have Init
do its thing with null arguments, we should just check for those values here before we call and log in case we're not calling due to missing options.
Thanks for doing this @vaind |
Bringing sentry-native as a submodule which we can use to build native Linux and Windows.
Following install instructions from: https://docs.sentry.io/platforms/native/
Couldn't use the configuration listed there. Had to use
Release
.Needed to add Directory.Build.props tosrc/sentry-native
since CMake creates a.sln
which ends up finding our Unity.prop
files and fails to build due to not finding Unity installs. A possible solution for this that won't require changingsentry-native
itself is to add the submodules to a directory (such assrc/modules/sentry-native
) and add the empty .prop and .targets in the modules directory.Using crashpad means we need to distribute the game with the handler sitting next to it (or somehow provide the path to it when initializing the SDK).
Alternatively we can use a backend such as the Android SDK and use the .NET layer to pick up those envelopes and send it to Sentry.Also to figure out: We can't build and ship the package with building in a single CI agent now. We'll must build on Android + macOS and then assemble a package using bits taken from both builds.
Seems like assemblies such asSentry.Unity.Android
should be renamed to simplySentry.Android
since all they do is wrap our Android SDK without any Unity specific logic. Technically this code could be used by .NET Mobile in the future and made part of the core .NET SDK. NamingSentry.Unity.Native
for now but same here, should beSentry.Native
.