Chromium Cloud Quickstart
Utilize NativeLink’s cloud CAS to build your Reclient Chromium projects. The following guide will help you set up your authentication keys (using mTLS) and configure Reclient for remote CAS usage.
Start with Chromium by following the instructions here: Checking out and building Chromium for Linux. Follow the instructions up to “Setting up the build,” then stop and follow our instructions below. Don’t build Chromium yet.
Chromium Recommendations: We recommend creating the Chromium folder under your home directory:
mkdir $HOME/chromium2. Setup your NativeLink configuration directory
Section titled “2. Setup your NativeLink configuration directory”Set up your NativeLink configuration directory by running:
mkdir $HOME/nativelink-reclientFollow the instructions below in your terminal to generate the mTLS keys. These keys allow your local machine to communicate with our remote CAS:
cd $HOME/nativelink-reclientmkdir certs && cd certsopenssl req -x509 -sha256 -newkey rsa:4096 -keyout ca.key -out ca.crt -days 356 -nodes -subj '/CN=NativeLink-Server'openssl req -new -newkey rsa:4096 -keyout client.key -out client.csr -nodes -subj '/CN=NativeLink-Client'openssl x509 -req -sha256 -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 02 -out client.crtVerify your certs are correct by running:
openssl verify -CAfile ca.crt client.crtTo get the contents of your cert, run:
cat ca.crtCreate an environment variables file:
cd $HOME/nativelink-reclienttouch .env.localThen save the below contents into your newly created .env.local file:
# If you have a different CACHE url or# your CERT/KEY is in a different location# you can update those hereexport CACHE_ADDRESS=cas-blake.build-faster.nativelink.net:443export TLS_CLIENT_AUTH_CERT=$HOME/nativelink-reclient/certs/client.crtexport TLS_CLIENT_AUTH_KEY=$HOME/nativelink-reclient/certs/client.key
# Leave below as isexport RBE_service=${CACHE_ADDRESS}export RBE_cas_service=${CACHE_ADDRESS}export RBE_reclient_timeout=60mexport RBE_instance=export RBE_exec_timeout=4mexport RBE_alsologtostderr=trueexport RBE_service_no_security=falseexport RBE_local_resource_fraction=0.00001export RBE_automatic_auth=falseexport RBE_gcert_refresh_timeout=20export RBE_compression_threshold=-1export RBE_metrics_namespace=mainexport RBE_platform=export RBE_experimental_credentials_helper=export RBE_experimental_credentials_helper_args=export RBE_log_http_calls=trueexport RBE_use_rpc_credentials=trueexport RBE_exec_strategy=localexport RBE_remote_disabled=falseexport RBE_tls_client_auth_cert=${TLS_CLIENT_AUTH_CERT}export RBE_tls_client_auth_key=${TLS_CLIENT_AUTH_KEY}export RBE_service_no_auth=trueexport RBE_use_application_default_credentials=trueFirst, run a script to set some final configurations to optimize your build for remote caching. The —src_dir assumes Chromium under the $HOME directory:
cd $HOME/nativelink-reclientgit clone https://github.com/TraceMachina/reclient-configs.gitcd reclient-configspython3 configure_reclient.py --verbose --force --src_dir=$HOME/chromium/srcYou can then run the Chromium build:
cd $HOME/chromium/srcsource $HOME/nativelink-reclient/.env.localrm -rf outgn gen --args="use_remoteexec=true is_debug=false is_component_build=true symbol_level=0 reclient_cfg_dir=\"../../buildtools/reclient_cfgs\"" out/Defaultautoninja -C out/Default chromeIn a new terminal window, execute the following:
watch ${HOME}/chromium/src/buildtools/reclient/reproxystatusTo get started with Chromium, follow the instructions here: Checking out and building Chromium for Mac. As you follow the instructions above, before the step “Setting up the build” stop there and follow our instructions below.
Chromium Recommendations: We recommend creating the Chromium folder under your home directory:
mkdir $HOME/chromiumTo check whether you have XCode properly installed and the Mac SDK present, run:
ls `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKsIf this command doesn’t return MacOSX.sdk (or similar), install the latest version of XCode, and ensure it’s in your /Applications directory. If you’re only seeing the command line tools, this command may fix that:
sudo xcode-select -switch /Applications/XCode.app/Contents/DeveloperWhen you fetch the code, we recommend running the following to speed up your build:
caffeinate fetch --no-history chromium2. Setup your NativeLink configuration directory
Section titled “2. Setup your NativeLink configuration directory”Run the following command:
mkdir $HOME/nativelink-reclientThis folder will contain the configurations for your Reclient setup with NativeLink.
Follow the instructions below in your terminal. This will generate the mTLS keys that allow your local machine to communicate with our remote CAS:
cd $HOME/nativelink-reclientmkdir certs && cd certsopenssl req -x509 -sha256 -newkey rsa:4096 -keyout ca.key -out ca.crt -days 356 -nodes -subj '/CN=NativeLink-Server'openssl req -new -newkey rsa:4096 -keyout client.key -out client.csr -nodes -subj '/CN=NativeLink-Client'openssl x509 -req -sha256 -days 365 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 02 -out client.crtYou can verify your certs are correct by running:
openssl verify -CAfile ca.crt client.crtTo get the contents of your cert, run:
cat ca.crtCreate an environment variables file:
cd $HOME/nativelink-reclienttouch .env.localThen save the below contents into your newly created .env.local file:
# If you have a different CACHE url or# your CERT/KEY is in a different location# you can update those hereexport CACHE_ADDRESS=cas-blake.build-faster.nativelink.net:443export TLS_CLIENT_AUTH_CERT=$HOME/nativelink-reclient/certs/client.crtexport TLS_CLIENT_AUTH_KEY=$HOME/nativelink-reclient/certs/client.key
# Leave below as isexport RBE_service=${CACHE_ADDRESS}export RBE_cas_service=${CACHE_ADDRESS}export RBE_reclient_timeout=60mexport RBE_instance=export RBE_exec_timeout=4mexport RBE_alsologtostderr=trueexport RBE_service_no_security=falseexport RBE_local_resource_fraction=0.00001export RBE_automatic_auth=falseexport RBE_gcert_refresh_timeout=20export RBE_compression_threshold=-1export RBE_metrics_namespace=mainexport RBE_platform=export RBE_experimental_credentials_helper=export RBE_experimental_credentials_helper_args=export RBE_log_http_calls=trueexport RBE_use_rpc_credentials=trueexport RBE_exec_strategy=localexport RBE_remote_disabled=falseexport RBE_tls_client_auth_cert=${TLS_CLIENT_AUTH_CERT}export RBE_tls_client_auth_key=${TLS_CLIENT_AUTH_KEY}export RBE_service_no_auth=trueexport RBE_use_application_default_credentials=trueFirst, we will run a script to set some final configurations to optimize your build for remote caching. The —src_dir assumes Chromium under the $HOME directory:
cd $HOME/nativelink-reclientgit clone https://github.com/TraceMachina/reclient-configs.gitcd reclient-configspython3 configure_reclient.py --verbose --force --src_dir=$HOME/chromium/srcYou can then run the Chromium build:
cd $HOME/chromium/srcsource $HOME/nativelink-reclient/.env.localrm -rf outgn gen --args="use_remoteexec=true is_debug=false is_component_build=true symbol_level=0 reclient_cfg_dir=\"../../buildtools/reclient_cfgs\"" out/Defaultautoninja -C out/Default chromeIn a new terminal window, execute the following:
brew install watchwatch ${HOME}/chromium/src/buildtools/reclient/reproxystatus