-
Notifications
You must be signed in to change notification settings - Fork 555
ARM64_32 Debug Mode #7012
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
ARM64_32 Debug Mode #7012
Conversation
spouliot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set do-not-merge label since it depends on another PR, remove it once it's merged
rolfbjarne
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're targeting themono-2019-08 branch, but we've already merged that branch into master (so you can target master directly with your PR`).
tools/mtouch/mtouch.cs
Outdated
| case ApplePlatform.WatchOS: | ||
| return Path.Combine (cross_prefix, "bin", "armv7k-unknown-darwin-mono-sgen"); | ||
| /* Use arm64_32 cross only for Debug mode */ | ||
| if (app.IsArchEnabled (Abi.ARM64_32) && !app.EnableLLVMOnlyBitCode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong: when building for both armv7k and arm64_32 this if condition will be true when building for either architecture, not only arm64_32.
The function doesn't have the information it needs, it needs to be passed the Abi as wells.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, thanks! Right, because MtouchArch can be set to ARMv7k, ARM64_32. However MtouchExtraArgs cannot be set separately; --interpreter will not work for ARMv7k.
In terms of user experience, any suggestion what we should do here? Maybe do not require the user to set --interpreter explicitly in MtouchExtraArgs, but force it in mtouch when ARM64_32 + Debug Mode is detected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force it in
mtouchwhenARM64_32+Debug Modeis detected
I think this would be the best option for customers, but I think we'd want to emit a warning in this case explaining what we're doing (I don't like silently changing behavior), and explain that it's possible to get the normal AOT compiler by disabling Debug mode in the Debug configuration (I'm assuming that actually works).
That said, this won't be a problem if customers have device-specific builds turned on (which iirc is on by default in new projects).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"normal" AOT aka. FullAOT for arm64_32 doesn't work currently, hence the interpreter. It would only be needed for Debug Mode (even when the managed debugger is disabled), but since we can use the interpreter there, I'm not sure if we will ever need to do the work to support FullAOT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"normal" AOT aka.
Right now people can use Debug mode and it works, except that you can't debug. My concern is that if someone runs into a bug in the interpreter, they should be able to stop using the interpreter somehow so that the app runs correctly on the watch, even though debugging doesn't work (they could at least use Console.WriteLines).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, FullAOT does not work at all for arm64_32 currently 😕
|
Build success |
ace9798 to
d55dc20
Compare
|
Build failure |
|
Build success |
d55dc20 to
f9dc6ea
Compare
tools/mtouch/mtouch.cs
Outdated
| } else { | ||
| if (app.Platform == ApplePlatform.WatchOS && app.IsArchEnabled (Abi.ARM64_32)) { | ||
| if (app.IsArchEnabled (Abi.ARMv7k)) { | ||
| throw ErrorHelper.CreateError (99, "Please use device builds on WatchOS."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't manage to disable device-specific builds, but I believe this would be the condition.
Also: To what does the error code map to? Is there some guideline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mtouch error codes are listed and documented here: https://github.com/xamarin/xamarin-macios/blob/master/docs/website/mtouch-errors.md#mt0142-cannot-find-the-assembly-assembly-passed-as-an-argument-to---interpreter
it looks like the next available code would be 143.
Also you're not checking for debug mode here, so this will trigger for release builds as well.
tools/mtouch/mtouch.cs
Outdated
| if (app.IsArchEnabled (Abi.ARMv7k)) { | ||
| throw ErrorHelper.CreateError (99, "Please use device builds on WatchOS."); | ||
| } else { | ||
| ErrorHelper.Warning (99, "ARM64_32 Debug mode requires --interpreter[=all], forcing it."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To what does the warning code map to? Is there some guideline?
f9dc6ea to
b2f901d
Compare
|
Build success |
|
Build failure |
75eced9 to
c373abe
Compare
|
Build failure 🔥 Build failed 🔥 |
|
build |
|
Build success |
|
Leaving a papertrail here:
This is in |
Depends on mono/mono#16886
Contributes to mono/mono#10641