First steps for generating nuget packages for ARM64/Android.#10286
Conversation
|
Also tagging @gkhanna79 for review because of #6056 and #6000 |
| <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <SupportedPackageOSGroups>Linux;OSX</SupportedPackageOSGroups> | ||
| <SupportedPackageOSGroups>Linux;Android;OSX</SupportedPackageOSGroups> |
There was a problem hiding this comment.
Is there a reason you are enabling this here?
CC @jkotas
There was a problem hiding this comment.
Because Linux and OSX were enabled here. If it's not applicable I can remove; I'm basically working from PRs (see dotnet/core-setup#1651 Porting to New Platform References) and extrapolating based on refactored code so some of the edits may not be needed. Feel free to let me know and I'll make changes
There was a problem hiding this comment.
I think you can skip this file from the change.
| <RuntimeOS Condition="'$(RuntimeOS)' == ''">$(OSRid)</RuntimeOS> | ||
|
|
||
| <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Linux</SupportedPackageOSGroups> | ||
| <SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Android;Linux</SupportedPackageOSGroups> |
There was a problem hiding this comment.
What is the __DistroRid for Android build?
There was a problem hiding this comment.
android.21-arm64 and/or android.21-arm, unless there's a difference between RID as registered in CoreFX and __DistroRid?
Did some additional code parsing; will update this file with __DistroRid generation
There was a problem hiding this comment.
@gkhanna79 Not yet; still working out where __DistroRid originates and/or is generated and how to do so without uname or $ROOTFS_DIR/etc/os-release
Updated
|
@gkhanna79 The test hack I added to build.sh generates __DistroRid for Android build and, with following commits, allows package build for Android. I've added a TODO for figuring out a reliable way to generate __DistroRid for Android. Since I generated the commit changes from the `runtime.OS.filename.props files and guesswork, a once-over to make sure I haven't missed anything would be appreciated |
|
cc-ing @qmfrederik @mellinoe and @janvorli for additional visibility into package generation |
|
Also copying @schellap for input |
| export __DistroRid="" | ||
| #Test hack to generate __DistroRid for Android | ||
| #TODO Find reliable way to generate __DistroRid for Android. | ||
| export __DistroRid="android.21-arm64" |
There was a problem hiding this comment.
Just to be clear - we cannot commit with this change. Have you considered specifying this at command (e.g. __DistroRid=... ./build.sh) and then adding a check in this function if __DistroRid is already defined or not?
There was a problem hiding this comment.
IMHO, you need to save ANDROID_PLATFORM variable as a file when you build rootfs and then you can use it in building coreclr. :)
There was a problem hiding this comment.
@jyoungyun This may be better; so far I've tried every iteration of detecting __DistroRid in this function and all have failed except for ! [[ -n "$__DistroRid" ]], which is the same as hardcoding that value.
Would help if correct variable was specified at cmdline
There was a problem hiding this comment.
FYI, Walking back all changes to build.sh and going route @jyoungyun recommended. Too difficult getting logic check in initTargetDistroRid() to work without causing CI errors
| <SupportedPackageOSGroups>Linux;OSX</SupportedPackageOSGroups> | ||
| </PropertyGroup> | ||
| </Project> No newline at end of file | ||
| </Project> |
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <NativeBinary Include="$(BinDir)libcoreclr.so" /> | ||
| <NativeBinary Condition="'$(_PlatformDoesNotSupportNiFiles)' != 'true'" Include="$(BinDir)libcoreclrtraceptprovider.so" /> |
There was a problem hiding this comment.
This check is incorrect. _PlatformDoesNotSupportNiFiles should be used for platforms where we cannot generate NI images right now. They just happen to be same as where this binary does not build.
If you are able to build this for Android, please fix this check accordingly so that it can be included for that platform.
FYI - @hqueue @hseok-oh @jyoungyun
| <OfficialBuildRID Include="android.21-arm64"> | ||
| <Platform>arm64</Platform> | ||
| </OfficialBuildRID> | ||
| <OfficialBuildRID Include="android.21-arm"> |
There was a problem hiding this comment.
Have you tested the build for Arm32 for Android? If so, your change for __DsitroRid should account for it as well.
There was a problem hiding this comment.
I've only tested...and am only able to test...for arm64. I can add arm into this change but won't be able to test it.
There was a problem hiding this comment.
In that case, please undo the Android for Arm change.
| "description": "Specifies the OS to build Core_Root for", | ||
| "valueType": "property", | ||
| "values": [ "debian.8-x64", "fedora.23-x64", "opensuse.42.1-x64", "osx.10.12-x64", "rhel.7-x64", "ubuntu.14.04-x64", "ubuntu.16.04-x64", "ubuntu.16.10-x64" ], | ||
| "values": [ "debian.8-x64", "fedora.23-x64", "opensuse.42.1-x64", "osx.10.10-x64", "rhel.7-x64", "ubuntu.14.04-x64", "ubuntu.16.04-x64", "ubuntu.16.10-x64", "android.21-arm64", "android.21-arm" ], |
There was a problem hiding this comment.
I think you need to undo osx version change.
There was a problem hiding this comment.
That's odd…don't remember making that change. Fixed
|
Tagging @qmfrederik to review/ok addition to |
|
General question: I'm still getting up to speed with CI builds. Is there anything I need to do with the previous commits in this PR that have failed build checks if a later commit or commits are successful? |
|
@cydhaselton The change to Regarding to the CI builds, only the last commit matters. If the previous commits are no longer relevant, you can squash them, and they will disappear from the list of commits in this pull request. Would it be easier to treat Android as a Linux distribution? That would avoid the need to add a new OS group. |
I'm not sure; I'm still piecing together how nuget packages are generated. Since I don't know all of the places a) where it would be important to separate Android from Linux and b) where it wouldn't matter, I'm taking a "separate everything now, integrate with Linux after" approach. I can comment my code to that effect if it would help. |
|
Another (probably obvious) question: is there a way for me manually to re-run a CI build for a specific commit? |
|
@cydhaselton You can force the CI build to re-run, but only for the last commit in your PR. |
|
@gkhanna79 @jyoungyun and others…any other changes/additions I should make to this PR before merge? |
| export __DistroRid="$ID.$VERSION_ID-$__BuildArch" | ||
| fi | ||
| fi | ||
| fi |
| export __DistroRid="" | ||
| if [ -e $ROOTFS_DIR/android_platform ]; then | ||
| source $ROOTFS_DIR/android_platform | ||
| export __DistroRid="$RID" |
There was a problem hiding this comment.
I presume that $RID is being set by the source statement earlier,right? What is the value it gets?
There was a problem hiding this comment.
Nevermind - saw it further below.
| "description": "Specifies the OS to build Core_Root for", | ||
| "valueType": "property", | ||
| "values": [ "debian.8-x64", "fedora.23-x64", "opensuse.42.1-x64", "osx.10.12-x64", "rhel.7-x64", "ubuntu.14.04-x64", "ubuntu.16.04-x64", "ubuntu.16.10-x64" ], | ||
| "values": [ "debian.8-x64", "fedora.23-x64", "opensuse.42.1-x64", "osx.10.12-x64", "rhel.7-x64", "ubuntu.14.04-x64", "ubuntu.16.04-x64", "ubuntu.16.10-x64", "android.21-arm64", "android.21-arm" ], |
There was a problem hiding this comment.
Were you not planning to remove the "arm" entry?
There was a problem hiding this comment.
I did, but reverted when working on fixing initTargetDistroRid logic in build.sh and forgot to re-remove.
Fixed
| @@ -0,0 +1,6 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
There was a problem hiding this comment.
Thinking a bit more about this, why do you need to add these android specific files? Isn't the Linux version sufficient?
There was a problem hiding this comment.
I'm not sure; I'm still piecing together how nuget packages are generated. Since I don't know all of the places a) where it would be important to separate Android from Linux and b) where it wouldn't matter, I'm taking a "separate everything now, integrate with Linux after" approach.
I can remove the files and see if package build still works.
There was a problem hiding this comment.
@gkhanna79: So the build is successful, including packages, once packageTargetOsGroup for Android is removed from dir.props and conditionals added to Microsoft.NETCore.Runtime.CoreCLR.pkgproj
So my questions are:
- What elements distinguish one package group from another? Or: What factors determine the creation of a new OS group?
- Is it possible that a separate package group would be needed for Android in the future?
There was a problem hiding this comment.
Given that Android is sufficiently distinct, but still Linux based, I am fine if a new OS group for it is used while leveraging the existing Linux definitions of the components.
CC @chcosta
There was a problem hiding this comment.
Unfortunately, unless I'm missing something, packageTargetOSGroup means adding Android-specific runtime-prefixed files (runtime.Android...). Are you saying just to leave those files in or make changes so that Android has it's own OSGroup/packageTargetOSGroup but uses the Linux component defs?
There was a problem hiding this comment.
I think it's reasonable for Android to use the Linux _packageTargetOSGroup to import the runtime package imports
There was a problem hiding this comment.
@chcosta and @gkhanna79: Still not sure how to achieve what you are suggesting; if I create a packageTargetOSGroup for Android without adding the runtime.Android files package build fails. Is there another OS that does this that I could reference?
| </When> | ||
| <When Condition="'$(_runtimeOSFamily)' == 'android'"> | ||
| <PropertyGroup> | ||
| <PackageRID>android.21-$(ArchGroup)</PackageRID> |
There was a problem hiding this comment.
Should we have a check for arm64 since that is all we are supporting for now?
|
@gkhanna79 @qmfrederik and others; re-posting this question in general discussion for greater visibility. Code discussion here: So my questions are:
|
|
@dotnet-bot test OSX10.12 x64 Checked Build and Test (network) |
|
Also cc-ing @jkotas as per documentation; is there a person or persons that are responsible for the packaging subsystem that I should copy on this for feedback on the OS Group question? |
|
You have the right people copied on this already (@gkhanna79, @ericstj). |
|
Thanks, @jkotas. Would it be appropriate for me to update the CODE_OWNERS.TXT with that info? |
Removed extra space in initTargetDistroRid() logic
removed Android-specific runtime files for packaging added conditional to have Android use Linux runtime files
|
@gkhanna79 The above looks messy; did you mean "merge" instead of "rebase? EDIT: Followed git hints instead of running |
c44c5db to
25eef7d
Compare
|
What is looking messy? |
|
|
@dotnet-bot test Windows_NT x64 Debug Build and Test |
|
@gkhanna79, @ericstj and others…is there anything else that needs to be done for this PR? |
| "description": "Specifies the OS to build Core_Root for", | ||
| "valueType": "property", | ||
| "values": [ "debian.8-x64", "fedora.24-x64", "fedora.25-x64", "opensuse.42.1-x64", "osx.10.12-x64", "rhel.7-x64", "ubuntu.14.04-x64", "ubuntu.16.04-x64", "ubuntu.16.10-x64" ], | ||
| "values": [ "debian.8-x64", "fedora.23-x64", "fedora.25-x64", "opensuse.42.1-x64", "osx.10.12-x64", "rhel.7-x64", "ubuntu.14.04-x64", "ubuntu.16.04-x64", "ubuntu.16.10-x64", "android.21-arm64" ], |
There was a problem hiding this comment.
This change to fedora appears to be a bad merge.
| <When Condition="'$(_runtimeOSFamily)' == 'android'"> | ||
| <PropertyGroup> | ||
| <LibraryFileExtension>.so</LibraryFileExtension> | ||
| <!--symbols included in .so, like Linux, but can be generated externally and if so, uses .debug ext--> |
Fixed accidental fedora version change Fixed indenting
|
I've reviewed and commented on stuff that stuck out to me. I don't see anything else concerning. Most of these changes are around how coreclr decides to factor its package source which I don't have an opinion on so long as it produces the correct results. I'd like for @gkhanna79 or @chcosta to give explicit sign off on that. |
|
Thanks Eric. |
|
Polite re-ping to @gkhanna79 and @chcosta … is there anything I need to change in this PR before merge? |
| # TODO: replace with logic that generates RID based on $__ApiLevel and $__BuildArch | ||
| echo "Generating platform file..." | ||
|
|
||
| echo "RID=android.21-arm64" > $__ToolchainDir/sysroot/android_platform |
There was a problem hiding this comment.
Any reason not to address this TODO and use the ApiLevel / BuildArch here?
There was a problem hiding this comment.
@chcosta The TODO was addressed in previous commit by adding logic to build-android-rootfs.sh; I accidentally left the comment. Will remove comment and echo commands.
| </OfficialBuildRID> | ||
| </ItemGroup> | ||
| <ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Android;'))"> | ||
| <OfficialBuildRID Include="android.21-arm64"> |
There was a problem hiding this comment.
Do you want to include the Portable rid?
There was a problem hiding this comment.
@chcosta At this line? I don't think so…a quick check of master shows that the other supported OSs don;t include it at this point. Should it be?
@gkhanna79 Anything you see that needs changing?
There was a problem hiding this comment.
OfficialBuildRID is only used for platform targets that the official .NET Core build is going to support and we should add it only when we enable building for it. Otherwise, this is not required.
@cydhaselton Can you please undo this change for now?
There was a problem hiding this comment.
Out of town but will push change when I return.
|
Two additional comments, and then LGTM |
|
@dotnet-bot test Tizen armel Cross Debug Build |
|
@dotnet-bot test Windows_NT x64 Debug Build and Test |
|
@gkhanna79 and @chcosta are there any other changes needed for this PR? |
|
Thanks all. Ok to keep this branch around until I have time to write up documentation? |
Adds RIDS and related conditionals/variables to the appropriate files as part of Enabling Android/ARM64 for .NET Core (issue here).
Code appears to have been refactored since the original PR to which I was referred, cc-ing @janvorli and @qmfrederik for review in case of missed items