Skip to content

Initial Android cross-compiler#43535

Merged
directhex merged 218 commits intodotnet:masterfrom
directhex:android-cross
Jan 14, 2021
Merged

Initial Android cross-compiler#43535
directhex merged 218 commits intodotnet:masterfrom
directhex:android-cross

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


#
# 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