-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim and AOT warnings in Delegates and PerTypeHelpers #72
Comments
- Check IsDynamicCodeSupported in Delegates.GetGetter before trying to create a DynamicMethod - Check IsDynamicCodeSupported in PerTypeHelpers before trying to MakeGenericType, which can fail for value types in NativeAOT. Fix mgravell#72
- Check IsDynamicCodeSupported in Delegates.GetGetter before trying to create a DynamicMethod - Check IsDynamicCodeSupported in PerTypeHelpers before trying to MakeGenericType, which can fail for value types in NativeAOT. Fix mgravell#72
So; you're absolutely right about the allocater thing; that was... just bad code, very embarrassing. I'm torn now; do I fix it, or do I deprecate the scenario on the basis that it has literally never worked, so... does it matter? but now I need to go check "are we relying on that pin", because if we are: GODAMMIT on the delegates thing: no additional change should be required - it already handles the "no field" scenario I've added a work-in-progress tidy up that also adds an AOT smoke test project: #74 I'm going to see whether SE.Redis relies on that flag before deciding how to proceed on the allocator thing |
- Check IsDynamicCodeSupported in Delegates.GetGetter before trying to create a DynamicMethod - Check IsDynamicCodeSupported in PerTypeHelpers before trying to MakeGenericType, which can fail for value types in NativeAOT. Fix #72
reopening to continue discussion; initial fixes: look good and merged |
SE.Redis doesn't use the |
In trying to use
Microsoft.Extensions.Caching.StackExchangeRedis
in a Native AOT app (see dotnet/aspnetcore#45910), I'm getting the following warnings from these two places:Pipelines.Sockets.Unofficial/src/Pipelines.Sockets.Unofficial/Delegates.cs
Lines 37 to 58 in f044f67
This looks simply like we can just check for
RuntimeFeature.IsDynamicCodeSupported
and fallback to reflection when it isn't supported. But the bigger issue is that_invocationList
and_invocationCount
don't appear to be fields of MulticastDelegate in Native AOT: https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/System.Private.CoreLib/src/System/MulticastDelegate.cs. So I'm not sure how to fix this.Pipelines.Sockets.Unofficial/src/Pipelines.Sockets.Unofficial/Arenas/PerTypeHelpers.cs
Lines 13 to 47 in f044f67
Maybe these can be wrapped in
RuntimeFeature.IsDynamicCodeSupported
? I'm a bit confused by this code because it isn't actually returning the result of invoking those properties through reflection.cc @mgravell
The text was updated successfully, but these errors were encountered: