Skip to content

Commit 85ae6cc

Browse files
committed
legacy: Builder now support parsing of compiler output
1 parent 520f6c3 commit 85ae6cc

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

legacy/builder/builder_utils/utils.go

+6
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ func compileFileWithRecipe(ctx *types.Context, sourcePath *paths.Path, source *p
198198
}
199199
ctx.WriteStderr(stderr)
200200

201+
// Parse the output of the compiler to gather errors and warnings...
202+
if ctx.CompilerOutputParser != nil {
203+
ctx.CompilerOutputParser(command.Args, stdout)
204+
ctx.CompilerOutputParser(command.Args, stderr)
205+
}
206+
201207
// ...and then return the error
202208
if err != nil {
203209
return nil, errors.WithStack(err)

legacy/builder/types/context.go

+4
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ type Context struct {
163163
// The provided source data is used instead of reading it from disk.
164164
// The keys of the map are paths relative to sketch folder.
165165
SourceOverride map[string]string
166+
167+
// This is a function used to parse the output of the compiler
168+
// It is used to extract errors and warnings
169+
CompilerOutputParser func(cmdline []string, out []byte)
166170
}
167171

168172
// ExecutableSectionSize represents a section of the executable output file

0 commit comments

Comments
 (0)