From 7704497315733b2e1cfd96eac9fb9fce0cdfa7c7 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Tue, 2 Feb 2021 17:28:12 +0000 Subject: [PATCH] Add logic to ensure the ART APEXes are built from source in coverage builds. This CL is a nop since the default is still true, but it gives us a way to toggle it without affecting coverage builds. Test: env NATIVE_COVERAGE=true build/soong/soong_ui.bash \ --dumpvar-mode SOONG_CONFIG_art_module_source_build env CLANG_COVERAGE=true build/soong/soong_ui.bash \ --dumpvar-mode SOONG_CONFIG_art_module_source_build env NATIVE_COVERAGE=true CLANG_COVERAGE=true \ build/soong/soong_ui.bash \ --dumpvar-mode SOONG_CONFIG_art_module_source_build check that all these print "true" when the default in the "else" clause is "false". Bug: 172480615 Change-Id: I648ed911773c59a5b2a117dbf3ddcb2ef338830d --- core/android_soong_config_vars.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk index 3a0c0f1b82..5b24881026 100644 --- a/core/android_soong_config_vars.mk +++ b/core/android_soong_config_vars.mk @@ -33,7 +33,17 @@ ifeq (,$(filter art_module,$(SOONG_CONFIG_NAMESPACES))) $(call add_soong_config_namespace,art_module) SOONG_CONFIG_art_module += source_build endif -SOONG_CONFIG_art_module_source_build ?= true +ifneq (,$(filter true,$(NATIVE_COVERAGE) $(CLANG_COVERAGE))) + # Always build ART APEXes from source in coverage builds since the prebuilts + # aren't built with instrumentation. + # TODO(b/172480617): Find another solution for this. + SOONG_CONFIG_art_module_source_build := true +else + # This sets the default for building ART APEXes from source rather than + # prebuilts (in packages/modules/ArtPrebuilt and prebuilt/module_sdk/art) in + # all other platform builds. + SOONG_CONFIG_art_module_source_build ?= true +endif # Apex build mode variables ifdef APEX_BUILD_FOR_PRE_S_DEVICES