Fix printing variables that have inherit references in them

Inherit references (@inherit in make, 1-tuples in starlark)
usually appear in list product variables, where they're
evaluated before printing. But sometimes they can be copied
into a regular global variable, in which case they won't
be evaluated before printing. The 1-tuples were failing to
print, so adapt them to their make representation before
printing.

Fixes: 264554449
Test: ./out/rbcrun ./build/make/tests/run.rbc
Change-Id: I5ac6eb996c25ee5e77aa26ed5c4b6b6cc31819d1
This commit is contained in:
Cole Faust
2023-01-05 12:02:54 -08:00
parent 17fb8e72a1
commit f07dcc48e8
5 changed files with 86 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ load(":board_input_vars.rbc", board_input_vars_init = "init")
load("//build/make/tests/single_value_inheritance:test.rbc", test_single_value_inheritance = "test")
load("//build/make/tests/artifact_path_requirements:test.rbc", test_artifact_path_requirements = "test")
load("//build/make/tests/prefixed_sort_order:test.rbc", test_prefixed_sort_order = "test")
load("//build/make/tests/inherits_in_regular_variables:test.rbc", test_inherits_in_regular_variables = "test")
def assert_eq(expected, actual):
if expected != actual:
@@ -176,3 +177,4 @@ assert_eq("", g.get("NEWVAR"))
test_single_value_inheritance()
test_artifact_path_requirements()
test_prefixed_sort_order()
test_inherits_in_regular_variables()