diff options
author | Cole Faust <colefaust@google.com> | 2021-09-30 17:14:29 -0700 |
---|---|---|
committer | Cole Faust <colefaust@google.com> | 2021-10-01 17:56:54 -0700 |
commit | e5e7a2d531d1fde683cc6a5afb9a2ade71d9954d (patch) | |
tree | 21e971208f84988cd73db47727d5d442ca59474b | |
parent | 894e9be3f7ab232e9b004fb2c186a682fc2020ad (diff) | |
download | build-e5e7a2d531d1fde683cc6a5afb9a2ade71d9954d.tar.gz |
Add RBC board configuration
This does largely the same thing as in product configuration,
it converts the board makefiles and evaluates them in place
of an $(include).
Bug: 201700692
Test: Temporarily replace the ifndef RBC_BOARD_CONFIG with RBC_PRODUCT_CONFIG,
then ./build/bazel/ci/rbc_product_config.sh aosp_arm64-userdebug
Change-Id: I91c3dd6b91cf6bfeb18a5fff95d53b7a2c113c57
-rw-r--r-- | core/board_config.mk | 13 | ||||
-rw-r--r-- | core/product_config.mk | 8 | ||||
-rw-r--r-- | core/product_config.rbc | 2 |
3 files changed, 16 insertions, 7 deletions
diff --git a/core/board_config.mk b/core/board_config.mk index 281ab1627b..0ad49c8774 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -184,7 +184,20 @@ else .KATI_READONLY := TARGET_DEVICE_DIR endif +# TODO(colefaust) change this if to RBC_PRODUCT_CONFIG when +# the board configuration is known to work on everything +# the product config works on. +ifndef RBC_BOARD_CONFIG include $(board_config_mk) +else + rc := $(shell build/soong/scripts/rbc-run $(board_config_mk) \ + BUILDING_GSI=$(BUILDING_GSI) >$(OUT_DIR)/rbcboardtemp.mk || echo $$?) + ifneq (,$(rc)) + $(error board configuration converter failed: $(rc)) + endif + + include $(OUT_DIR)/rbcboardtemp.mk +endif ifneq (,$(and $(TARGET_ARCH),$(TARGET_ARCH_SUITE))) $(error $(board_config_mk) erroneously sets both TARGET_ARCH and TARGET_ARCH_SUITE) diff --git a/core/product_config.mk b/core/product_config.mk index b631294105..64c23ae5b7 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -199,12 +199,8 @@ endif ifndef RBC_PRODUCT_CONFIG $(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 2>$(OUT_DIR)/rbctemp.stderr || echo $$?) - rbcerrors := $(file <$(OUT_DIR)/rbctemp.stderr) - ifneq (,$(rbcerrors)) - $(warning $(rbcerrors)) - endif + rc := $(shell build/soong/scripts/rbc-run $(current_product_makefile) \ + >$(OUT_DIR)/rbctemp.mk || echo $$?) ifneq (,$(rc)) $(error product configuration converter failed: $(rc)) endif diff --git a/core/product_config.rbc b/core/product_config.rbc index 9fa4a8c14f..5219751e34 100644 --- a/core/product_config.rbc +++ b/core/product_config.rbc @@ -84,7 +84,7 @@ def _printvars(state): print("SOONG_CONFIG_" + nsname, ":=", " ".join(nsvars.keys())) for var, val in sorted(nsvars.items()): __print_attr("SOONG_CONFIG_%s_%s" % (nsname, var), val) - elif attr not in globals_base: + elif attr not in globals_base or globals_base[attr] != val: __print_attr(attr, val) def __printvars_rearrange_list(value_list): |