Commit graph

13 commits

Author SHA1 Message Date
Cole Faust
386b3746ce Define release flags in starlark instead of make
So that we have a more restricted enviornment for this new configuration
axis that can also be imported into other tools more easily.

Test: Manually (this time also tested setting OUT_DIR outside of the tree)
Change-Id: I01d90e06e45cba756156af16f63e04f575877263
2023-06-09 13:10:05 -07:00
Cole Faust
c63ce1ab58 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
2023-05-09 15:12:58 -07:00
Cole Faust
a874f88cee Remove unneeded rbcrun features
- rblf_cli and rblf_env
- -c and -f

This is in preparation for making rbcrun able to function as a more
general purpose starlark interpreter.

Bug: 280685526
Test: go test, ./out/rbc ./build/make/tests/run.rbc, ./build/bazel/ci/rbc_dashboard.py --quick aosp_arm64
Change-Id: Ifff9ce7b4369422f39c5003bb85a168c78bde7cf
2023-05-05 11:52:02 -07:00
Dan Willemsen
ec5e3b8d28 Rename rbcrun/cmd to make go install work properly
The standard go tooling assumes that a package's binary name should be
the name of the containing folder. Before this change, `go install` or
`go build` (without `-o`) names this binary `cmd`.

Also run `go mod tidy` while we're here, so the tooling doesn't try to
download github.com/nbutton23/zxcvbn-go, which we don't have a local
copy of.

Test: treehugger
Change-Id: I8f79724e928720caf961cdad128655ef31c3e9b2
2023-03-15 20:06:59 -04:00
Cole Faust
c7b8b6ed88 Sort rblf_wildcard results and remove file existence functions
Kati's $(wildcard) results are guaranteed to be sorted,
but go's filepath.Glob() is not.

Remove the file existence functions because they can
just be replaced with wildcards.

Bug: 226974242
Test: go test
Change-Id: I02fb6292b932bc28cd856ec3c7cb9ed9e96ca630
2022-04-26 12:15:41 -07:00
Cole Faust
62878a2cef Remove regex functionality from rbcrun
As a first step to making .rbc files compatible with bazel,
remove regex support since bazel doesn't have it.

Fixes: 227384703
Test: ./out/rbcrun ./build/make/tests/run.rbc
Change-Id: I8b946c20cc42897a47a5516a167732f4e16b6158
2022-03-30 12:00:15 -07:00
Cole Faust
e95122ea14 Fix formatting of rbcrun errors
Was using println instead of printf, and not expanding
the variable arguments.

Test: Manually
Change-Id: I70cd44c11a9b887e396dfa48ba445e2453d3da9b
2021-10-13 12:15:21 -07:00
Sasha Smundak
e8652d4cd1 Separate output from diagnostics in Starlark product configuration.
Some of the product configuration makefiles use `info` and `warning` Make's
builtins for diagnostics. As running Starlark configuration generates the makefile
as its output, this diagnostics has to go elsewhere. Implement `rblf_log` as
the functional equivalent of `print` that writes to stderr instead of stdout
and use it to implement `info` and `warning` counterparts.

Fixes: 201073196
Test: manual
Change-Id: Ib4d9c10566f9b20310fbee41eda67f0a621b0a84
2021-09-24 08:54:29 -07:00
Sasha Smundak
6b795dc6a5 Add find_files builtin, use it to fix find_and_copy implementation
The macro find-and-copy finds all the files in the given source tree that
match the given filename patten and create <source>:<dest> pair with the
same relative path in the destination tree.

Bug: 193540681
Test: rbcrun build/make/tests/run.rbc
Change-Id: Ic4315ce2fab7a7791ab55dd9eed039205a1c721a
2021-08-19 13:54:53 -07:00
Sasha Smundak
3c569799ca Fix rblf_file_exists, it should return true for a directory, too.
Fixes: 184278019
Test: internal
Change-Id: I68c3274a4540dd36e047d6c2027766dbe75d38f8
2021-08-10 09:12:56 -07:00
Sasha Smundak
57bb5081d7 Always use /bin/sh to run the command.
SHELL environment variable cannot be relied on because the rbcrun
can be run as `env - rbcrun ...`

Fixes: 184278019
Test: build/soong/soong_ui.bash --make-mode USE_BAZEL=1 TARGET_PRODUCT=aosp_arm64 TARGET_BUILD_VARIANT=userdebug droid dist platform_tests
Change-Id: Id8fc7fd1ae8f2e674028ba5ffb3616f87eea6bc4
2021-04-01 16:44:47 -07:00
Bob Badour
bfa8d0cacc [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  tools/rbcrun/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I6a1c75458115b15d9d0d9f0dbc11e0acffc1fe7b
2021-03-31 19:57:06 -07:00
Sasha Smundak
24159db21e Roboleaf product configuration runner
The application rbcrun executes Starlark scripts that define Android product configurations.
See README.md for details.

Test: go test
Fixes: 180529448
Change-Id: I7d728b47d3f381b7052a0d7d51c9e698e5c2e316
2021-03-18 10:03:59 -07:00