Print bootstrap errors through ctx.Status

Blueprint bootstrap was printing the errors directly to stdout, which
resulted in a different format that the buildbots didn't recognize
and extract into build_error.log, and which soong_ui didn't put into
error.log.  Bootstrap then returned a single error "fatal errors
encountered", which was printed by soong_build and soong_ui.

Blueprint now returns all the errors and doesn't print anything,
and lets soong_build and soong_ui print all the errors isntead of
just "fatal errors encountered".  Change bootstrap in soong_ui to
feed the errors through ctx.Status, which will result in them being
handled like any other error, including writing to error.log and
adding the "FAILED:" header on stdout that the buildbots are looking
for.

Bug: 375389896
Test: build with a syntax error
Test: build with a soong error
Flag: EXEMPT host-only
Change-Id: Id4056cfc0e99a84ba05cb0abd9feb9f488a07822
diff --git a/ui/build/soong.go b/ui/build/soong.go
index f70d9b7..ab18dba 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -288,6 +288,15 @@
 	ctx.BeginTrace(metrics.RunSoong, "blueprint bootstrap")
 	defer ctx.EndTrace()
 
+	st := ctx.Status.StartTool()
+	defer st.Finish()
+	st.SetTotalActions(1)
+	action := &status.Action{
+		Description: "bootstrap blueprint",
+		Outputs:     []string{"bootstrap blueprint"},
+	}
+	st.StartAction(action)
+
 	// Clean up some files for incremental builds across incompatible changes.
 	bootstrapEpochCleanup(ctx, config)
 
@@ -407,8 +416,17 @@
 	// since `bootstrap.ninja` is regenerated unconditionally, we ignore the deps, i.e. little
 	// reason to write a `bootstrap.ninja.d` file
 	_, err := bootstrap.RunBlueprint(blueprintArgs, bootstrap.DoEverything, blueprintCtx, blueprintConfig)
+
+	result := status.ActionResult{
+		Action: action,
+	}
 	if err != nil {
-		ctx.Fatal(err)
+		result.Error = err
+		result.Output = err.Error()
+	}
+	st.FinishAction(result)
+	if err != nil {
+		ctx.Fatalf("bootstrap failed")
 	}
 }