Repository navigation
chore(deps): update .NET SDK to v7.1.0 - #2967
Draft
bitsandfoxes wants to merge 10 commits into
Draft
bitsandfoxes wants to merge 10 commits into
bitsandfoxes wants to merge 10 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
sentry-unity is still on sentry-dotnet 6.12.1. Newer .NET SDK features, such as the session replay hook in sentry-dotnet 7.1 (getsentry/sentry-dotnet#5990), can't reach Unity until it builds against 7.x. sentry-dotnet 7.0 removed or hid APIs that sentry-unity and its users rely on, so moving the submodule alone doesn't build. One of them,
SentryOptions.EnableLogs, was the master switch behind Unity's structured logs, while the Godot and Unreal SDKs already pick logs per log type, with no master switch.How
src/sentry-dotnetpoints at sentry-dotnet 7.1 from main, plus one commit that addsSentry.Unity.Native.PlayStation,.Switch,.Xboxand.Androidto theInternalsVisibleTolist inSentry.Unity.props.global.jsonfollows the submodule to .NET SDK 11.0.100.Structured logs work per log type, as in the Godot and Unreal SDKs:
CaptureStructuredLogsForLogTypeare off by default.SentryUnityOptions.EnableLogsandScriptableSentryUnityOptions.EnableStructuredLoggingare[Obsolete]and have no effect, so code that sets them still compiles, with a warning that points to the per-type options.SentrySdk.Loggerare always sent, andSetBeforeSendLogdrops them. Its doc comment now says so.Minified Android builds get all of the Unity SDK's options applied to the Android SDK at runtime start. The ProGuard rules keep
SentryOptions$Logs, so the call that enables logs no longer fails and stops the options after it (screenshots, automatic session tracking, activity lifecycle and user interaction breadcrumbs, user interaction tracing) from being turned off.The CHANGELOG's Breaking Changes section lists the APIs 7.x removed or hid, each with its replacement:
Scope.Release/Distribution,ApplyDefaultTags,EnableMetrics,EnableLogs, andScopeObserver/EnableScopeSync/CrashedLastRun. It also covers the logging changes above.Sentry.Unity.Native.csprojcompilesSentryNative.csagain into a separate assembly for each console and for Android. 7.x madeCrashedLastRuninternal andScopeObserver/EnableScopeSyncprotected internal, so those assemblies need theInternalsVisibleToentries to set them.NativePropagationContexttakes the scope parameter that 7.x added toIExternalPropagationContext.GetDynamicSamplingContext, and passes it on when it builds the sampling context. The old switch's serialized value is read into a hidden "migrated" flag: an asset where it was off has its toggles turned off on load and the flag set, so the migration runs once per asset, and new assets start migrated.Caveats
unity/internals-visible-to-native-platforms. It has to be merged into getsentry/sentry-dotnet before this PR merges. Once it merges, the submodule moves to the merged commit.EnableLogs, so it sends noDebug.Logstructured logs and adds breadcrumbs for warnings, asserts and errors again. Its checks cover only the logs and breadcrumbs it sends itself.