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

Enable Android Platforms by default for Android-related builds #19726

Closed
wants to merge 1 commit into from

Conversation

katre
Copy link
Member

@katre katre commented Oct 4, 2023

Fixes #16285.

RELNOTES: Enable Platforms and Toolchains for Android. Android projects will need to stop passing the legacy flag --fat_apk_cpu, and instead use --android_platforms using platforms defined with the @platforms//os:android constraint. The https://github.com/bazelbuild/rules_android repository defines four standard Android platforms for projects that use those rules, @rules_android//:armeabi-v7a, @rules_android//:arm64-v8a, @rules_android//:x86, @rules_android//:x86_64.

Blog post describing these changes to follow.

@katre katre force-pushed the enable-android-platforms branch 3 times, most recently from 94989cb to 350c951 Compare October 10, 2023 17:08
@katre katre added this to the 7.0.0 branch cut milestone Oct 10, 2023
@katre
Copy link
Member Author

katre commented Oct 10, 2023

Ran downstream tests, identified several types of failures:

  • Hard bazel crashes
    • Looks like an NPE in AndroidSdkProvider.getAndroidJar
    • Fix ASAP
    • Bazel
    • rules_jvm_external - examples (Android Robolectric test example)
    • rules_kotlin (Example - Anvil)
    • rules_kotlin (Example - Jetpack Compose)
    • rules_kotlin (Example Bzlmod - Android)
  • Project doesn't set --android_platforms but probably should
    • Bazel Examples (android (Android Firebase Cloud Messaging)
    • Bazel Examples (android (Android NDK)
    • Bazel Examples (tutorials (Bazel end-to-end example)
    • rules_android
    • rules_android_ndk
    • rules_foreign_cc (Examples (spawn_strategy=standalone))
    • rules_jvm_external - examples (Android instrumentation test example)
    • rules_jvm_external - examples (Simple example)
    • rules_kotlin (Example - Android)
    • rules_rust (Android Examples)

Next step before submitting this: send fixes for these.

@katre katre force-pushed the enable-android-platforms branch from 1e4e4ba to 93b61f3 Compare October 12, 2023 18:35
@katre katre changed the title [WIP] Enable Android Platforms by default for Android-related builds. Enable Android Platforms by default for Android-related builds Oct 16, 2023
@katre katre requested review from ted-xie and ahumesky October 16, 2023 16:06
@katre
Copy link
Member Author

katre commented Oct 16, 2023

Downstream projects are mostly clean at this point. A typical error looks like

'android_library' rule '@bazel_tools//src/tools/android/java/com/google/devtools/build/android/incrementaldeployment:incremental_stub_application' requested an android sdk via toolchain resolution but hasn't set an appropriate --android_platforms value: Either set --noincompatible_enable_android_toolchain_resolution or --android_platforms.

If any more downstream projects fail, assign an issue to me to triage.

@katre katre marked this pull request as ready for review October 16, 2023 16:09
@katre katre requested a review from lberki as a code owner October 16, 2023 16:09
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Oct 16, 2023
@katre katre removed this from the 7.0.0 branch cut milestone Oct 16, 2023
@katre katre requested a review from gregestren October 16, 2023 16:18
@iancha1992 iancha1992 added the team-Configurability platforms, toolchains, cquery, select(), config transitions label Oct 16, 2023
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Oct 17, 2023
@katre katre deleted the enable-android-platforms branch October 17, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Configurability platforms, toolchains, cquery, select(), config transitions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

incompatible_enable_android_toolchain_resolution
4 participants