@@ -41,7 +41,7 @@ func (s *Builder) Run(ctx *types.Context) error {
41
41
return err
42
42
}
43
43
44
- var _err error
44
+ var _err , mainErr error
45
45
commands := []types.Command {
46
46
& ContainerSetupHardwareToolsLibsSketchAndProps {},
47
47
@@ -92,12 +92,25 @@ func (s *Builder) Run(ctx *types.Context) error {
92
92
& RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.postbuild" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
93
93
}
94
94
95
- mainErr := runCommands (ctx , commands )
95
+ ctx .Progress .AddSubSteps (len (commands ) + 4 )
96
+ defer ctx .Progress .RemoveSubSteps ()
97
+
98
+ for _ , command := range commands {
99
+ PrintRingNameIfDebug (ctx , command )
100
+ err := command .Run (ctx )
101
+ if err != nil {
102
+ mainErr = errors .WithStack (err )
103
+ break
104
+ }
105
+ ctx .Progress .CompleteStep ()
106
+ ctx .PushProgress ()
107
+ }
96
108
97
109
if ctx .CompilationDatabase != nil {
98
110
ctx .CompilationDatabase .SaveToFile ()
99
111
}
100
112
113
+ var otherErr error
101
114
commands = []types.Command {
102
115
& PrintUsedAndNotUsedLibraries {SketchError : mainErr != nil },
103
116
@@ -107,7 +120,16 @@ func (s *Builder) Run(ctx *types.Context) error {
107
120
108
121
& phases.Sizer {SketchError : mainErr != nil },
109
122
}
110
- otherErr := runCommands (ctx , commands )
123
+ for _ , command := range commands {
124
+ PrintRingNameIfDebug (ctx , command )
125
+ err := command .Run (ctx )
126
+ if err != nil {
127
+ otherErr = errors .WithStack (err )
128
+ break
129
+ }
130
+ ctx .Progress .CompleteStep ()
131
+ ctx .PushProgress ()
132
+ }
111
133
112
134
if mainErr != nil {
113
135
return mainErr
@@ -193,8 +215,7 @@ func PrintRingNameIfDebug(ctx *types.Context, command types.Command) {
193
215
}
194
216
195
217
func RunBuilder (ctx * types.Context ) error {
196
- command := Builder {}
197
- return command .Run (ctx )
218
+ return runCommands (ctx , []types.Command {& Builder {}})
198
219
}
199
220
200
221
func RunParseHardware (ctx * types.Context ) error {
0 commit comments