Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8b73eee

Browse files
committed
Handle multi-threaded compile streams
1 parent 816a681 commit 8b73eee

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎legacy/builder/builder_utils/utils.go‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,15 @@ func compileFileWithRecipe(ctx *types.Context, sourcePath *paths.Path, source *p
190190
ctx.CompilationDatabase.Add(source, command)
191191
}
192192
if !objIsUpToDate && !ctx.OnlyUpdateCompilationDatabase {
193-
_, _, err = utils.ExecCommand(ctx, command, utils.ShowIfVerbose /* stdout */, utils.Show /* stderr */)
193+
// Since this compile could be multithreaded, we first capture the command output
194+
stdout, stderr, err := utils.ExecCommand(ctx, command, utils.Capture, utils.Capture)
195+
// and transfer all at once at the end...
196+
if ctx.Verbose {
197+
ctx.WriteStdout(stdout)
198+
}
199+
ctx.WriteStderr(stderr)
200+
201+
// ...and then return the error
194202
if err != nil {
195203
return nil, errors.WithStack(err)
196204
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /