Add RIDs for Android#16729
Conversation
|
@cydhaselton, It will cover your contributions to all Microsoft-managed open source projects. |
|
Hi @cydhaselton I only now see you've also opened a PR for this, we must have been working on this at the same time. Quick question - I see you didn't inherit from Linux (although Android uses the Linux kernel) and created RIDs for MIPS Android & x64 Android, but not arm nor arm64. So I guess in a way the PRs are complimentary. Any reason you left out arm and arm64? As to API level 22 and 23, I don't think they are needed at this moment, since there are no CoreFX/CoreCLR builds specific to those API levels. |
|
Hey @qmfrederik I was thinking that, while Android is based off of Linux, it has significant enough differences that making it inherit from Linux would be problematic. That said, I'm not familiar with the RID component; would making Android inherit from Linux break anything? The android-x64 RID was supposed to be for arm64; I've pushed a commit to change this so it's clear. |
|
@cydhaselton, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request. |
|
@cydhaselton Well, I think Android is similar to Alpine in that matter - both use the Linux kernel, but have a very different userspace (like the C library being used), breaking ABI compatibility with most other Linux-based OSes. Because Alpine is marked as Linux, I think Android should also be marked as such. In the end, it'll be up for the .NET team to make a decision on that one. |
| "android-arm64": { | ||
| "#import": [ "any" ] | ||
| }, | ||
| "android-mips": { |
There was a problem hiding this comment.
We haven't done any work for MIPS, have we? It's probably not worth adding unless there's a real commitment to getting that working.
There was a problem hiding this comment.
Correct, no work has been done for MIPS that I'm aware of. (Some) work has been done for ARM, so I'd suggest replacing MIPS with arm.
|
This is related to the discussion over in https://github.com/dotnet/coreclr/issues/9208. Right now, the "linux-x64" rid is being used for our glibc-based portable binaries.
Actually, it looks like we've decided that Alpine should be changed. In that case, let's leave this as-is for now. Perhaps @Petermarcu has some thoughts. |
| "#import": [ "android.21", "android-mips" ] | ||
| }, | ||
|
|
||
| "android.22": { |
There was a problem hiding this comment.
Similarly, no work has been done for API level (versions) other than 21, so I'm not sure it makes sense to add RIDs for those versions new.
There was a problem hiding this comment.
That also sounds reasonable to me. How different / incompatible are the different versions, though? If there's very minimal work to get them working after API level 21, then there's not much harm in adding them now. MIPS on the other hand sounds like a much more niche thing that we might not end up doing anytime soon. Disclaimer: I know little about Android API levels or Android hardware in general.
There was a problem hiding this comment.
From an ABI point of view, the different versions are very backwards compatible. The package management system we've used to cross-compile for Android, Termux, only compiles for API level 21 at this moment - and you can take those binaries and run them up to API level 25, which is the most recent version available.
So I'm thinking we should either add API level 21 through 25, or only 21.
I don't know where MIPS comes from - I think the idea was to add arm.
At this time, CoreCLR supports x86, x64, arm and arm64 - there is no support for MIPS on any platform. Adding MIPS support would, amongst others, require porting assembly code to MIPS, I don't think anyone is working on it.
Net, I would suggest:
- Replacing MIPS with arm
- Adding only API level 21, or 21 through 25.
There was a problem hiding this comment.
As for porting to MIPS, the asm code and PAL would be the easiest part. JIT would be the largest and most complex beast in that case.
There was a problem hiding this comment.
@qmfrederik is right, the APIs are backwards compatible but there are some breaking changes when moving forward through the API levels. For example position-independent executables is enforced for dynamically-linked exes in API-21.
I vaguely recall a post in which MIPS was mentioned as a valid Android processor; if no one is actively working on it it can be removed.
To sum up:
- Add API level 25, remove 21-23
- replace MIPS with arm
There was a problem hiding this comment.
I would keep API level 21 as the baseline - .NET Core will work on API level 21 so I would include it in the runtime.json file. You could add 22, 23, 24 and 25 as well.
Apart from remove MIPS, I would also add ARM. (so you'll have both arm and arm64).
I think the best way forward would be to update the PR, the discussion will be more tangible once I see the updated files.
There was a problem hiding this comment.
Will do; just need to fix push after enabling two-factor
|
@mellinoe and/or @qmfrederik: Based on the referenced #9208, should the RID format be changed to something like |
|
|
||
| "android.21": { | ||
| "#import": [ "android" ] | ||
| }, |
We haven't really decided what things will look like for non-glibc Linuxes, although I think we will land on something similar to what you described. Having these inherit from "any" is okay for now. |
|
@cydhaselton I also notice that the commit author doesn't match your GitHub account. Could you fix that? |
(corrected authoring info)
e6039d7 to
e2be12a
Compare
| "#import": [ "any" ] | ||
| }, | ||
| "android-arm64": { | ||
| "#import": [ "any" ] |
There was a problem hiding this comment.
I think the spacing is still off. You should indent the "#import" node, like on line 11. I think the previous feedback was about you using tabs instead of spaces.
There was a problem hiding this comment.
Well this is embarrassing.
Removed tabs and re-pushed. If spacing still isn't correct I'll review using a different editor
cydhaselton
left a comment
There was a problem hiding this comment.
sigh
Missed one…fixing
|
@qmfrederik or @mellinoe, can you provide a second set of eyes on (hopefully) last commit before merge? |
|
Looks good to me. Excited to see the progress on this 😄 |
Add RIDs for Android Commit migrated from dotnet/corefx@125bc42
This PR introduces new RIDs for Android in preparation for bringing up cross-compilation setup in core-setup. It covers next steps mentioned here, and used references from the .NET Core Guide
Tagging @qmfrederik for feedback on appropriate RID naming.