Skip to content

AndroidUseInterpreter should work in net6 #5633

Closed

Description

@joj

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).

Thanks!
J

Activity

  1. added this to the One .NET milestone on Feb 17, 2021
  2. jonathanpeppers commented on Feb 17, 2021

    @jonathanpeppers
    Member

    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) 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.

  3. self-assigned this
    on Feb 17, 2021
  4. lambdageek commented on Feb 17, 2021

    @lambdageek
    Member

    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.

  5. lambdageek commented on Feb 17, 2021

    @lambdageek
  6. jonathanpeppers commented on Mar 4, 2021

    @jonathanpeppers
    Member

    @lambdageek do we still need to do something on the MSBuild side when $(AndroidUseInterpreter) is true?

    Do we need debug.mono.runtime_args=--interp=-inline anymore?

  7. joj commented on Mar 4, 2021

    @joj
    MemberAuthor

    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.

  8. lambdageek commented on Mar 4, 2021

    @lambdageek
    Member

    There's two orthogonal issues:

    1. Is AndroidUseInterpreter usable with net6 now? Yes.
    2. 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)

  9. ghost locked as resolved and limited conversation to collaborators on Jun 3, 2022
  10. added
    enhancement
    on Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions