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

Improve --incompatible_disable_native_android_rules usability #18357

Conversation

Bencodes
Copy link
Contributor

@Bencodes Bencodes commented May 9, 2023

Adding an internal allow list to the --incompatible_disable_native_android_rules so that it doesn't error out immediately when evaluating the mobiel-install bazel_tools targets.

Some example errors that we see when we flip this flag to ensure that all targets are using the Starlark rules instead of the native rules:

(11:04:57) ERROR: /private/var/tmp/_bazel_blee/499a001013731d09bffd82f8601a3161/external/bazel_tools/tools/android/BUILD:14:27: in tags attribute of android_tools_defaults_jar rule @bazel_tools//tools/android:android_jar: The native Android rules are deprecated. Please use the Starlark Android rules by adding the following load statement to the BUILD file: load("@build_bazel_rules_android//android:rules.bzl", "android_tools_defaults_jar"). See http://github.com/bazelbuild/rules_android.
(11:04:57) ERROR: /private/var/tmp/_bazel_blee/499a001013731d09bffd82f8601a3161/external/bazel_tools/tools/android/BUILD:14:27: Analysis of target '@bazel_tools//tools/android:android_jar' failed
(11:06:06) ERROR: /private/var/tmp/_bazel_blee/499a001013731d09bffd82f8601a3161/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/BUILD:11:16: in tags attribute of android_library rule @bazel_tools//src/tools/android/java/com/google/devtools/build/android/incrementaldeployment:incremental_split_stub_application: The native Android rules are deprecated. Please use the Starlark Android rules by adding the following load statement to the BUILD file: load("@build_bazel_rules_android//android:rules.bzl", "android_library"). See http://github.com/bazelbuild/rules_android.
(11:06:06) ERROR: /private/var/tmp/_bazel_blee/499a001013731d09bffd82f8601a3161/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment/BUILD:11:16: Analysis of target '@bazel_tools//src/tools/android/java/com/google/devtools/build/android/incrementaldeployment:incremental_split_stub_application' failed

@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label May 9, 2023
}
private static final ImmutableSet<PackageIdentifier> STARLARK_MIGRATION_NATIVE_USAGE_ALLOW_LIST =
// Internal package identifiers that are allowed to use the native Android rules until they
// can be fully moved into the rules_andorid Starlark implementation.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: s/andorid/android

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@sgowroji sgowroji added the team-Android Issues for Android team label May 10, 2023
@ahumesky ahumesky added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Aug 17, 2023
// can be fully moved into the rules_android Starlark implementation.
ImmutableSet.<PackageIdentifier>builder()
.add(
PackageIdentifier.createUnchecked(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ahumesky @ted-xie alternatively we can add load statements on rules_android to the build files here, but that might cause other issues for people that don't import the android rules.

@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Android Issues for Android team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants