Skip to content
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

Add Android build configurations for Mono/Libraries #33881

Merged
merged 11 commits into from
Mar 24, 2020

Conversation

akoeplinger
Copy link
Member

@akoeplinger akoeplinger commented Mar 20, 2020

This adds support for Android using the Mono runtime to the build system.

I'm only adding the build integration right now, CI support will be done separately.

@am11 I know this overlaps with some of your work on CoreCLR for Android but I tried to keep it mostly separate (we don't use the cross build logic here so CROSS_ROOTFS isn't set for us). It will probably need some changes and I'm happy to talk with how we should enable that in the future as our (Xamarin) goals are different in some areas.

Resolves #33687

Dynamically load the libicu from the system. Android NDK doesn't ship with icu headers so for now define prototypes for all the functions we use ourselves.
We still need to hook up the native System.Security.Native library.

Unblocks Xamarin.Forms startup.
# Conflicts:
#	eng/native/configuretools.cmake
#	src/libraries/Native/Unix/CMakeLists.txt
#	src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt
#	src/libraries/Native/Unix/System.Globalization.Native/configure.cmake
#	src/libraries/Native/Unix/System.Globalization.Native/pal_icushim.c
Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, as long as this: #33881 (comment) is resolved.

@akoeplinger
Copy link
Member Author

Failures are known issues: #33930 and #34045

@akoeplinger akoeplinger merged commit 0595477 into dotnet:master Mar 24, 2020
@akoeplinger akoeplinger deleted the add-android branch March 24, 2020 22:39
@steveisok steveisok mentioned this pull request Mar 24, 2020
24 tasks
@am11
Copy link
Member

am11 commented Mar 25, 2020

Thanks @akoeplinger, the status of build with eng/common/cross/build-android-rootfs.sh arm64 was not affected by this PR; all green. 👍

At some point, we can try to converge the few remaining differences and make build-android-rootfs.sh and toolchain.cmake work with build for Xamarin as well as other parts of runtime.

It would be great if we get CI coverage to preserve this good state. Maybe just compile native parts, skipping restore, managed components, tests and artifacts publishing etc. which today takes 7-10 minutes tops for coreclr, libraries and installer combined; including the creation of rootfs itself, which takes 1.5 to 2 minutes.

@akoeplinger
Copy link
Member Author

akoeplinger commented Mar 25, 2020

@am11 yes, @directhex will be working on setting up CI for our Android builds.

Regarding the build-android-rootfs.sh, our plan was to update the Docker images that are used on the CI pipeline to include the Android NDK so the dotnet/runtime build doesn't need to download it as part of the build.

The script is still useful for local developer builds though :)

@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable android build targets in dotnet/runtime
7 participants