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

Initial Android cross-compiler #43535

Merged
merged 218 commits into from
Jan 14, 2021
Merged

Initial Android cross-compiler #43535

merged 218 commits into from
Jan 14, 2021

Conversation

directhex
Copy link
Contributor

@directhex directhex commented Oct 16, 2020

  • Only works on Mac due to --host= value (we must pass a --host triplet when we pass --target, and need to infer the correct one to use). This will cause CI failures until fixed, as we only build the runtime on Linux in CI.
  • Audit the configure flags, I sorta guessed based on gluing together the AOT flags from iOS/WASM and the JIT flags from Android
  • Less brute-force approach to not using the same CFLAGS etc for "real" runtime as cross-compiler. This was a fast way to filter out things I didn't want without breaking iOS etc, but it's not elegant and will cause problems in the future
  • Move AOT building to a new subset, so we can do AOT-only builds (i.e. avoid doing full builds on Mac/Windows)
  • Add Windows version (i.e. Windows builds with vcxproj, we need a cross-compiler vcxproj)
  • Add Yaml for all the runtime builds (maybe a new yaml, rather than runtime.yml?)

jkoritzinsky and others added 30 commits June 23, 2020 17:12
@directhex
Copy link
Contributor Author

Green with correct nupkgs on internal https://dev.azure.com/dnceng/internal/_build/results?buildId=950402&view=results

@directhex
Copy link
Contributor Author

None of the remaining tests are related to stuff I've touched (and the one failure isn't my fault).

Anything more to add, @vargaz @safern @ViktorHofer @akoeplinger ?

Copy link
Member

@akoeplinger akoeplinger left a comment

Choose a reason for hiding this comment

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

Looks great, left a couple comments but nothing that should hold off merging this :)

displayName: Download AOT offset files
inputs:
artifact: Mono_Offsets_Android
path: '$(Build.SourcesDirectory)/artifacts/obj/mono/offsetfiles'
Copy link
Member

Choose a reason for hiding this comment

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

do we still need this here if it's already in global-build-job.yml?

- OSX_x64
- Linux_x64
jobParameters:
buildArgs: -s mono+libs+host+packs -c $(_BuildConfig)
Copy link
Member

Choose a reason for hiding this comment

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

do we really need the libs subset here?

jobTemplate: /eng/pipelines/mono/templates/generate-offsets.yml
buildConfig: release
platforms:
- Android_x64
Copy link
Member

Choose a reason for hiding this comment

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

maybe add a comment here that this will actually generate offsets for all platforms, not just x64.

jobTemplate: /eng/pipelines/mono/templates/generate-offsets.yml
buildConfig: release
platforms:
- Android_x64
Copy link
Member

Choose a reason for hiding this comment

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

same comment here

@@ -459,6 +475,34 @@ jobs:
eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true),
eq(variables['isFullMatrix'], true))

#
# Build Mono release Android AOT cross-compiler
# Only when mono changed
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Only when mono changed
# Only when mono or installer changed

<PropertyGroup>
<MonoLibClang Condition="'$(MonoLibClang)' == ''">$(XcodeDir)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib</MonoLibClang>
<MonoLibClang Condition="$([MSBuild]::IsOSPlatform('OSX')) and '$(MonoLibClang)' == ''">$(XcodeDir)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib</MonoLibClang>
Copy link
Member

Choose a reason for hiding this comment

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

we should probably use the libclang.dylib from the ANDROID_NDK_ROOT here too instead of the one from xcode.

@directhex directhex merged commit 48f4f29 into dotnet:master Jan 14, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Feb 13, 2021
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.

8 participants