Open eerhardt opened 1 year ago
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: https://github.com/mgravell/Pipelines.Sockets.Unofficial/pull/74
I'm going to see whether SE.Redis relies on that flag before deciding how to proceed on the allocator thing
reopening to continue discussion; initial fixes: look good and merged
SE.Redis doesn't use the Delegates
helper or the flags, so: no urgency on resolving those I'm going to merge my fixes "as is" for now, and see if we can get a step further (we seem to be actively discussing it, let's finish that conversation first)
In trying to use
Microsoft.Extensions.Caching.StackExchangeRedis
in a Native AOT app (see https://github.com/dotnet/aspnetcore/issues/45910), I'm getting the following warnings from these two places:https://github.com/mgravell/Pipelines.Sockets.Unofficial/blob/f044f671282603407b0ec306feb8e11556717492/src/Pipelines.Sockets.Unofficial/Delegates.cs#L37-L58
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.https://github.com/mgravell/Pipelines.Sockets.Unofficial/blob/f044f671282603407b0ec306feb8e11556717492/src/Pipelines.Sockets.Unofficial/Arenas/PerTypeHelpers.cs#L13-L47
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