From 593b2e5ce40f5814ebb71ddd9003a1b43799d274 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Tue, 23 May 2023 17:45:37 +0000 Subject: [PATCH] Create default PRODUCT_INCLUDE_TAGS in product_config In the current setup in partner branch, we 1. Add blueprint_package_includes to prebuilts/module_sdk/* 2. Add the correct PRODUCT_INCLUDE_TAGS to partner_modules This means in those setups,none of the prebuilts are visible to aosp products since they they do not inherit partner_module makefiles. ``` e.g. prebuilts/module_sdk/art/current/Android.bp prebuilts/module_sdk/art//current/Android.bp // aosp_arm cannot find either ``` To solve this, this CL creates a default inclusion tag for all products that do not set any PRODUCT_INCLUDE_TAGS explicitly. In the previous example, Soong analysis of aosp_* will use prebuilts/module_sdk/art/current/Android.bp. This should be a no-op for aosp and internal branches since none of the Android.bp files today contains blueprint_package_includes Test: m nothing for aosp_arm in the test branch of b/278604467#comment20 Test: m nothing for partner product that uses big android sdk Test: m nothing for partner product that uses go sdk Bug: 278604467 (cherry picked from https://android-review.googlesource.com/q/commit:2e69ea622877e7f88b82db4adbc284b9342f8c2c) Merged-In: I322b52c34ed339989207609dd0fd23c27ed1f697 Change-Id: I322b52c34ed339989207609dd0fd23c27ed1f697 cp required as per b/278604467#comment25 --- core/product_config.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/product_config.mk b/core/product_config.mk index 1ef8890d46..5d76eebd1d 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -279,6 +279,15 @@ BLUEPRINT_INCLUDE_TAGS_ALLOWLIST := com.android.mainline_go com.android.mainline $(foreach include_tag,$(PRODUCT_INCLUDE_TAGS), \ $(if $(filter $(include_tag),$(BLUEPRINT_INCLUDE_TAGS_ALLOWLIST)),,\ $(call pretty-error, $(include_tag) is not in BLUEPRINT_INCLUDE_TAGS_ALLOWLIST: $(BLUEPRINT_INCLUDE_TAGS_ALLOWLIST)))) +# Create default PRODUCT_INCLUDE_TAGS +ifeq (, $(PRODUCT_INCLUDE_TAGS)) +# Soong analysis is global: even though a module might not be relevant to a specific product (e.g. build_tools for aosp_arm), +# we still analyse it. +# This means that in setups where we two have two prebuilts of module_sdk, we need a "default" to use in analysis +# This should be a no-op in aosp and internal since no Android.bp file contains blueprint_package_includes +PRODUCT_INCLUDE_TAGS += com.android.mainline # Use the big android one by default +endif + ############################################################################# # Quick check and assign default values