[build] rename android platforms to match CPU arch (#36715)

Work around for https://github.com/bazelbuild/bazel/issues/15837#issuecomment-2127758141

Fixes a problem where the example client and server APKs would build but could not be installed (`INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries`)

Closes #36715

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36715 from jdcormie:android-platforms f71e994b14
PiperOrigin-RevId: 640938680
pull/36831/head^2
John Cormie 6 months ago committed by Copybara-Service
parent 14d76aac59
commit e409ca652f
  1. 24
      BUILD
  2. 37
      bazel/platforms/android/BUILD
  3. 2
      examples/android/binder/java/io/grpc/binder/cpp/README.md
  4. 2
      tools/internal_ci/linux/grpc_binder_transport_apk_build_in_docker.sh

24
BUILD

@ -66,30 +66,6 @@ bool_flag(
build_setting_default = False,
)
platform(
name = "android_x86_64",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:x86_64",
],
)
platform(
name = "android_arm64",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:arm64",
],
)
platform(
name = "android_armv7",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:armv7",
],
)
config_setting(
name = "grpc_no_rls_flag",
flag_values = {":disable_grpc_rls": "true"},

@ -0,0 +1,37 @@
# Copyright 2024 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
platform(
name = "x86_64",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:x86_64",
],
)
platform(
name = "arm64-v8a",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:arm64",
],
)
platform(
name = "armeabi-v7a",
constraint_values = [
"@platforms//os:android",
"@platforms//cpu:armv7",
],
)

@ -13,7 +13,7 @@
```
bazel build \
--extra_toolchains=@androidndk//:all \
--android_platforms=//:android_x86_64,//:android_armv7,//:android_arm64 \
--android_platforms=//bazel/platforms/android:x86_64,//bazel/platforms/android:armeabi-v7a,//bazel/platforms/android:arm64-v8a \
--copt=-Wno-unknown-warning-option \
//examples/android/binder/java/io/grpc/binder/cpp/exampleserver:app \
//examples/android/binder/java/io/grpc/binder/cpp/exampleclient:app

@ -26,7 +26,7 @@ bazel_binder_example_app/bazel_wrapper \
--bazelrc=tools/remote_build/include/test_locally_with_resultstore_results.bazelrc \
build \
--extra_toolchains=@androidndk//:all \
--android_platforms=//:android_x86_64,//:android_armv7,//:android_arm64 \
--android_platforms=//bazel/platforms/android:x86_64,//bazel/platforms/android:armeabi-v7a,//bazel/platforms/android:arm64-v8a \
//examples/android/binder/java/io/grpc/binder/cpp/exampleclient:app \
//examples/android/binder/java/io/grpc/binder/cpp/exampleserver:app

Loading…
Cancel
Save