You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In .net4 AndroidUseInterpreter used to switch the runtime directory with one that includes an "-interpreter" suffix. That would automatically make the runtime use the interpreter. For net6, the runtime includes both versions in the package, and the way to switch interpreter on is to add this environment variable: debug.mono.runtime_args=--interp=-inline
The parameter is at the moment unchanged for net6, meaning that it adds a prefix that doesn't work anymore, and it doesn't do the environment, which is needed. The ask is to switch to that and then make sure interpreter works (that may require some help from mono runtime).
Basically emit some extra @(AndroidEnvironment) lines for .NET 6 when $(AndroidUseInterpreter) is true.
An additional work item would be to standardize on an MSBuild property for both iOS/Android, as $(MTouchExtraArgs) is used for enabling the interpreter at the moment.
I tried AndroidUseInterpreter and it "works" in that the runtime tries to start up with interp support, but it breaks because it passes MONO_AOT_MODE_LAST which used to work with old mono, but not net6 mono.
I'm working on a PR to update to use MONO_AOT_MODE_INTERP_ONLY (on top of #5632)
Edit
The relevant runtime changes were to fix mono/mono#18893 - which was done in mono/mono#20159 - that PR went into dotnet/runtime master but not into mono/mono 2020-02. So the update to use MONO_AOT_MODE_INTERP_ONLY will be net6-only.
Can we make AndroidUseInterpreter opt out (meaning, default to true when debugging)? What do you think? That will enable these new functionalities by default, and allow users to turn it off if it's causing problems.
Is AndroidUseInterpreter usable with net6 now? Yes.
Should something more be done to enable hot reload and other experiences in Debug configurations? Also yes, but I don't think it should be controlled by AndroidUseInterpreter or by changing defaults. We talked about having some property that indicates that hot reload is needed. @StephaneDelcroix
(On the runtime side I will be implementing support for the new DOTNET_MODIFIABLE_ASSEMBLIES environment variable setting dotnet/runtime#47274 which will obviate the need to explicitly turn off inlining with environment variables. But obviously the new env var will need to be set)
Activity
jonathanpeppers commentedon Feb 17, 2021
This would be adding some new logic to:
https://github.com/xamarin/xamarin-android/blob/214dd76d9441c9974775f0b29feec0d5d8d1097f/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets#L1503-L1518
Basically emit some extra
@(AndroidEnvironment)lines for .NET 6 when$(AndroidUseInterpreter)istrue.An additional work item would be to standardize on an MSBuild property for both iOS/Android, as
$(MTouchExtraArgs)is used for enabling the interpreter at the moment.lambdageek commentedon Feb 17, 2021
I tried
AndroidUseInterpreterand it "works" in that the runtime tries to start up with interp support, but it breaks because it passesMONO_AOT_MODE_LASTwhich used to work with old mono, but not net6 mono.I'm working on a PR to update to use
MONO_AOT_MODE_INTERP_ONLY(on top of #5632)Edit
The relevant runtime changes were to fix mono/mono#18893 - which was done in mono/mono#20159 - that PR went into dotnet/runtime
masterbut not into mono/mono 2020-02. So the update to useMONO_AOT_MODE_INTERP_ONLYwill be net6-only.lambdageek commentedon Feb 17, 2021
[net6] use MONO_AOT_MODE_INTERP_ONLY
[net6] use MONO_AOT_MODE_INTERP_ONLY
[net6] use MONO_AOT_MODE_INTERP_ONLY
[net6] use MONO_AOT_MODE_INTERP_ONLY
[net6] use MONO_AOT_MODE_INTERP_ONLY
[monodroid] Use MONO_AOT_MODE_INTERP_ONLY when available (#5635)
jonathanpeppers commentedon Mar 4, 2021
@lambdageek do we still need to do something on the MSBuild side when
$(AndroidUseInterpreter)istrue?Do we need
debug.mono.runtime_args=--interp=-inlineanymore?joj commentedon Mar 4, 2021
Can we make AndroidUseInterpreter opt out (meaning, default to true when debugging)? What do you think? That will enable these new functionalities by default, and allow users to turn it off if it's causing problems.
lambdageek commentedon Mar 4, 2021
There's two orthogonal issues:
(On the runtime side I will be implementing support for the new DOTNET_MODIFIABLE_ASSEMBLIES environment variable setting dotnet/runtime#47274 which will obviate the need to explicitly turn off inlining with environment variables. But obviously the new env var will need to be set)