Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
| { | ||
| logger.LogInfo("Switch native libraries found:\n{0}", | ||
| string.Join("\n", existingFiles.Select(f => $" - {f}"))); | ||
| importer.SetCompatibleWithPlatform(BuildTarget.Switch, false); |
There was a problem hiding this comment.
Switch native support flag ignored when libraries present
Medium Severity
When all required native library files are present, the nativeSupportEnabled parameter is ignored and the stub is always disabled. This means native libraries will be linked even when the user has explicitly set SwitchNativeSupportEnabled to false. The nativeSupportEnabled check only occurs in the else branch when files are missing, but the user's preference to disable native support is not respected when files exist.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| { | ||
| logger.LogError("Failed to get PluginImporter for stub at '{0}'. Skipping stub configuration.", stubPath); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Switch stub path may be incorrect
High Severity
SwitchNativePluginBuildPreProcess looks up the stub at Packages/.../Plugins/Switch/sentry_native_stubs.c, but the removed code previously used Packages/.../Plugins/sentry_native_stubs.c. If the stub file wasn’t actually relocated in the package layout, AssetImporter.GetAtPath returns null and stub compatibility never gets toggled, leading to missing symbols or unintended no-op native behavior on Switch.
| { | ||
| "Assets/Plugins/Sentry/Switch/libsentry.a", | ||
| "Assets/Plugins/Sentry/Switch/libzstd.a", | ||
| }; |
There was a problem hiding this comment.
Switch required files list incomplete
High Severity
RequiredFiles only checks for libsentry.a and libzstd.a, but Switch native support also depends on the helper functions used by SentryNativeSwitch (referenced in the stub comments as SentrySwitchHelpers.cpp). With only the archives present, the prebuild step can disable stubs and “accept” native support while the build still lacks required helper symbols.
| var logger = options?.DiagnosticLogger ?? new UnityLogger(new SentryUnityOptions()); | ||
|
|
||
| ValidateNativePlugin(logger, options?.PlayStationNativeSupportEnabled ?? true); | ||
| } |
There was a problem hiding this comment.
Native support defaults enabled when unconfigured
Medium Severity
All three preprocessors pass options?.<Platform>NativeSupportEnabled ?? true, which treats missing/failed SentryScriptableObject.LoadOptions as “native support enabled.” This can emit LogError messages about missing console native binaries in projects where Sentry isn’t configured (i.e., options is null), potentially causing noisy builds or CI failures that gate on editor errors.


Moving the stubs is a follow-up on the Switch support. Initially, I thought we'd reuse them for PlayStation and Xbox as well, but the native support on those platforms is provided via dynamic libs, degrading gracefully if not found. No need for stubs.
Instead, I've added a
PreBuildProcessfor each platform logging about the state of the configuration.#skip-changelog