From c7226590e6eb335e5e9826089292377141bb6ad1 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 12 Jan 2022 21:20:07 -0800 Subject: [PATCH] Dump soong config variables in dump-variables-rbc There are some products whose board configurations use soong_config_get to read the values of soong config variables that were set in the product configuration. These variables were being lost, as dump-variables-rbc was skipping the soong config variables because mk2rbc couldn't handle converting the raw SOONG_CONFIG_* variables. To fix that issue, dump-variables-rbc now dumps them as calls to soong_config_set instead. Bug: 201700692 Test: m RBC_BOARD_CONFIG=1 nothing on certain products Change-Id: I91ca8418635a94cf80362cad1729f48854f6bc98 --- core/envsetup.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/envsetup.mk b/core/envsetup.mk index b673050441..823290777d 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -317,11 +317,17 @@ endif # Dumps all variables that match [A-Z][A-Z0-9_]* (with a few exceptions) # to the file at $(1). It is used to print only the variables that are # likely to be relevant to the product or board configuration. +# Soong config variables are dumped as $(call soong_config_set) calls +# instead of the raw variable values, because mk2rbc can't read the +# raw ones. define dump-variables-rbc $(file >$(OUT_DIR)/dump-variables-rbc-temp.txt,$(subst $(space),$(newline),$(.VARIABLES)))\ $(file >$(1),\ $(foreach v, $(shell grep -he "^[A-Z][A-Z0-9_]*$$" $(OUT_DIR)/dump-variables-rbc-temp.txt | grep -vhE "^(SOONG_.*|LOCAL_PATH|TOPDIR|PRODUCT_COPY_OUT_.*)$$"),\ -$(v) := $(strip $($(v)))$(newline))) +$(v) := $(strip $($(v)))$(newline))\ +$(foreach ns,$(SOONG_CONFIG_NAMESPACES),\ +$(foreach v,$(SOONG_CONFIG_$(ns)),\ +$$(call soong_config_set,$(ns),$(v),$(SOONG_CONFIG_$(ns)_$(v)))$(newline)))) endef # Read the product specs so we can get TARGET_DEVICE and other