From 7a29da75fe8ff2fdd52d80e3ef79dc53e813f97c Mon Sep 17 00:00:00 2001 From: Rashid Zaman Date: Fri, 7 Jun 2024 11:23:40 -0700 Subject: [PATCH] Fix expansion of _include_stack in _import-node During product configuration after a subgraph has been fully imported, i.e. a makefile and all makefiles it inherits from have been imported, the makefile representing the root node of this subgraph is meant to be removed from _include_stack in the _import-node macro via the call to the wordlist function. Instead, _include_stack is being cleared because the last argument to the wordlist function is escaped so when it is expanded before being passed to wordlist instead of expanding to the value of _include_stack the reference to _include_stack is unescaped. Fix this by removing the escaping of the variable reference. This issue has no impact on product configuration but the correct value of _include_stack helps when debugging product configuration because, for example, the dumpconfig generated by 'product-config' contains the value of _include_stack when nodes are imported. Bug: 345709996 Test: lunch aosp_cf_x86_64_phone-trunk_staging-userdebug && \ m nothing shows no change to build.ninja files Test: Run product-config and dumpconfig.csv shows correct include stack, e.g. for telephony_product.mk Change-Id: I5a9b22fffc147ceea3d49e298b1bbad45f71332c Signed-off-by: Rashid Zaman --- core/node_fns.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/node_fns.mk b/core/node_fns.mk index 144eb8b5c6..d2cee9eedb 100644 --- a/core/node_fns.mk +++ b/core/node_fns.mk @@ -203,7 +203,7 @@ define _import-node $(call _expand-inherited-values,$(1),$(2),$(3),$(4)) $(eval $(1).$(2).inherited :=) - $(eval _include_stack := $(wordlist 2,9999,$$(_include_stack))) + $(eval _include_stack := $(wordlist 2,9999,$(_include_stack))) endef #