sentry-unity
sentry-unity copied to clipboard
WebGL build fails when sentry has been added
Environment
OS: Windows 10 22H2
How do you use Sentry? self-hosted/on-premise 23.2.0
Which version of the SDK? 2.0.1
How did you install the package? (Git-URL, Assetstore) Git-URL in package-manager
https://github.com/getsentry/unity.git#2.0.1
Which version of Unity? 2021.1.28f1
Is this happening in Unity (editor) or on a player like Android, iOS, Windows? In editor while building for WebGL
Steps to Reproduce
- New 2021.1.28f1 unity project with 3D URP template
- Switch to WebGL build
- Enable development build in build settings (not 100% sure this is required, did have builds fail without)
- Install sentry via package manager
- Configuring DSN or not makes no difference
- Enabling Sentry or disabling makes no difference
- Build
- Build fails with error (see below)
- Remove sentry package
- Build
- Build succeeds
Expected Result
I expected the build to succeed as i could not find any information on a minimal unity version or webgl not being supported.
Actual Result
Build fails with: ` Exception: Failed running C:\Program Files\Unity\Hub\Editor\2021.1.28f1\Editor\Data\il2cpp\build/deploy/netcoreapp3.1/UnityLinker.exe @C:/_REPOS/unity-sentry-repro/Temp/StagingArea/Data/Managed/response.rsp
stdout: Fatal error in Unity CIL Linker System.ArgumentException: Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: ''. at System.Collections.Generic.IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(Object comparer) at System.Collections.Generic.GenericArraySortHelper1.Sort(T[] keys, Int32 index, Int32 length, IComparer1 comparer) at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer1 comparer) at System.Collections.Generic.List1.Sort(Int32 index, Int32 count, IComparer1 comparer) at Mono.Linker.LinkContext.FlushCachedWarnings() at Unity.Linker.UnityDriver.UnityRun(ILogger customLogger) at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger) at Unity.Linker.UnityDriver.RunDriver() `
Any logs or screenshots
Thanks for raising this and providing the build logs. We'll try to reproduce this locally. It's an odd place to break tho.
I tested different versions of the sdk and oddly enough i can now make builds using the same project i created for the reproduction steps. I tested version 1.8.0, 2.0.0 and 2.0.1 and they all worked for some reason. (even with dev-build enabled)
I then created a new unity project (2021.1.28f1 with 3D URP) and the build only worked with v1.8.0 but not with v2.0.0 or v2.0.1, but after restarting the unity editor the build with v2.0.1 succeeded, even though i was pretty sure that i tried this in the first repro and it didn't work.
So i created another new project, same as before, where i tested this again but this time i wasn't able to do a dev-build with v2.0.0 or v2.0.1 even after a restarting the editor.
To summarize, i have no idea why the builds are failing and succeeding so seemingly randomly. In my tests v1.8.0 worked 100% of the time and making a new project, at least for me, adding sentry v2.0.1 and enabling dev build will result in a fail every time.
Thanks for doing all that digging!
Hey @RustyPrime! Is it possible for you to update your Unity version? From the testing @munkiki7 did it looks like this is fixing "itself" by updating.
Hey @RustyPrime! Is it possible for you to update your Unity version? From the testing @munkiki7 did it looks like this is fixing "itself" by updating.
Sadly not, we are currently hardstuck using that version because of other bugs (unrelated to sentry) that occur when upgrading that we would need to fix first. Until we do, i suppose we will just not be using sentry in webgl builds.
Sorry to not be able to help you out here. Please feel free to re-open this if you're running into problems in a more current version of Unity.