From 971ef8ecd623bd5f51e6124deaaf67f7bbae8c02 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Wed, 6 Apr 2022 11:58:37 -0700 Subject: [PATCH] Fix "posix_spawn: Argument list too long" issue The shell command was too long when it listed all the make variables. Dump them to a file instead. Fixes: 228347189 Test: RBC_BOARD_CONFIG=1 m nothing on aosp_arm64 Change-Id: I325c78810f5efbe87df2c3ffc269ed78db8c3732 --- core/envsetup.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/envsetup.mk b/core/envsetup.mk index 62ea1b68ec..049a4d6c8b 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -334,8 +334,9 @@ $(eval _dump_variables_rbc_excluded := \ USER \ SOONG_% \ PRODUCT_COPY_OUT_%)\ +$(file >$(OUT_DIR)/dump-variables-rbc-temp.txt,$(subst $(space),$(newline),$(filter-out $(_dump_variables_rbc_excluded),$(.VARIABLES)))) $(file >$(1),\ -$(foreach v, $(shell echo $(filter-out $(_dump_variables_rbc_excluded),$(.VARIABLES)) | tr ' ' '\n' | grep -he "^[A-Z][A-Z0-9_]*$$"),\ +$(foreach v, $(shell grep -he "^[A-Z][A-Z0-9_]*$$" $(OUT_DIR)/dump-variables-rbc-temp.txt),\ $(v) := $(strip $($(v)))$(newline))\ $(foreach ns,$(SOONG_CONFIG_NAMESPACES),\ $(foreach v,$(SOONG_CONFIG_$(ns)),\