Add DisableSentryNative build property#4107
Conversation
DisableSentryNative build parameter
DisableSentryNative build parameterDisableSentryNative build property
@maxkatz6 the PR where @vaind added Your code is looking at a couple of different scenarios/variants within that, I imagine (when it's enabled/disabled). |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4107 +/- ##
==========================================
- Coverage 75.73% 73.58% -2.15%
==========================================
Files 357 445 +88
Lines 13466 16061 +2595
Branches 2671 3179 +508
==========================================
+ Hits 10198 11819 +1621
- Misses 2593 3425 +832
- Partials 675 817 +142 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jamescrosswell
left a comment
There was a problem hiding this comment.
LGTM.
Thank you so much for the PR @maxkatz6 ❤️
This PR adds a new
DisableSentryNativebuild property, allowing to opt-out from linking and using Sentry.Native on .NET 8+ builds. By default,DisableSentryNativeis false, so old behavior is kept unchanged.Two main changes of this PR:
DirectPInvoke/NativeLibraryare only set whenDisableSentryNativeis false.SentryNative.IsAvailablereturns false, ifDisableSentryNativewas set to true.Runtime switches (
RuntimeHostConfigurationOptionandAppContext.TryGetSwitch) were used to pass build property to the runtime library.FeatureSwitchDefinitionused should make this switch into a compile-time variable.Closes #4102
NOTE: while it should work, I haven't tested the build yet. Need to figure out how to prepare a local build with native bits and everything included.