From dbf3fd58dbfb3aca17831121c9e0681addc9aa21 Mon Sep 17 00:00:00 2001 From: Ming-Chuan Lin Date: Wed, 20 Mar 2024 13:17:32 -0700 Subject: [PATCH] Fix Android platforms constraint 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`. --- 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 44d626b132d3a..f1394e391ea5f 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