diff options
| author | Colin Cross <ccross@android.com> | 2019-11-11 14:57:42 -0800 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2019-11-11 16:08:42 -0800 |
| commit | 9016b91290ae61e6d8daebe60ae8dcafb497f8fe (patch) | |
| tree | 23ef8aa98b13009d413038389e6342250a93ae5f /ui | |
| parent | 2d5ce8538b74b983b3b58d67a1c5272258d6bf26 (diff) | |
| download | build_soong-9016b91290ae61e6d8daebe60ae8dcafb497f8fe.tar.gz build_soong-9016b91290ae61e6d8daebe60ae8dcafb497f8fe.tar.bz2 build_soong-9016b91290ae61e6d8daebe60ae8dcafb497f8fe.zip | |
Set default pool when RBE or goma is enabled
Pass --default_pool=local_pool to kati when RBE or goma is enabled
to put most rules into the local_pool. Specific rules that support
RBE or goma will set .KATI_NINJA_POOL := none to remove themselves
from the local_pool. Passing --default_pool will also disable the
hack in kati that sets the pool based on the presence of the string
"/gomacc" in the command line.
Fixes: 143938974
Test: inspect pools in build-${TARGET-PRODUCT}.ninja for m USE_RBE=true
Test: inspect pools in build-${TARGET-PRODUCT}.ninja for m USE_GOMA=true
Change-Id: I839b2488383fcd63fffd613e25b0b9abcb72b567
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/build/config.go | 4 | ||||
| -rw-r--r-- | ui/build/kati.go | 4 | ||||
| -rw-r--r-- | ui/build/ninja.go | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/ui/build/config.go b/ui/build/config.go index 92aee4d8..c8670ae2 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -767,6 +767,10 @@ func (c *configImpl) StartRBE() bool { return true } +func (c *configImpl) UseRemoteBuild() bool { + return c.UseGoma() || c.UseRBE() +} + // RemoteParallel controls how many remote jobs (i.e., commands which contain // gomacc) are run in parallel. Note the parallelism of all other jobs is // still limited by Parallel() diff --git a/ui/build/kati.go b/ui/build/kati.go index a7799ead..307475a9 100644 --- a/ui/build/kati.go +++ b/ui/build/kati.go @@ -89,6 +89,10 @@ func runKati(ctx Context, config Config, extraSuffix string, args []string, envF args = append(args, "--empty_ninja_file") } + if config.UseRemoteBuild() { + args = append(args, "--default_pool=local_pool") + } + cmd := Command(ctx, config, "ckati", executable, args...) cmd.Sandbox = katiSandbox pipe, err := cmd.StdoutPipe() diff --git a/ui/build/ninja.go b/ui/build/ninja.go index 66750d61..d5baafe7 100644 --- a/ui/build/ninja.go +++ b/ui/build/ninja.go @@ -43,7 +43,7 @@ func runNinja(ctx Context, config Config) { args = append(args, config.NinjaArgs()...) var parallel int - if config.UseGoma() || config.UseRBE() { + if config.UseRemoteBuild() { parallel = config.RemoteParallel() } else { parallel = config.Parallel() |
