From 3060ec77312fcd76741dff321d852fb691db227b Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Mon, 9 Nov 2020 20:08:36 -0500 Subject: [PATCH] Stop first pass of mixed bazel builds before writing ninja This shaves off ~20s, which is ~11%, of `m nothing` with mixed builds. Test: Manual verification with mixed builds of aosp_flame. Change-Id: Ief1bc56c92329e899c829fc1374eea9ee9b94fb7 --- cmd/soong_build/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go index 9d7dddd84..fe413f301 100644 --- a/cmd/soong_build/main.go +++ b/cmd/soong_build/main.go @@ -95,6 +95,7 @@ func main() { // TODO(cparsons): Don't output any ninja file, as the second pass will overwrite // the incorrect results from the first pass, and file I/O is expensive. firstCtx := newContext(srcDir, configuration) + configuration.SetStopBefore(bootstrap.StopBeforeWriteNinja) bootstrap.Main(firstCtx.Context, configuration, extraNinjaDeps...) // Invoke bazel commands and save results for second pass. if err := configuration.BazelContext.InvokeBazel(); err != nil {