Allow importing starlark code in makefiles

Adds a new `$(call run-starlark,my/starlark/file.bzl)` function that
will run the starlark file and set all the variables in the
variables_to_export_to_make dictionary as make variables.

Fixes: 280685526
Test: m nothing repeatedly causes no ninja regeneration, but touching all_versions.bzl does. go test, ./out/rbcrun -mode=rbc ./build/make/tests/run.rbc
Change-Id: Ic72e18dd28dba8233ba2dfb658b5d03ccece1bfd
This commit is contained in:
Cole Faust
2023-05-09 14:56:36 -07:00
parent 20f0cd3f91
commit c63ce1ab58
9 changed files with 310 additions and 74 deletions

View File

@@ -2,6 +2,6 @@
load("assert.star", "assert")
# Make sure that builtins are defined for the loaded module, too
assert.true(rblf_wildcard("module1.star"))
assert.true(not rblf_wildcard("no_such file"))
assert.true(rblf_wildcard("testdata/module1.star"))
assert.true(not rblf_wildcard("testdata/no_such file"))
test = "module1"