From 20545fcf21f8af77e5899f7c6ca4837b05dd20f2 Mon Sep 17 00:00:00 2001 From: Pranav Gupta Date: Wed, 21 Jun 2023 21:16:35 +0000 Subject: [PATCH] DO NOT MERGE: Enable mainline prebuilts for device targets Ignore-AOSP-First: Android Mainline prebuilts are not used for AOSP targets Bug: 286892268 Change-Id: I6f89f47a8e545e563b184cdc9395eddd49950228 Test: pre-submit --- core/android_soong_config_vars.mk | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk index b5f7b22c7f..140acf0f16 100644 --- a/core/android_soong_config_vars.mk +++ b/core/android_soong_config_vars.mk @@ -40,7 +40,7 @@ $(call add_soong_config_var,ANDROID,PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT) # Default behavior for the tree wrt building modules or using prebuilts. This # can always be overridden by setting the environment variable # MODULE_BUILD_FROM_SOURCE. -BRANCH_DEFAULT_MODULE_BUILD_FROM_SOURCE := true +BRANCH_DEFAULT_MODULE_BUILD_FROM_SOURCE := false ifneq ($(SANITIZE_TARGET)$(EMMA_INSTRUMENT_FRAMEWORK),) # Always use sources when building the framework with Java coverage or @@ -49,6 +49,18 @@ ifneq ($(SANITIZE_TARGET)$(EMMA_INSTRUMENT_FRAMEWORK),) BRANCH_DEFAULT_MODULE_BUILD_FROM_SOURCE := true endif +ifneq ($(CLANG_COVERAGE)$(NATIVE_COVERAGE_PATHS),) + # Always use sources when building with clang coverage and native coverage. + # It is possible that there are certain situations when building with coverage + # would work with prebuilts, e.g. when the coverage is not being applied to + # modules for which we provide prebuilts. Unfortunately, determining that + # would require embedding knowledge of which coverage paths affect which + # modules here. That would duplicate a lot of information, add yet another + # location module authors have to update and complicate the logic here. + # For nowe we will just always build from sources when doing coverage builds. + BRANCH_DEFAULT_MODULE_BUILD_FROM_SOURCE := true +endif + # ART does not provide linux_bionic variants needed for products that # set HOST_CROSS_OS=linux_bionic. ifeq (linux_bionic,${HOST_CROSS_OS})