Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd60673d authored by Cole Faust's avatar Cole Faust Committed by Automerger Merge Worker
Browse files

Support `m product-graph` in Starlark product config am: 04727303 am:...

Support `m product-graph` in Starlark product config am: 04727303 am: 5303c986 am: 922e9538 am: fdf0ae22

Original change: https://android-review.googlesource.com/c/platform/build/+/2002321



Change-Id: Ic5161ceb9cc5c6119e424c641b5dc76cf8f32ee9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7ef2d688 fdf0ae22
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -254,7 +254,7 @@ else
  endif
  endif


  $(shell build/soong/scripts/update_out $(OUT_DIR)/rbc/rbc_board_config_results.mk \
  $(shell build/soong/scripts/update_out $(OUT_DIR)/rbc/rbc_board_config_results.mk \
    $(OUT_DIR)/rbcrun RBC_OUT="make,global" $(OUT_DIR)/rbc/boardlauncher.rbc)
    $(OUT_DIR)/rbcrun RBC_OUT="make" $(OUT_DIR)/rbc/boardlauncher.rbc)
  ifneq ($(.SHELLSTATUS),0)
  ifneq ($(.SHELLSTATUS),0)
    $(error board configuration runner failed: $(.SHELLSTATUS))
    $(error board configuration runner failed: $(.SHELLSTATUS))
  endif
  endif
+0 −1
Original line number Original line Diff line number Diff line
@@ -117,7 +117,6 @@ DUMPCONFIG_SKIP_VARS := \
	9 \
	9 \
	LOCAL_PATH \
	LOCAL_PATH \
	MAKEFILE_LIST \
	MAKEFILE_LIST \
	PARENT_PRODUCT_FILES \
	current_mk \
	current_mk \
	_eiv_ev \
	_eiv_ev \
	_eiv_i \
	_eiv_i \
+0 −24
Original line number Original line Diff line number Diff line
@@ -1234,33 +1234,9 @@ endef
#   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
define _product-var
  $(call get-product-var,$(1),$(2))
  $(call get-product-var,$(1),$(2))
endef
endef
else
define _product-var
  $(call $(2))
endef
endif


define product-installed-files
define product-installed-files
  $(eval _pif_modules := \
  $(eval _pif_modules := \
+1 −13
Original line number Original line Diff line number Diff line
@@ -17,7 +17,7 @@
# the sort also acts as a strip to remove the single space entries that creep in because of the evals
# the sort also acts as a strip to remove the single space entries that creep in because of the evals
define gather-all-products
define gather-all-products
$(eval _all_products_visited := )\
$(eval _all_products_visited := )\
$(sort $(call all-products-inner, $(PARENT_PRODUCT_FILES)))
$(sort $(call all-products-inner, $(PRODUCTS)))
endef
endef


define all-products-inner
define all-products-inner
@@ -78,7 +78,6 @@ $(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)$(RBC_BOARD_CONFIG))
	@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
@@ -87,20 +86,9 @@ ifeq (,$(RBC_PRODUCT_CONFIG)$(RBC_NO_PRODUCT_GRAPH)$(RBC_BOARD_CONFIG))
	$(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

ifeq (,$(RBC_PRODUCT_CONFIG)$(RBC_NO_PRODUCT_GRAPH)$(RBC_BOARD_CONFIG))


.PHONY: product-graph
.PHONY: product-graph
product-graph: $(products_graph)
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
+2 −4
Original line number Original line Diff line number Diff line
@@ -396,12 +396,11 @@ endef
# $(1): product to inherit
# $(1): product to inherit
#
#
# To be called from product makefiles, and is later evaluated during the import-nodes
# To be called from product makefiles, and is later evaluated during the import-nodes
# call below. It does three things:
# call below. It does the following:
#  1. Inherits all of the variables from $1.
#  1. Inherits all of the variables from $1.
#  2. Records the inheritance in the .INHERITS_FROM variable
#  2. Records the inheritance in the .INHERITS_FROM variable
#  3. Records the calling makefile in PARENT_PRODUCT_FILES
#
#
# (2) and (3) can be used together to reconstruct the include hierarchy
# (2) and the PRODUCTS variable can be used together to reconstruct the include hierarchy
# See e.g. product-graph.mk for an example of this.
# See e.g. product-graph.mk for an example of this.
#
#
define inherit-product
define inherit-product
@@ -416,7 +415,6 @@ define inherit-product
    $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
    $(eval current_mk := $(strip $(word 1,$(_include_stack)))) \
    $(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
    $(eval inherit_var := PRODUCTS.$(current_mk).INHERITS_FROM) \
    $(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
    $(eval $(inherit_var) := $(sort $($(inherit_var)) $(np))) \
    $(eval PARENT_PRODUCT_FILES := $(sort $(PARENT_PRODUCT_FILES) $(current_mk))) \
    $(call dump-inherit,$(strip $(word 1,$(_include_stack))),$(1)) \
    $(call dump-inherit,$(strip $(word 1,$(_include_stack))),$(1)) \
    $(call dump-config-vals,$(current_mk),inherit))
    $(call dump-config-vals,$(current_mk),inherit))
endef
endef
Loading