From 429f540bd049645468d740c015429b2457f02f2b Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Thu, 11 Aug 2022 17:02:41 -0400 Subject: [PATCH] Write cquery.out even without error This was accidentally suppressed in aosp/2124255, so this reverts that bug. Test: USE_BAZEL_ANALYSIS=1 m nothing && ls out/soong/soong_injection/cquery.out Change-Id: I5331526a766100bb399aac93238919abd1ff5ca2 --- android/bazel_handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/bazel_handler.go b/android/bazel_handler.go index 5804a46ed..000f75980 100644 --- a/android/bazel_handler.go +++ b/android/bazel_handler.go @@ -766,9 +766,9 @@ func (context *bazelContext) InvokeBazel(config Config) error { cqueryOutput, cqueryErr, err := context.issueBazelCommand(context.paths, bazel.CqueryBuildRootRunName, cqueryCmd, "--output=starlark", "--starlark:file="+absolutePath(cqueryFileRelpath)) if err != nil { - _ = ioutil.WriteFile(filepath.Join(soongInjectionPath, "cquery.out"), []byte(cqueryOutput), 0666) + return err } - if err != nil { + if err = ioutil.WriteFile(filepath.Join(soongInjectionPath, "cquery.out"), []byte(cqueryOutput), 0666); err != nil { return err }