diff options
author | 2022-04-26 18:02:05 -0700 | |
---|---|---|
committer | 2022-04-26 18:02:05 -0700 | |
commit | 5d5fcc3092997fe5b528d6ab519b244ea8e99a6d (patch) | |
tree | f0c7ad4a359886830e3d39596157946c55782bdd /mk2rbc/mk2rbc_test.go | |
parent | 12097e3109036ee4f21b4316107944b78abc5bd3 (diff) |
Ignore assignments to .KATI_READONLY
Since the rbc results file is sorted, .KATI_READONLY
ends up trying to make a variable that hasn't been defined
yet readonly, which is an error.
It's not really worth supporting moving it down in the list,
because it wouldn't affect the variable being writable while
still in Starlark code.
Bug: 226974242
Test: go test
Change-Id: I9402f69be97e5c7cf010ad86f124422ea55fda7f
Diffstat (limited to 'mk2rbc/mk2rbc_test.go')
-rw-r--r-- | mk2rbc/mk2rbc_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mk2rbc/mk2rbc_test.go b/mk2rbc/mk2rbc_test.go index de7512927..1287cfd16 100644 --- a/mk2rbc/mk2rbc_test.go +++ b/mk2rbc/mk2rbc_test.go @@ -1529,6 +1529,20 @@ def init(g, handle): cfg["PRODUCT_COPY_FILES"] += ("%s:foo/bar/%s" % (g.get("MY_OTHER_VAR", ""), x)).split() `, }, + { + desc: ".KATI_READONLY", + mkname: "product.mk", + in: ` +MY_VAR := foo +.KATI_READONLY := MY_VAR +`, + expected: `load("//build/make/core:product_config.rbc", "rblf") + +def init(g, handle): + cfg = rblf.cfg(handle) + g["MY_VAR"] = "foo" +`, + }, } var known_variables = []struct { |