-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
XmlSerializer tries to use Reflection.Emit even if RuntimeFeature.IsDynamicCodeSupported is false #59167
Comments
@marek-safar Do we need an issue making sure we run libraries tests with the interpreter disabled? This feels like something that should have been caught in libs tests. |
@eerhardt could you help with getting this fixed for 6.0? @MichalStrehovsky I agree that ideally this should be uncovered in libraries AOT mode run but right now we can run only the runtime tests in this mode. Running all libraries tests under AOT won't be trivial as there is a lot of tests and a lot of assumptions to fix. /cc @SamMonoRT |
We have a fix for this in the NativeAOT experiment that worked fine for us so far. Look for the XmlSerializer.cs delta in dotnet/runtimelab@runtime-main...feature/NativeAOT |
Looking now. |
Looks like I can port the changes of XmlSerializer from runtimelab / NativeAOT to runtime. My biggest question is: how can I test this to ensure it works? @rolfbjarne - Do you have instructions on how to run your test that is failing? So I can ensure my change fixes it? |
Add more checks to XmlSerializer to check the SerializationMode. Don't try to use Reflection.Emit if the SerializationMode is ReflectionOnly. These changes were ported from * dotnet/runtimelab#593 * dotnet/runtimelab#600 Fix dotnet#59167
@eerhardt AFAIK the only way to be sure this works is to actually run in a FullAOT scenario (i.e. on an iOS device), but I don't know how to make that happen inside dotnet/runtime (I'm guessing there already are FullAOT tests somewhere in dotnet/runtime?) |
@imhameed - please can you verify if the newly enabled FullAOT lane has similar tests running ? |
* XmlSerializer support for IsDynamicCodeSupported=false Add more checks to XmlSerializer to check the SerializationMode. Don't try to use Reflection.Emit if the SerializationMode is ReflectionOnly. These changes were ported from * dotnet/runtimelab#593 * dotnet/runtimelab#600 Fix #59167 * Fix a bug in XmlSerializer.CanDeserialize when in ReflectionOnly mode. * Port UAP code for CanDeserialize * PR feedback * Add a linker test to ensure linker option '--enable-opt sealer' works when IsDynamicCodeSupported==false.
Add more checks to XmlSerializer to check the SerializationMode. Don't try to use Reflection.Emit if the SerializationMode is ReflectionOnly. These changes were ported from * dotnet/runtimelab#593 * dotnet/runtimelab#600 Fix #59167
Re-opening to backport to 6.0. |
…lse (#59507) * XmlSerializer support for IsDynamicCodeSupported=false Add more checks to XmlSerializer to check the SerializationMode. Don't try to use Reflection.Emit if the SerializationMode is ReflectionOnly. These changes were ported from * dotnet/runtimelab#593 * dotnet/runtimelab#600 Fix #59167 * Fix a bug in XmlSerializer.CanDeserialize when in ReflectionOnly mode. * Port UAP code for CanDeserialize * PR feedback * Add a linker test to ensure linker option '--enable-opt sealer' works when IsDynamicCodeSupported==false. Co-authored-by: Eric Erhardt <[email protected]>
Description
We have a test case that fails with when
IsDynamicCodeSupported=false
(when executing in a FullAOT scenario on an iOS device):the actual test failure message is misleading: the problem is that
RuntimeFeature.IsDynamicCodeSupported
is false, so XmlSerializer shouldn't try to use Reflection.Emit in the first place.Configuration
.NET RC 1
Regression?
With regards to legacy Xamarin.iOS: yes.
The text was updated successfully, but these errors were encountered: