Merge changes I0ecafa41,Ic6173a96 am: 420a93155a
Original change: https://android-review.googlesource.com/c/platform/build/+/1786890 Change-Id: I61c888f7c79e42f0b96811035d4b81573b5d1f35
This commit is contained in:
47
core/main.mk
47
core/main.mk
@@ -1242,14 +1242,43 @@ endef
|
|||||||
# Name resolution for LOCAL_REQUIRED_MODULES:
|
# Name resolution for LOCAL_REQUIRED_MODULES:
|
||||||
# See the select-bitness-of-required-modules definition.
|
# See the select-bitness-of-required-modules definition.
|
||||||
# $(1): product makefile
|
# $(1): product makefile
|
||||||
|
|
||||||
|
# TODO(asmundak):
|
||||||
|
# `product-installed-files` and `host-installed-files` macros below used to
|
||||||
|
# call `get-product-var` directly to obtain per-file configuration variable
|
||||||
|
# values (the value of variable FOO is fetched from PRODUCT.<product-makefile>.FOO).
|
||||||
|
# Starlark-based configuration does not maintain per-file variable variable
|
||||||
|
# values. To work around this problem, we utilize the fact that
|
||||||
|
# `product-installed-files` and `host-installed-files` are called only in
|
||||||
|
# two places:
|
||||||
|
# 1. For the top-level product makefile (in this file). In this case
|
||||||
|
# $(call get-product-var <product>, FOO) is the same as $(FOO) as the
|
||||||
|
# product configuration has been run already. Therefore we define
|
||||||
|
# _product-var macro to pick the values directly from product config
|
||||||
|
# variables when using Starlark-based configuration.
|
||||||
|
# 2. To check the path requirements (in artifact_path_requirements.mk).
|
||||||
|
# Starlark-based configuration does not perform this check at the moment.
|
||||||
|
# In the longer run most of the logic of this file will be moved to the
|
||||||
|
# Starlark.
|
||||||
|
|
||||||
|
ifndef RBC_PRODUCT_CONFIG
|
||||||
|
define _product-var
|
||||||
|
$(call get-product-var,$(1),$(2))
|
||||||
|
endef
|
||||||
|
else
|
||||||
|
define _product-var
|
||||||
|
$(call $(2))
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
define product-installed-files
|
define product-installed-files
|
||||||
$(eval _pif_modules := \
|
$(eval _pif_modules := \
|
||||||
$(call get-product-var,$(1),PRODUCT_PACKAGES) \
|
$(call _product-var,$(1),PRODUCT_PACKAGES) \
|
||||||
$(if $(filter eng,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_ENG)) \
|
$(if $(filter eng,$(tags_to_install)),$(call _product-var,$(1),PRODUCT_PACKAGES_ENG)) \
|
||||||
$(if $(filter debug,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_DEBUG)) \
|
$(if $(filter debug,$(tags_to_install)),$(call _product-var,$(1),PRODUCT_PACKAGES_DEBUG)) \
|
||||||
$(if $(filter tests,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_TESTS)) \
|
$(if $(filter tests,$(tags_to_install)),$(call _product-var,$(1),PRODUCT_PACKAGES_TESTS)) \
|
||||||
$(if $(filter asan,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_DEBUG_ASAN)) \
|
$(if $(filter asan,$(tags_to_install)),$(call _product-var,$(1),PRODUCT_PACKAGES_DEBUG_ASAN)) \
|
||||||
$(if $(filter java_coverage,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE)) \
|
$(if $(filter java_coverage,$(tags_to_install)),$(call _product-var,$(1),PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE)) \
|
||||||
$(call auto-included-modules) \
|
$(call auto-included-modules) \
|
||||||
) \
|
) \
|
||||||
$(eval ### Filter out the overridden packages and executables before doing expansion) \
|
$(eval ### Filter out the overridden packages and executables before doing expansion) \
|
||||||
@@ -1260,13 +1289,13 @@ define product-installed-files
|
|||||||
$(call expand-required-modules,_pif_modules,$(_pif_modules),$(_pif_overrides)) \
|
$(call expand-required-modules,_pif_modules,$(_pif_modules),$(_pif_overrides)) \
|
||||||
$(filter-out $(HOST_OUT_ROOT)/%,$(call module-installed-files, $(_pif_modules))) \
|
$(filter-out $(HOST_OUT_ROOT)/%,$(call module-installed-files, $(_pif_modules))) \
|
||||||
$(call resolve-product-relative-paths,\
|
$(call resolve-product-relative-paths,\
|
||||||
$(foreach cf,$(call get-product-var,$(1),PRODUCT_COPY_FILES),$(call word-colon,2,$(cf))))
|
$(foreach cf,$(call _product-var,$(1),PRODUCT_COPY_FILES),$(call word-colon,2,$(cf))))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Similar to product-installed-files above, but handles PRODUCT_HOST_PACKAGES instead
|
# Similar to product-installed-files above, but handles PRODUCT_HOST_PACKAGES instead
|
||||||
# This does support the :32 / :64 syntax, but does not support module overrides.
|
# This does support the :32 / :64 syntax, but does not support module overrides.
|
||||||
define host-installed-files
|
define host-installed-files
|
||||||
$(eval _hif_modules := $(call get-product-var,$(1),PRODUCT_HOST_PACKAGES)) \
|
$(eval _hif_modules := $(call _product-var,$(1),PRODUCT_HOST_PACKAGES)) \
|
||||||
$(eval ### Split host vs host cross modules) \
|
$(eval ### Split host vs host cross modules) \
|
||||||
$(eval _hcif_modules := $(filter host_cross_%,$(_hif_modules))) \
|
$(eval _hcif_modules := $(filter host_cross_%,$(_hif_modules))) \
|
||||||
$(eval _hif_modules := $(filter-out host_cross_%,$(_hif_modules))) \
|
$(eval _hif_modules := $(filter-out host_cross_%,$(_hif_modules))) \
|
||||||
@@ -1351,7 +1380,7 @@ ifdef FULL_BUILD
|
|||||||
|
|
||||||
# Verify the artifact path requirements made by included products.
|
# Verify the artifact path requirements made by included products.
|
||||||
is_asan := $(if $(filter address,$(SANITIZE_TARGET)),true)
|
is_asan := $(if $(filter address,$(SANITIZE_TARGET)),true)
|
||||||
ifneq (true,$(or $(is_asan),$(DISABLE_ARTIFACT_PATH_REQUIREMENTS)))
|
ifeq (,$(or $(is_asan),$(DISABLE_ARTIFACT_PATH_REQUIREMENTS),$(RBC_PRODUCT_CONFIG)))
|
||||||
include $(BUILD_SYSTEM)/artifact_path_requirements.mk
|
include $(BUILD_SYSTEM)/artifact_path_requirements.mk
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
@@ -81,6 +81,7 @@ $(products_graph): PRIVATE_PRODUCTS := $(all_products)
|
|||||||
$(products_graph): PRIVATE_PRODUCTS_FILTER := $(products_list)
|
$(products_graph): PRIVATE_PRODUCTS_FILTER := $(products_list)
|
||||||
|
|
||||||
$(products_graph): $(this_makefile)
|
$(products_graph): $(this_makefile)
|
||||||
|
ifeq (,$(RBC_PRODUCT_CONFIG)$(RBC_NO_PRODUCT_GRAPH))
|
||||||
@echo Product graph DOT: $@ for $(PRIVATE_PRODUCTS_FILTER)
|
@echo Product graph DOT: $@ for $(PRIVATE_PRODUCTS_FILTER)
|
||||||
$(hide) echo 'digraph {' > $@.in
|
$(hide) echo 'digraph {' > $@.in
|
||||||
$(hide) echo 'graph [ ratio=.5 ];' >> $@.in
|
$(hide) echo 'graph [ ratio=.5 ];' >> $@.in
|
||||||
@@ -89,6 +90,10 @@ $(products_graph): $(this_makefile)
|
|||||||
$(foreach p,$(PRIVATE_PRODUCTS),$(call emit-product-node-props,$(p),$@.in))
|
$(foreach p,$(PRIVATE_PRODUCTS),$(call emit-product-node-props,$(p),$@.in))
|
||||||
$(hide) echo '}' >> $@.in
|
$(hide) echo '}' >> $@.in
|
||||||
$(hide) build/make/tools/filter-product-graph.py $(PRIVATE_PRODUCTS_FILTER) < $@.in > $@
|
$(hide) build/make/tools/filter-product-graph.py $(PRIVATE_PRODUCTS_FILTER) < $@.in > $@
|
||||||
|
else
|
||||||
|
@echo RBC_PRODUCT_CONFIG and RBC_NO_PRODUCT_GRAPH should be unset to generate product graph
|
||||||
|
false
|
||||||
|
endif
|
||||||
|
|
||||||
# Evaluates to the name of the product file
|
# Evaluates to the name of the product file
|
||||||
# $(1) product file
|
# $(1) product file
|
||||||
@@ -143,6 +148,7 @@ $(call product-debug-filename, $(p)): \
|
|||||||
$(hide) cat $$< | build/make/tools/product_debug.py > $$@
|
$(hide) cat $$< | build/make/tools/product_debug.py > $$@
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
ifeq (,$(RBC_PRODUCT_CONFIG)$(RBC_NO_PRODUCT_GRAPH))
|
||||||
product_debug_files:=
|
product_debug_files:=
|
||||||
$(foreach p,$(all_products), \
|
$(foreach p,$(all_products), \
|
||||||
$(eval $(call transform-product-debug, $(p))) \
|
$(eval $(call transform-product-debug, $(p))) \
|
||||||
@@ -154,3 +160,8 @@ product-graph: $(products_graph)
|
|||||||
@echo Product graph .dot file: $(products_graph)
|
@echo Product graph .dot file: $(products_graph)
|
||||||
@echo Command to convert to pdf: dot -Tpdf -Nshape=box -o $(OUT_DIR)/products.pdf $(products_graph)
|
@echo Command to convert to pdf: dot -Tpdf -Nshape=box -o $(OUT_DIR)/products.pdf $(products_graph)
|
||||||
@echo Command to convert to svg: dot -Tsvg -Nshape=box -o $(OUT_DIR)/products.svg $(products_graph)
|
@echo Command to convert to svg: dot -Tsvg -Nshape=box -o $(OUT_DIR)/products.svg $(products_graph)
|
||||||
|
else
|
||||||
|
.PHONY: product-graph
|
||||||
|
@echo RBC_PRODUCT_CONFIG and RBC_NO_PRODUCT_GRAPH should be unset to generate product graph
|
||||||
|
false
|
||||||
|
endif
|
@@ -172,11 +172,24 @@ endif
|
|||||||
ifneq (1,$(words $(current_product_makefile)))
|
ifneq (1,$(words $(current_product_makefile)))
|
||||||
$(error Product "$(TARGET_PRODUCT)" ambiguous: matches $(current_product_makefile))
|
$(error Product "$(TARGET_PRODUCT)" ambiguous: matches $(current_product_makefile))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef RBC_PRODUCT_CONFIG
|
||||||
$(call import-products, $(current_product_makefile))
|
$(call import-products, $(current_product_makefile))
|
||||||
|
else
|
||||||
|
rbcscript=build/soong/scripts/rbc-run
|
||||||
|
rc := $(shell $(rbcscript) $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) >$(OUT_DIR)/rbctemp.mk || echo $$?)
|
||||||
|
ifneq (,$(rc))
|
||||||
|
$(error product configuration converter failed: $(rc))
|
||||||
|
endif
|
||||||
|
include $(OUT_DIR)/rbctemp.mk
|
||||||
|
PRODUCTS += $(current_product_makefile)
|
||||||
|
endif
|
||||||
endif # Import all or just the current product makefile
|
endif # Import all or just the current product makefile
|
||||||
|
|
||||||
|
ifndef RBC_PRODUCT_CONFIG
|
||||||
# Quick check
|
# Quick check
|
||||||
$(check-all-products)
|
$(check-all-products)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(SKIP_ARTIFACT_PATH_REQUIREMENT_PRODUCTS_CHECK),)
|
ifeq ($(SKIP_ARTIFACT_PATH_REQUIREMENT_PRODUCTS_CHECK),)
|
||||||
# Import all the products that have made artifact path requirements, so that we can verify
|
# Import all the products that have made artifact path requirements, so that we can verify
|
||||||
@@ -196,6 +209,7 @@ ifneq ($(filter dump-products, $(MAKECMDGOALS)),)
|
|||||||
$(dump-products)
|
$(dump-products)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef RBC_PRODUCT_CONFIG
|
||||||
# Convert a short name like "sooner" into the path to the product
|
# Convert a short name like "sooner" into the path to the product
|
||||||
# file defining that product.
|
# file defining that product.
|
||||||
#
|
#
|
||||||
@@ -208,6 +222,9 @@ endif
|
|||||||
############################################################################
|
############################################################################
|
||||||
# Strip and assign the PRODUCT_ variables.
|
# Strip and assign the PRODUCT_ variables.
|
||||||
$(call strip-product-vars)
|
$(call strip-product-vars)
|
||||||
|
else
|
||||||
|
INTERNAL_PRODUCT := $(current_product_makefile)
|
||||||
|
endif
|
||||||
|
|
||||||
current_product_makefile :=
|
current_product_makefile :=
|
||||||
all_product_makefiles :=
|
all_product_makefiles :=
|
||||||
|
@@ -79,6 +79,10 @@ def _printvars(globals, cfg):
|
|||||||
if attr == _soong_config_namespaces_key:
|
if attr == _soong_config_namespaces_key:
|
||||||
__print_attr("SOONG_CONFIG_NAMESPACES", val.keys())
|
__print_attr("SOONG_CONFIG_NAMESPACES", val.keys())
|
||||||
for nsname, nsvars in sorted(val.items()):
|
for nsname, nsvars in sorted(val.items()):
|
||||||
|
# Define SOONG_CONFIG_<ns> for Make, othewise
|
||||||
|
# it cannot be added to .KATI_READONLY list
|
||||||
|
if _options.format == "make":
|
||||||
|
print("SOONG_CONFIG_" + nsname, ":=")
|
||||||
for var, val in sorted(nsvars.items()):
|
for var, val in sorted(nsvars.items()):
|
||||||
__print_attr("SOONG_CONFIG_%s_%s" % (nsname, var), val)
|
__print_attr("SOONG_CONFIG_%s_%s" % (nsname, var), val)
|
||||||
elif attr not in _globals_base:
|
elif attr not in _globals_base:
|
||||||
|
Reference in New Issue
Block a user