Soong is integrated with Google's Remote Build Execution(RBE) service, which implements the Remote Executaion API.
With RBE enabled, it can speed up the Android Platform builds by distributing build actions through a worker pool sharing a central cache of build results.
To enable RBE, you need to set several environment variables before triggering the build. You can set them through a environment variables config file. As an example, build/soong/docs/rbe.json is a config that enables RBE in the build. Once the config file is created, you need to let Soong load the config file by specifying ANDROID_BUILD_ENVIRONMENT_CONFIG_DIR
environment variable and ANDROID_BUILD_ENVIRONMENT_CONFIG
environment variable. The following command starts Soong with build/soong/docs/rbe.json loaded:
ANDROID_BUILD_ENVIRONMENT_CONFIG=rbe \ ANDROID_BUILD_ENVIRONMENT_CONFIG_DIR=build/soong/doc \ build/soong/soong_ui.bash
Below a brief explanation of each field in build/soong/docs/rbe.json:
If set to 1, enable RBE for the build.
Sets strategies for C++/javac/r8/d8 action types. Available options are (Note: all options will update the remote cache if the right permissions to update cache are given to the user.):
If set to 1, enable javac/r8/d8 support. C++ compilation is enabled by default.
The remote execution service endpoint and instance ID to target when calling remote execution via gRPC to execute actions.
Where to find remote client binaries (rewrapper, reproxy)
reclient uses application default credentials for autentication, as generated by gcloud auth application-default login
Logs generated by rewrapper and reproxy will go here.