[Xamarin.Android.Build.Tasks] Set UseMonoRuntime for Debug configuration#10662
[Xamarin.Android.Build.Tasks] Set UseMonoRuntime for Debug configuration#10662jonathanpeppers merged 2 commits intomainfrom
Conversation
jonathanpeppers
left a comment
There was a problem hiding this comment.
@simonrozsival do you have a .binlog to see if this works?
I'm wondering if $(Configuration) is blank at the point this file is imported.
| <_GetChildProjectCopyToPublishDirectoryItems>false</_GetChildProjectCopyToPublishDirectoryItems> | ||
| <_AndroidRuntime Condition=" '$(PublishAot)' == 'true' ">NativeAOT</_AndroidRuntime> | ||
| <_AndroidRuntime Condition=" '$(PublishAot)' != 'true' and '$(UseMonoRuntime)' == 'true' ">MonoVM</_AndroidRuntime> | ||
| <_AndroidRuntime Condition=" '$(PublishAot)' != 'true' and ('$(UseMonoRuntime)' == 'true' or '$(Configuration)' == 'Debug') ">MonoVM</_AndroidRuntime> |
There was a problem hiding this comment.
We could use $(AndroidDebugSymbols) as it works for any $(Configuration) that is setup to be "debuggable":
android/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Lines 301 to 322 in bb5968d
But the problem is ordering... This file runs after Microsoft.Android.Sdk.DefaultProperties.targets.
If this change is temporary, maybe this is fine for now.
|
@jonathanpeppers this is how I verified it locally: To further verify, I ran |
| <_GetChildProjectCopyToPublishDirectoryItems>false</_GetChildProjectCopyToPublishDirectoryItems> | ||
| <_AndroidRuntime Condition=" '$(PublishAot)' == 'true' ">NativeAOT</_AndroidRuntime> | ||
| <_AndroidRuntime Condition=" '$(PublishAot)' != 'true' and '$(UseMonoRuntime)' == 'true' ">MonoVM</_AndroidRuntime> | ||
| <_AndroidRuntime Condition=" '$(PublishAot)' != 'true' and ('$(UseMonoRuntime)' == 'true' or '$(Configuration)' == 'Debug') ">MonoVM</_AndroidRuntime> |
There was a problem hiding this comment.
Looking at the test failures, I think we need to add back:
<UseMonoRuntime Condition=" '$(UseMonoRuntime)' == '' and '$(Configuration)' == 'Debug' ">true</UseMonoRuntime>See: 0db0be1#diff-628edd03fba0cf01ff4a78cdc5386ce2b760725ac4a25589cf190ad88d5e5ac4L25-L26
And then undo the changes to $(_AndroidRuntime).
jonathanpeppers
left a comment
There was a problem hiding this comment.
We can ignore the test failures; I've been slowly trying to fix flaky tests over time.
This is a follow-up to #10527 which made CoreCLR the default runtime. We still need to use MonoVM in Debug mode until we have full debugger support.