From b4e18708070a75d80965fb16ced60661e531bd9a Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Fri, 22 Mar 2024 11:19:13 -0700 Subject: [PATCH] Fix Android platforms constraint (#16246) (#16271) When using bazel platforms and new rules_android_ndk, crosstool_top is actually still `//external:android/crosstool`. The right way to detect Android is to use `constraint_value`. Closes #16246 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16246 from sifmelcara:fix-platforms dbf3fd58dbfb3aca17831121c9e0681addc9aa21 PiperOrigin-RevId: 618198820 Co-authored-by: Ming-Chuan <10496191+sifmelcara@users.noreply.github.com> --- build_defs/BUILD.bazel | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build_defs/BUILD.bazel b/build_defs/BUILD.bazel index 540962f0e053..1c72eba68e82 100644 --- a/build_defs/BUILD.bazel +++ b/build_defs/BUILD.bazel @@ -38,9 +38,7 @@ config_setting( # When using https://bazel.build/concepts/platforms config_setting( name = "config_android", - values = { - "crosstool_top": "@platforms//os:android", - }, + constraint_values = ["@platforms//os:android"], ) # When using legacy flags like --android_crosstool_top, --android_cpu, and --fat_apk_cpu