Building Chromium with Goma

Configuring Chromium

Follow build instructions from here. Remember that you have depot tools already installed so you can skip this part. When asked to run gn, run it as follows:

gn args out/Default

and add following gn args:

use_goma=true
goma_dir="~/goma"
is_debug=false

This will generate build files with Goma being used as the compiler tool.

Setting up Goma Client

Setup environment variables so that Goma client knows the location and configuration of the Goma server.

export GOMA_SERVER_HOST="localhost"
export GOMA_SERVER_PORT="5050"
export GOMA_USE_SSL="false"
export GOMA_ARBITRARY_TOOLCHAIN_SUPPORT=true
export GOMA_USE_LOCAL=false

Logging in into Goma

Before you can use Goma you need to login into the server. You’ll have to login using the Gmail account you have whitelisted when running the server.

To login run:

python3 ~/goma/goma_auth.py login

and follow on screen directions to obtain the access code. When asked to login into a gmail account use the one you have whitelisted when running goma server. Paste the access code back to the terminal and you should see similar output:

Login as kuba.lason@gmail.com
Ready to use Goma service at http://localhost:5050

Starting Goma Client

Run Goma client:

python3 ~/goma/goma_ctl.py ensure_start

The output should be similar to the following one:

using /run/user/1000/goma_kubal as tmpdir

GOMA version 80401d72a6476494ab19ac9bed48a6cccbd6f8e0@1590968656
compiler proxy (pid=69032) status: http://127.0.0.1:8088 ok

Now goma is ready!

You can point your browser to the URL returned by goma client. This is the client status page where you can track all client actions.

Building Chromium with Goma

To test goma run:

ninja -j1 -C out/Default obj/base/base/base64.o

If everything went well your goma status page should list the job in the Finished Tasks section with a RETRY result (this is good - don’t worry about that). To see the cache in action run:

ninja -j1 -C out/Default -t clean
ninja -j1 -C out/Default obj/base/base/base64.o

The finished section of the status page should list a new job - this time with CACHEHIT status.