This allows us to use relative paths everywhere.
It also produces more accurate emulation of TOPDIR,
which should be an empty string.
Bug: 213508006
Test: go test
Change-Id: Ie4e357687486e84e9f4aad0f6776d8feb2b9fc63
Having soong generate a list of makefiles for mk2rbc
to look through is much faster than having mk2rbc search
itself. Profiling the readLinesFromeFile() function that
reads the list of makefiles shows it takes on the order
of 200 microseconds, much faster than the ~5 seconds
it takes for mk2rbc to search the tree itself.
This CL also allows include statements that are prefixed
with a variable. The concern with this was that there
would be a lot of load statemnts emitted for generic
include statements, causing the generated code to look
ugly, and converting and loading all those files could
cause performance issues. On the performance issues
front, there's already a check that it doesn't result
in over 150 potentially included files. We can lower
that number if necessary, but it's probably good for now.
On the generated code front, while it's true that it's
ugly, it's better to have working but ugly generated
code than refusing to generate anything working at all.
To ensure the soong finder step isn't slowed down due
to having to find a bunch of new makefiles, I profiled
the combination of newSourceFinder and FindSources in main.go:
Baseline incremental:
338.011634ms
340.853335ms
348.541762ms
333.229644ms
349.124824ms
Baseline clean:
1.003836419s
1.006203912s
996.193648ms
1.031005604s
1.03691152s
Modified incremental:
349.029285ms
349.264496ms
351.774948ms
337.63187ms
359.425306ms
Modified clean:
1.028238704s
1.053103506s
1.032757506s
1.016631201s
1.04288108s
So we can see the times are barely affected by this change.
Fixes: 213508006
Test: go test
Change-Id: Iab18bfb127ba3b7e63f2c01f69064805a8398764
Since rblf_env / rblf_cli are not typed properly, accept
input variables via a file so that they can be converted
with the correct types.
Bug: 201700692
Test: go test
Change-Id: I9b56067cfe396d1bcd8d62c353ff222dd61a6c9f
Instead of inserting a comment with error description into the generated code,
generate a call to a function that will print out a conversion error when executed.
Do not print generic "partially converted" message anymore.
Remove --verbose and --no_warnings options.
Bug: 204062171
Test: internal
Change-Id: Ib126e16dc76f49635e4939e670922f2561781049
Since we are going to be asking partners to start
ensuring that their makefiles work with mk2rbc,
enable warnings by default so they're more visible.
Otherwise, the conversion could appear to succeed
but have some subtle failures.
Bug: 204062171
Test: Manually
Change-Id: I38189031d7357bb3f2c811de90f2821cde10cbcd
Board config works slightly differently from product config.
It requires the product config variables to be passed into
it. Currently the only generic way to pass info into an RBC
script is via the arguments to rbcrun, which get passed
as global variables, not the product (cfg) variables.
Add a new form of launcher that reads the product variables
from a separate rbc file that is generated in make.
The board configuration also doesn't need inheritance, so it
doesn't call rblf.product_configuration() either.
Bug: 201700692
Test: build/bazel/ci/rbc_product_config.sh -b sdk_phone_x86_64-userdebug
Change-Id: I52fd65b33cf99b45a563284e2849da75a8af8688
Now that the product and board config pass makefiles
to mk2rbc, we don't need to support passing a product
name.
Bug: 201700692
Test: Manually
Change-Id: I787f0f98bc5ab3cefeefb7af8d342aba84769925
The current behavior of mk2rbc is that it can accept either
a makefile to convert, or if it's also generating a launcher,
it must accept a product name instead of a makefile.
For board configuration, we need to convert a specific makefile,
but we also want to generate a launcher. Change mk2rbc so that
its non-flag arguments can be either makefiles or product names.
Bug: 201700692
Test: ./build/bazel/ci/rbc_product_config.sh aosp_arm64-userdebug
with board config changes patched in
Change-Id: I521e31fe0bdc608b8f26c9aa803ca690dd1c538e
Generate version settings from build/make/core/version_defaults.mk.
The generated settings are then loaded into the launcher code and passed
to the environment setup code.
Bug: 198995713
Test: internal
Change-Id: I66131d2c5b232784a9ff0bba9fbd5db62302aaba