Building mainline modules from source is now the default
RELEASE_APEX_CONTRIBUTIONS_* flags per module will be used to toggle
between sources and prebuilts of a mainline module in ap3a and above in
internal and partner builds.
Test: git_aosp-main-with-phones:aosp_cf_arm64_only_phone-next-userdebug
https://android-build.corp.google.com/builds/abtd/run/L61500030003577619
Test: lunch gsi_partner_arm-ap31-userdebug in v-aml-prebuilt-dev
Test: m out/soong/prebuil_info.json # identical before and after
Bug: 308188056
Change-Id: I308f071763297eb95ca5c8fb0191c8bb794789f7
diff --git a/core/android_soong_config_vars.mk b/core/android_soong_config_vars.mk
index 18d245c..ed72fc3 100644
--- a/core/android_soong_config_vars.mk
+++ b/core/android_soong_config_vars.mk
@@ -38,27 +38,6 @@
# PRODUCT_PRECOMPILED_SEPOLICY defaults to true. Explicitly check if it's "false" or not.
$(call add_soong_config_var_value,ANDROID,PRODUCT_PRECOMPILED_SEPOLICY,$(if $(filter false,$(PRODUCT_PRECOMPILED_SEPOLICY)),false,true))
-# 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 := $(RELEASE_DEFAULT_MODULE_BUILD_FROM_SOURCE)
-# TODO(b/301454934): The value from build flag is set to empty when use `False`
-# The condition below can be removed after the issue get sorted.
-ifeq (,$(BRANCH_DEFAULT_MODULE_BUILD_FROM_SOURCE))
- BRANCH_DEFAULT_MODULE_BUILD_FROM_SOURCE := false
-endif
-
-ifneq (,$(MODULE_BUILD_FROM_SOURCE))
- # Keep an explicit setting.
-else ifeq (,$(filter docs sdk win_sdk sdk_addon,$(MAKECMDGOALS)))
- MODULE_BUILD_FROM_SOURCE := true
-else ifneq (,$(PRODUCT_MODULE_BUILD_FROM_SOURCE))
- # Let products override the branch default.
- MODULE_BUILD_FROM_SOURCE := $(PRODUCT_MODULE_BUILD_FROM_SOURCE)
-else
- MODULE_BUILD_FROM_SOURCE := $(BRANCH_DEFAULT_MODULE_BUILD_FROM_SOURCE)
-endif
-
ifdef ART_DEBUG_OPT_FLAG
$(call soong_config_set,art_module,art_debug_opt_flag,$(ART_DEBUG_OPT_FLAG))
endif
@@ -76,9 +55,10 @@
endif
endif
-ifeq (true,$(MODULE_BUILD_FROM_SOURCE))
+# TODO(b/308187800): some internal modules set `prefer` to true on the prebuilt apex module,
+# and set that to false when `ANDROID.module_build_from_source` is true.
+# Set this soong config variable to true for now, and cleanup `prefer` as part of b/308187800
$(call add_soong_config_var_value,ANDROID,module_build_from_source,true)
-endif
# Messaging app vars
ifeq (eng,$(TARGET_BUILD_VARIANT))