From 5150d0d30953af8ba2451d73f64c362869ba7f3e Mon Sep 17 00:00:00 2001 From: Sam Delmerico Date: Tue, 15 Nov 2022 17:44:44 -0500 Subject: [PATCH] fallback to nonmixed builds for unsupported builds Bug: 253664931 Change-Id: I8026d0412b8dd62f55edf776f72747209ce2e955 --- android/config.go | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/android/config.go b/android/config.go index 52a8f13f8..f430b7215 100644 --- a/android/config.go +++ b/android/config.go @@ -541,7 +541,30 @@ func (c *config) IsMixedBuildsEnabled() bool { fmt.Fprintln(os.Stderr, "unsupported device arch 'riscv64' for Bazel: falling back to non-mixed build") return false } - // TODO(b/253664931): Add other fallback criteria below. + if c.IsEnvTrue("GLOBAL_THINLTO") { + fmt.Fprintln(os.Stderr, "unsupported env var GLOBAL_THINLTO for Bazel: falling back to non-mixed build") + return false + } + if c.IsEnvTrue("CLANG_COVERAGE") { + fmt.Fprintln(os.Stderr, "unsupported env var CLANG_COVERAGE for Bazel: falling back to non-mixed build") + return false + } + if len(c.productVariables.SanitizeHost) > 0 { + fmt.Fprintln(os.Stderr, "unsupported product var SanitizeHost for Bazel: falling back to non-mixed build") + return false + } + if len(c.productVariables.SanitizeDevice) > 0 { + fmt.Fprintln(os.Stderr, "unsupported product var SanitizeDevice for Bazel: falling back to non-mixed build") + return false + } + if len(c.productVariables.SanitizeDeviceDiag) > 0 { + fmt.Fprintln(os.Stderr, "unsupported product var SanitizeDeviceDiag for Bazel: falling back to non-mixed build") + return false + } + if len(c.productVariables.SanitizeDeviceArch) > 0 { + fmt.Fprintln(os.Stderr, "unsupported product var SanitizeDeviceArch for Bazel: falling back to non-mixed build") + return false + } return true }).(bool)