Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba88dbfd authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Print bootstrap errors through ctx.Status" into main

parents 219dd723 98bb3b8e
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -287,6 +287,15 @@ func bootstrapBlueprint(ctx Context, config Config) {
	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)

@@ -395,8 +404,17 @@ func bootstrapBlueprint(ctx Context, config Config) {
	// 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 {
		result.Error = err
		result.Output = err.Error()
	}
	st.FinishAction(result)
	if err != nil {
		ctx.Fatal(err)
		ctx.Fatalf("bootstrap failed")
	}
}