Closed bitsandfoxes closed 2 years ago
@bitsandfoxes
System.Runtime.CompilerServices.Unsafe.dll
internally? if so what version?also what does this mean https://unity3d.com/unity/beta/2022.1.0b16
IL2CPP: Use intrinsics for System.Runtime.CompilerServices.Unsafe methods.
- does unity explicitly use
System.Runtime.CompilerServices.Unsafe.dll
internally? if so what version?
I found a couple of those inside the installation:
./2022.1.0b15/Unity.app/Contents/Tools/ScriptUpdater/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/Tools/netcorerun/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/DotNetSdkRoslyn/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/MonoBleedingEdge/lib/mono/msbuild/Current/bin/Roslyn/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/MonoBleedingEdge/lib/mono/net_4_x-linux/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/MonoBleedingEdge/lib/mono/net_4_x-win32/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/MonoBleedingEdge/lib/mono/4.5/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/MonoBleedingEdge/lib/mono/net_4_x-macos/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/NetCoreRuntime/shared/Microsoft.NETCore.App/5.0.3/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/il2cpp/build/deploy/System.Runtime.CompilerServices.Unsafe.dll
./2022.1.0b15/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/System.Runtime.CompilerServices.Unsafe.dll
The one that jumped at me was ./2022.1.0b15/Unity.app/Contents/il2cpp/build/deploy/System.Runtime.CompilerServices.Unsafe.dll
that's in there in version 5.0.0.0
- i wonder if unity has some hard coded string type checking that looks for "System.Runtime.CompilerServices.Unsafe". do u know where we could find this?
I don't know. I do know that we had an issue where if we were to build the SDK with the TargetFramework netstandard2.1
the Memory.dll we'd bring would conflict with with the one that Unity ships with.
also what does this mean https://unity3d.com/unity/beta/2022.1.0b16
IL2CPP: Use intrinsics for System.Runtime.CompilerServices.Unsafe methods.
When I see intrinsics
in context of Unity I would think it's about that: https://blog.unity.com/games/updated-guide-for-using-neon-intrinsics-in-unity-burst
Pasting the current status here for anyone who's following
https://github.com/getsentry/sentry-unity/pull/765#issuecomment-1148569378 We've got a response from Unity: They are looking into it and are keen to fix this.
Is there a workaround in the meantime? I'm exploring building with IL2CPP and 2022.1 (for the sake of line numbers in stack traces) and I'm running into this exact issue.
Unfortunately, short of building the SDK yourself, I currently don't see a workaround. We've got the issue open with Unity and it looks like they are actively working on it: https://issuetracker.unity3d.com/issues/il2cpp-build-fails-when-using-an-assembly-renamed-via-sentrys-assembly-alias-tool
Additionally, we're currently working on providing line numbers ourselves which looks like should work down to Unity 2020.3.
Any update from Unity on this one? I see there's no update on their bug tracker though: https://fogbugz.unity3d.com/default.asp?1419859_qmt0m8hc0mpc1mc5
We're basically waiting for a new version and one of the boxes to go green: https://issuetracker.unity3d.com/issues/il2cpp-build-fails-when-using-an-assembly-renamed-via-sentrys-assembly-alias-tool
Even though the fix is still shown as in review for 2022.1.12f1, the release just now dropped, and contains the fix inside the release notes: https://unity3d.com/unity/whats-new/2022.1.12
IL2CPP: Fixed IL2CPP build failure when using Unbox instruction with generic by reference return type. (UUM-5942)
@moonshinebot oh this is awesome! I didn't get around to checking the release notes yet, thanks for letting us know!
Happy to confirm: The package now works with Unity 2022 and we've added it to CI to keep track of it: https://github.com/getsentry/sentry-unity/pull/927
Building an IL2CPP build with the aliased Sentry package installed results in: The build works fine when using the un-aliased Sentry package.
This is the generated method in question:
The issue has been raised with Unity and can be tracked here: https://fogbugz.unity3d.com/default.asp?1419859_qmt0m8hc0mpc1mc5 Since we're aliasing the DLLs but the IL remains valid and it seems to be related to Unity's new
Il2CppFullySharedGenericAny
feature we hope this can be resolved by the IL2CPP team.I've appended a minimal repro that contains a link.xml (to keep the Unsafe.dll from being stripped) and the aliased Unsafe.dll 2022_1.zip