commit | 603dfba63fe365a01879029588b48b6f122fe0b8 | [log] [tgz] |
---|---|---|
author | Goma Authors <goma-dev@google.com> | Fri Sep 22 01:01:35 2023 |
committer | Junji Watanabe <jwata@google.com> | Wed Sep 27 02:42:09 2023 |
tree | c9a52a3c4b9de6dfd114327da7c3f81b612f2576 | |
parent | f25b26723f9344697b3651ed7d07c5cce018da65 [diff] |
Import changes for goma client - 3759da6a4d315b72de7eb91ef988d867b930cfbb Roll boringssl from ecb7e9ae5cf7 to a1843d660b47 (2 revis... - 23b845f36cd3afef2e36f18e411f902980f392b3 Roll clang from 31a7453f896c to ac34945aad34 (1 revision) - 73afc58a50986ff2c886ed7928ae1173bac4b684 Fix __is_target_os() for macOS Bug: b/301042082 GitOrigin-RevId: 3759da6a4d315b72de7eb91ef988d867b930cfbb Change-Id: I6082bcadc597ad498b0f92ac2719fc50d6d3bdcc
Goma is a distributed compiler service for open-source project such as Chromium and Android. It's some kind of replacement of distcc+ccache.
NOTE: For non-Googler usage, please see Goma for Chromium Contributors.
Google employees interested in contributing to the goma client should use internal version. see http://go/ma-client-code
Goma hooks a compile request, and sends it to a backend compile server. If you have plenty of backend servers, a lot of compile can be processed in parallel, for example, -j100, -j500 or -j1000.
Also, the Goma backend caches the compile result. If the same compile request comes, the cached result is returned from the Goma cache server.
Goma client can be built on Linux, Mac, and Win.
$ mkdir goma && cd goma $ gclient config https://chromium.googlesource.com/infra/goma/client $ gclient sync $ cd client
We assume the Goma client code is checked out to ${GOMA_SRC}
. You can set this in your environment, but do not export
it as it will make gomacc
complain.
If you want to develop goma client, make goma client source unmanaged by gclient. Open .gclient
file, and check "managed"
value. If it's True
, changed it to False
. Otherwise, gclient will manage your repository, so your checkout can be unintentionally changed with gclient sync
.
Move to client
directory (which is under git repo), and configure git repository with your username and emails.
$ cd client $ git config user.email 'foo@example.com' $ git config user.name 'Your Name'
$ cd "${GOMA_SRC}/client" $ gclient sync $ gn gen --args="is_debug=false" out/Release $ ninja -C out/Release
The build option can be modified with gn args.
is_debug=true/false Do debug build if true. dcheck_always_on=true/false Enable DCHECK always (even in release build). is_asan=true/false Use ASan build (with clang). use_link_time_optimization=true/false Currently working only on Win. If true, /LTCG is enable. use_lld=true/false Use lld for link (it will be fast)
$ cd "${GOMA_SRC}/client" $ ./build/run_unittest.py --target=Release --build-dir=out
Follow Google code style.
For C++11/14 features, we prefer to follow Chromium's guidelines.
Goma can be integrated with Chromium development easily.
$ "${GOMA_SRC}/client/out/Release/goma_ctl.py" start
In Chromium src, specify the following args in gn args
use_goma = true goma_dir = "${GOMA_SRC}/client/out/Release" (Replace ${GOMA_SRC} to your checkout)
Then build like the following:
$ cd /path/to/chromium/src/out/Release $ ninja -j100 chrome
More details are avairable in chromium's build instructions.
compiler_proxy
$ ./goma_ctl.py ensure_start
gomacc
is prepended to compiler command. For example:$ gomacc clang++ -c foo.cc
make -j100
, ninja -j100
or larger -j. Check http://localhost:8088 to see compiler_proxy is actually working.depot_tools
instead of specifying gomacc manually.