Skip to content

Commit fec9619

Browse files
committed
legacy: Builder now support parsing of compiler output
1 parent 0ab9120 commit fec9619

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: 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)

Diff for: legacy/builder/types/context.go

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

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

0 commit comments

Comments
 (0)