From edc63f8381d53ba03515a5004dd03b2676eeb14d Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 11 Jan 2022 22:11:27 +0100 Subject: [PATCH] [breaking] legacy: refactoring of the old `i18n.Logger` (#1621) * LoggerToCustomStreams must have pointer receiver Becuase it has a mutex field that otherwise is copied. * Removed barely used legacy i18n.Logger.UnformattedFprintln function * Removed barely used legacy i18n.Logger.UnformattedWrite function * Removed unused AccumulatorLogger * Added 'percent' to TaskProgress gRPC message * Added gRPC placeholders to report compile progress * legacy: builder task progress is now transferred via TaskProgress callback * Removed unused Logger.Flush interface method * Removed Logger.Name method (use type-assertions instead) * Added note on breaking API change --- cli/compile/compile.go | 4 +- commands/compile/compile.go | 5 +- commands/daemon/daemon.go | 1 + docs/UPGRADING.md | 17 +++ legacy/builder/builder.go | 3 +- legacy/builder/builder_utils/utils.go | 15 +- legacy/builder/container_setup.go | 7 +- legacy/builder/i18n/errors.go | 2 +- legacy/builder/i18n/i18n.go | 150 ++----------------- legacy/builder/phases/libraries_builder.go | 2 +- legacy/builder/test/i18n_test.go | 7 +- legacy/builder/types/context.go | 16 +- legacy/builder/utils/utils.go | 2 +- rpc/cc/arduino/cli/commands/v1/common.pb.go | 88 ++++++----- rpc/cc/arduino/cli/commands/v1/common.proto | 2 + rpc/cc/arduino/cli/commands/v1/compile.pb.go | 54 ++++--- rpc/cc/arduino/cli/commands/v1/compile.proto | 6 +- 17 files changed, 148 insertions(+), 233 deletions(-) diff --git a/cli/compile/compile.go b/cli/compile/compile.go index aa76f807644..05b83b53e90 100644 --- a/cli/compile/compile.go +++ b/cli/compile/compile.go @@ -199,9 +199,9 @@ func runCompileCommand(cmd *cobra.Command, args []string) { var compileRes *rpc.CompileResponse var compileError error if output.OutputFormat == "json" { - compileRes, compileError = compile.Compile(context.Background(), compileRequest, compileStdOut, compileStdErr, verboseCompile) + compileRes, compileError = compile.Compile(context.Background(), compileRequest, compileStdOut, compileStdErr, nil, verboseCompile) } else { - compileRes, compileError = compile.Compile(context.Background(), compileRequest, os.Stdout, os.Stderr, verboseCompile) + compileRes, compileError = compile.Compile(context.Background(), compileRequest, os.Stdout, os.Stderr, nil, verboseCompile) } if compileError == nil && uploadAfterCompile { diff --git a/commands/compile/compile.go b/commands/compile/compile.go index 0407e84fd77..78ee36f98de 100644 --- a/commands/compile/compile.go +++ b/commands/compile/compile.go @@ -46,7 +46,7 @@ import ( var tr = i18n.Tr // Compile FIXMEDOC -func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream io.Writer, debug bool) (r *rpc.CompileResponse, e error) { +func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream io.Writer, progressCB commands.TaskProgressCB, debug bool) (r *rpc.CompileResponse, e error) { // There is a binding between the export binaries setting and the CLI flag to explicitly set it, // since we want this binding to work also for the gRPC interface we must read it here in this @@ -132,6 +132,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream builderCtx.PackageManager = pm builderCtx.FQBN = fqbn builderCtx.SketchLocation = sk.FullPath + builderCtx.ProgressCB = progressCB // FIXME: This will be redundant when arduino-builder will be part of the cli builderCtx.HardwareDirs = configuration.HardwareDirectories(configuration.Settings) @@ -206,7 +207,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream builderCtx.ExecStdout = outStream builderCtx.ExecStderr = errStream - builderCtx.SetLogger(legacyi18n.LoggerToCustomStreams{Stdout: outStream, Stderr: errStream}) + builderCtx.SetLogger(&legacyi18n.LoggerToCustomStreams{Stdout: outStream, Stderr: errStream}) builderCtx.Clean = req.GetClean() builderCtx.OnlyUpdateCompilationDatabase = req.GetCreateCompilationDatabaseOnly() diff --git a/commands/daemon/daemon.go b/commands/daemon/daemon.go index 9f6923d79e9..a86a2cac5a1 100644 --- a/commands/daemon/daemon.go +++ b/commands/daemon/daemon.go @@ -262,6 +262,7 @@ func (s *ArduinoCoreServerImpl) Compile(req *rpc.CompileRequest, stream rpc.Ardu stream.Context(), req, utils.FeedStreamTo(func(data []byte) { stream.Send(&rpc.CompileResponse{OutStream: data}) }), utils.FeedStreamTo(func(data []byte) { stream.Send(&rpc.CompileResponse{ErrStream: data}) }), + func(p *rpc.TaskProgress) { stream.Send(&rpc.CompileResponse{Progress: p}) }, false) // Set debug to false if err != nil { return convertErrorToRPCStatus(err) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 17a720a5f53..0515eeb3365 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -4,6 +4,23 @@ Here you can find a list of migration guides to handle breaking changes between ## Unreleased +### `commands.Compile` function change + +A new argument `progressCB` has been added to `commands.Compile`, the new function signature is: + +```go +func Compile( + ctx context.Context, + req *rpc.CompileRequest, + outStream, errStream io.Writer, + progressCB commands.TaskProgressCB, + debug bool +) (r *rpc.CompileResponse, e error) { +``` + +if a callback function is provided the `Compile` command will call it periodically with progress reports with the +percentage of compilation completed, otherwise, if the parameter is `nil`, no progress reports will be performed. + ### `github.com/arduino/arduino-cli/cli/arguments.ParseReferences` function change The `parseArch` parameter was removed since it was unused and was always true. This means that the architecture gets diff --git a/legacy/builder/builder.go b/legacy/builder/builder.go index 07606162104..f4de21815d1 100644 --- a/legacy/builder/builder.go +++ b/legacy/builder/builder.go @@ -23,7 +23,6 @@ import ( "github.com/arduino/arduino-cli/arduino/sketch" "github.com/arduino/arduino-cli/i18n" - "github.com/arduino/arduino-cli/legacy/builder/builder_utils" "github.com/arduino/arduino-cli/legacy/builder/phases" "github.com/arduino/arduino-cli/legacy/builder/types" "github.com/arduino/arduino-cli/legacy/builder/utils" @@ -195,7 +194,7 @@ func runCommands(ctx *types.Context, commands []types.Command) error { return errors.WithStack(err) } ctx.Progress.CompleteStep() - builder_utils.PrintProgressIfProgressEnabledAndMachineLogger(ctx) + ctx.PushProgress() } return nil } diff --git a/legacy/builder/builder_utils/utils.go b/legacy/builder/builder_utils/utils.go index 5a504aa29a2..e5cc2c25cee 100644 --- a/legacy/builder/builder_utils/utils.go +++ b/legacy/builder/builder_utils/utils.go @@ -20,7 +20,6 @@ import ( "os/exec" "path/filepath" "runtime" - "strconv" "strings" "sync" @@ -35,18 +34,6 @@ import ( var tr = i18n.Tr -func PrintProgressIfProgressEnabledAndMachineLogger(ctx *types.Context) { - - if !ctx.Progress.PrintEnabled { - return - } - - log := ctx.GetLogger() - if log.Name() == "machine" { - log.Println(constants.LOG_LEVEL_INFO, tr("Progress {0}"), strconv.FormatFloat(float64(ctx.Progress.Progress), 'f', 2, 32)) - } -} - func CompileFilesRecursive(ctx *types.Context, sourcePath *paths.Path, buildPath *paths.Path, buildProperties *properties.Map, includes []string) (paths.PathList, error) { objectFiles, err := CompileFiles(ctx, sourcePath, false, buildPath, buildProperties, includes) if err != nil { @@ -215,7 +202,7 @@ func compileFilesWithRecipe(ctx *types.Context, sourcePath *paths.Path, sources queue <- source ctx.Progress.CompleteStep() - PrintProgressIfProgressEnabledAndMachineLogger(ctx) + ctx.PushProgress() } close(queue) wg.Wait() diff --git a/legacy/builder/container_setup.go b/legacy/builder/container_setup.go index e2f01ec3616..9fe44f99fe3 100644 --- a/legacy/builder/container_setup.go +++ b/legacy/builder/container_setup.go @@ -19,7 +19,6 @@ import ( "fmt" sk "github.com/arduino/arduino-cli/arduino/sketch" - "github.com/arduino/arduino-cli/legacy/builder/builder_utils" "github.com/arduino/arduino-cli/legacy/builder/types" "github.com/pkg/errors" ) @@ -50,7 +49,7 @@ func (s *ContainerSetupHardwareToolsLibsSketchAndProps) Run(ctx *types.Context) return errors.WithStack(err) } ctx.Progress.CompleteStep() - builder_utils.PrintProgressIfProgressEnabledAndMachineLogger(ctx) + ctx.PushProgress() } if ctx.SketchLocation != nil { @@ -78,7 +77,7 @@ func (s *ContainerSetupHardwareToolsLibsSketchAndProps) Run(ctx *types.Context) ctx.Sketch = sketch } ctx.Progress.CompleteStep() - builder_utils.PrintProgressIfProgressEnabledAndMachineLogger(ctx) + ctx.PushProgress() commands = []types.Command{ &SetupBuildProperties{}, @@ -94,7 +93,7 @@ func (s *ContainerSetupHardwareToolsLibsSketchAndProps) Run(ctx *types.Context) return errors.WithStack(err) } ctx.Progress.CompleteStep() - builder_utils.PrintProgressIfProgressEnabledAndMachineLogger(ctx) + ctx.PushProgress() } return nil diff --git a/legacy/builder/i18n/errors.go b/legacy/builder/i18n/errors.go index f21bde19fbc..4080742690b 100644 --- a/legacy/builder/i18n/errors.go +++ b/legacy/builder/i18n/errors.go @@ -8,7 +8,7 @@ import ( ) func ErrorfWithLogger(logger Logger, format string, a ...interface{}) error { - if logger.Name() == "machine" { + if _, isMachineLogger := logger.(*MachineLogger); isMachineLogger { logger.Fprintln(os.Stderr, constants.LOG_LEVEL_ERROR, format, a...) return errors.New("") } diff --git a/legacy/builder/i18n/i18n.go b/legacy/builder/i18n/i18n.go index 0cc3112940f..3d745f0a49b 100644 --- a/legacy/builder/i18n/i18n.go +++ b/legacy/builder/i18n/i18n.go @@ -26,15 +26,11 @@ import ( "sync" ) -var PLACEHOLDER = regexp.MustCompile("{(\\d)}") +var PLACEHOLDER = regexp.MustCompile(`{(\d)}`) type Logger interface { Fprintln(w io.Writer, level string, format string, a ...interface{}) - UnformattedFprintln(w io.Writer, s string) - UnformattedWrite(w io.Writer, data []byte) Println(level string, format string, a ...interface{}) - Name() string - Flush() string } type LoggerToCustomStreams struct { @@ -43,7 +39,7 @@ type LoggerToCustomStreams struct { mux sync.Mutex } -func (s LoggerToCustomStreams) Fprintln(w io.Writer, level string, format string, a ...interface{}) { +func (s *LoggerToCustomStreams) Fprintln(w io.Writer, level string, format string, a ...interface{}) { s.mux.Lock() defer s.mux.Unlock() target := s.Stdout @@ -53,165 +49,47 @@ func (s LoggerToCustomStreams) Fprintln(w io.Writer, level string, format string fmt.Fprintln(target, Format(format, a...)) } -func (s LoggerToCustomStreams) UnformattedFprintln(w io.Writer, str string) { - s.mux.Lock() - defer s.mux.Unlock() - target := s.Stdout - if w == os.Stderr { - target = s.Stderr - } - fmt.Fprintln(target, str) -} - -func (s LoggerToCustomStreams) UnformattedWrite(w io.Writer, data []byte) { - s.mux.Lock() - defer s.mux.Unlock() - target := s.Stdout - if w == os.Stderr { - target = s.Stderr - } - target.Write(data) -} - -func (s LoggerToCustomStreams) Println(level string, format string, a ...interface{}) { +func (s *LoggerToCustomStreams) Println(level string, format string, a ...interface{}) { s.Fprintln(nil, level, format, a...) } -func (s LoggerToCustomStreams) Flush() string { - return "" -} - -func (s LoggerToCustomStreams) Name() string { - return "LoggerToCustomStreams" -} - type NoopLogger struct{} -func (s NoopLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) {} - -func (s NoopLogger) UnformattedFprintln(w io.Writer, str string) {} +func (s *NoopLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) {} -func (s NoopLogger) UnformattedWrite(w io.Writer, data []byte) {} - -func (s NoopLogger) Println(level string, format string, a ...interface{}) {} - -func (s NoopLogger) Flush() string { - return "" -} - -func (s NoopLogger) Name() string { - return "noop" -} - -type AccumulatorLogger struct { - Buffer *[]string -} - -func (s AccumulatorLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) { - *s.Buffer = append(*s.Buffer, Format(format, a...)) -} - -func (s AccumulatorLogger) UnformattedFprintln(w io.Writer, str string) { - *s.Buffer = append(*s.Buffer, str) -} - -func (s AccumulatorLogger) UnformattedWrite(w io.Writer, data []byte) { - *s.Buffer = append(*s.Buffer, string(data)) -} - -func (s AccumulatorLogger) Println(level string, format string, a ...interface{}) { - s.Fprintln(nil, level, format, a...) -} - -func (s AccumulatorLogger) Flush() string { - str := strings.Join(*s.Buffer, "\n") - *s.Buffer = (*s.Buffer)[0:0] - return str -} - -func (s AccumulatorLogger) Name() string { - return "accumulator" -} +func (s *NoopLogger) Println(level string, format string, a ...interface{}) {} type HumanTagsLogger struct{} -func (s HumanTagsLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) { +func (s *HumanTagsLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) { format = "[" + level + "] " + format fprintln(w, Format(format, a...)) } -func (s HumanTagsLogger) Println(level string, format string, a ...interface{}) { +func (s *HumanTagsLogger) Println(level string, format string, a ...interface{}) { s.Fprintln(os.Stdout, level, format, a...) } -func (s HumanTagsLogger) UnformattedFprintln(w io.Writer, str string) { - fprintln(w, str) -} - -func (s HumanTagsLogger) UnformattedWrite(w io.Writer, data []byte) { - write(w, data) -} - -func (s HumanTagsLogger) Flush() string { - return "" -} - -func (s HumanTagsLogger) Name() string { - return "humantags" -} - type HumanLogger struct{} -func (s HumanLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) { +func (s *HumanLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) { fprintln(w, Format(format, a...)) } -func (s HumanLogger) Println(level string, format string, a ...interface{}) { +func (s *HumanLogger) Println(level string, format string, a ...interface{}) { s.Fprintln(os.Stdout, level, format, a...) } -func (s HumanLogger) UnformattedFprintln(w io.Writer, str string) { - fprintln(w, str) -} - -func (s HumanLogger) UnformattedWrite(w io.Writer, data []byte) { - write(w, data) -} - -func (s HumanLogger) Flush() string { - return "" -} - -func (s HumanLogger) Name() string { - return "human" -} - type MachineLogger struct{} -func (s MachineLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) { +func (s *MachineLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) { printMachineFormattedLogLine(w, level, format, a) } -func (s MachineLogger) Println(level string, format string, a ...interface{}) { +func (s *MachineLogger) Println(level string, format string, a ...interface{}) { printMachineFormattedLogLine(os.Stdout, level, format, a) } -func (s MachineLogger) UnformattedFprintln(w io.Writer, str string) { - fprintln(w, str) -} - -func (s MachineLogger) Flush() string { - return "" -} - -func (s MachineLogger) Name() string { - return "machine" -} - -func (s MachineLogger) UnformattedWrite(w io.Writer, data []byte) { - write(w, data) -} - func printMachineFormattedLogLine(w io.Writer, level string, format string, a []interface{}) { a = append([]interface{}(nil), a...) for idx, value := range a { @@ -232,12 +110,6 @@ func fprintln(w io.Writer, s string) { fmt.Fprintln(w, s) } -func write(w io.Writer, data []byte) { - lock.Lock() - defer lock.Unlock() - w.Write(data) -} - func fprintf(w io.Writer, format string, a ...interface{}) { lock.Lock() defer lock.Unlock() diff --git a/legacy/builder/phases/libraries_builder.go b/legacy/builder/phases/libraries_builder.go index a5253f76303..7253c8a67e9 100644 --- a/legacy/builder/phases/libraries_builder.go +++ b/legacy/builder/phases/libraries_builder.go @@ -123,7 +123,7 @@ func compileLibraries(ctx *types.Context, libraries libraries.List, buildPath *p objectFiles.AddAll(libraryObjectFiles) ctx.Progress.CompleteStep() - builder_utils.PrintProgressIfProgressEnabledAndMachineLogger(ctx) + ctx.PushProgress() } return objectFiles, nil diff --git a/legacy/builder/test/i18n_test.go b/legacy/builder/test/i18n_test.go index a66f50ec6c3..f6866ca73fd 100644 --- a/legacy/builder/test/i18n_test.go +++ b/legacy/builder/test/i18n_test.go @@ -17,10 +17,11 @@ package test import ( "fmt" + "testing" + "github.com/arduino/arduino-cli/legacy/builder/constants" "github.com/arduino/arduino-cli/legacy/builder/i18n" "github.com/stretchr/testify/require" - "testing" ) func TestI18NSyntax(t *testing.T) { @@ -50,9 +51,9 @@ func TestI18NSyntax(t *testing.T) { func TestI18NInheritance(t *testing.T) { var logger i18n.Logger - logger = i18n.HumanLogger{} + logger = &i18n.HumanLogger{} logger.Println(constants.LOG_LEVEL_INFO, "good {0} {1}", "morning", "vietnam!") - logger = i18n.MachineLogger{} + logger = &i18n.MachineLogger{} logger.Println(constants.LOG_LEVEL_INFO, "good {0} {1}", "morning", "vietnam!") } diff --git a/legacy/builder/types/context.go b/legacy/builder/types/context.go index a3f8ee98626..5f8a92b2259 100644 --- a/legacy/builder/types/context.go +++ b/legacy/builder/types/context.go @@ -26,6 +26,7 @@ import ( "github.com/arduino/arduino-cli/arduino/libraries/librariesmanager" "github.com/arduino/arduino-cli/arduino/libraries/librariesresolver" "github.com/arduino/arduino-cli/arduino/sketch" + "github.com/arduino/arduino-cli/commands" "github.com/arduino/arduino-cli/legacy/builder/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" paths "github.com/arduino/go-paths-helper" @@ -33,10 +34,9 @@ import ( ) type ProgressStruct struct { - PrintEnabled bool - Progress float32 - StepAmount float32 - Parent *ProgressStruct + Progress float32 + StepAmount float32 + Parent *ProgressStruct } func (p *ProgressStruct) AddSubSteps(steps int) { @@ -144,6 +144,8 @@ type Context struct { // Dry run, only create progress map Progress ProgressStruct + // Send progress events to this callback + ProgressCB commands.TaskProgressCB // Contents of a custom build properties file (line by line) CustomBuildProperties []string @@ -254,3 +256,9 @@ func (ctx *Context) GetLogger() i18n.Logger { func (ctx *Context) SetLogger(l i18n.Logger) { ctx.logger = l } + +func (ctx *Context) PushProgress() { + if ctx.ProgressCB != nil { + ctx.ProgressCB(&rpc.TaskProgress{Percent: ctx.Progress.Progress}) + } +} diff --git a/legacy/builder/utils/utils.go b/legacy/builder/utils/utils.go index 3efccb5a0d1..e8feb19ddf2 100644 --- a/legacy/builder/utils/utils.go +++ b/legacy/builder/utils/utils.go @@ -183,7 +183,7 @@ func ExecCommand(ctx *types.Context, command *exec.Cmd, stdout int, stderr int) } if ctx.Verbose { - ctx.GetLogger().UnformattedFprintln(os.Stdout, PrintableCommand(command.Args)) + ctx.GetLogger().Println("info", "{0}", PrintableCommand(command.Args)) } if stdout == Capture { diff --git a/rpc/cc/arduino/cli/commands/v1/common.pb.go b/rpc/cc/arduino/cli/commands/v1/common.pb.go index 61bf195e536..795e640c9b7 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/common.pb.go @@ -178,6 +178,8 @@ type TaskProgress struct { Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // Whether the task is complete. Completed bool `protobuf:"varint,3,opt,name=completed,proto3" json:"completed,omitempty"` + // Amount in percent of the task completion (optional) + Percent float32 `protobuf:"fixed32,4,opt,name=percent,proto3" json:"percent,omitempty"` } func (x *TaskProgress) Reset() { @@ -233,6 +235,13 @@ func (x *TaskProgress) GetCompleted() bool { return false } +func (x *TaskProgress) GetPercent() float32 { + if x != nil { + return x.Percent + } + return 0 +} + type Programmer struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -563,50 +572,51 @@ var file_cc_arduino_cli_commands_v1_common_proto_rawDesc = []byte{ 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, - 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x5a, 0x0a, 0x0c, 0x54, 0x61, 0x73, + 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x74, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x6f, 0x6d, 0x70, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x4c, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, - 0x6d, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0xbe, 0x02, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x61, - 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, - 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, - 0x73, 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x39, 0x0a, 0x06, 0x62, 0x6f, - 0x61, 0x72, 0x64, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, - 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x06, 0x62, - 0x6f, 0x61, 0x72, 0x64, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, - 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, - 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x22, 0x3d, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x05, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x66, 0x71, 0x62, 0x6e, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, - 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, - 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x22, + 0x4c, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xbe, 0x02, + 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x39, 0x0a, 0x06, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x06, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x12, + 0x2d, 0x0a, 0x12, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6e, + 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, 0x3d, + 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, + 0x05, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, + 0x62, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x42, 0x48, + 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, + 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, + 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, + 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/rpc/cc/arduino/cli/commands/v1/common.proto b/rpc/cc/arduino/cli/commands/v1/common.proto index 4e9a5e3b8a9..ebeba0cc027 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.proto +++ b/rpc/cc/arduino/cli/commands/v1/common.proto @@ -44,6 +44,8 @@ message TaskProgress { string message = 2; // Whether the task is complete. bool completed = 3; + // Amount in percent of the task completion (optional) + float percent = 4; } message Programmer { diff --git a/rpc/cc/arduino/cli/commands/v1/compile.pb.go b/rpc/cc/arduino/cli/commands/v1/compile.pb.go index a24fb712bda..e283180547a 100644 --- a/rpc/cc/arduino/cli/commands/v1/compile.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/compile.pb.go @@ -283,9 +283,9 @@ type CompileResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The output of the compilation process. + // The output of the compilation process (stream) OutStream []byte `protobuf:"bytes,1,opt,name=out_stream,json=outStream,proto3" json:"out_stream,omitempty"` - // The error output of the compilation process. + // The error output of the compilation process (stream) ErrStream []byte `protobuf:"bytes,2,opt,name=err_stream,json=errStream,proto3" json:"err_stream,omitempty"` // The compiler build path BuildPath string `protobuf:"bytes,3,opt,name=build_path,json=buildPath,proto3" json:"build_path,omitempty"` @@ -297,6 +297,8 @@ type CompileResponse struct { BoardPlatform *PlatformReference `protobuf:"bytes,6,opt,name=board_platform,json=boardPlatform,proto3" json:"board_platform,omitempty"` // The platform used for the build (if referenced from the board platform) BuildPlatform *PlatformReference `protobuf:"bytes,7,opt,name=build_platform,json=buildPlatform,proto3" json:"build_platform,omitempty"` + // Completions reports of the compilation process (stream) + Progress *TaskProgress `protobuf:"bytes,8,opt,name=progress,proto3" json:"progress,omitempty"` } func (x *CompileResponse) Reset() { @@ -380,6 +382,13 @@ func (x *CompileResponse) GetBuildPlatform() *PlatformReference { return nil } +func (x *CompileResponse) GetProgress() *TaskProgress { + if x != nil { + return x.Progress + } + return nil +} + type ExecutableSectionSize struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -514,7 +523,7 @@ var file_cc_arduino_cli_commands_v1_compile_proto_rawDesc = []byte{ 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd3, 0x03, 0x0a, 0x0f, 0x43, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x99, 0x04, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6f, 0x75, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1d, 0x0a, @@ -544,17 +553,22 @@ var file_cc_arduino_cli_commands_v1_compile_proto_rawDesc = []byte{ 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0d, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x22, 0x5a, 0x0a, 0x15, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, - 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x48, 0x5a, 0x46, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, - 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, - 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x44, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, + 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x5a, 0x0a, 0x15, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, + 0x7a, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, + 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, + 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, + 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -579,6 +593,7 @@ var file_cc_arduino_cli_commands_v1_compile_proto_goTypes = []interface{}{ (*wrapperspb.BoolValue)(nil), // 5: google.protobuf.BoolValue (*Library)(nil), // 6: cc.arduino.cli.commands.v1.Library (*PlatformReference)(nil), // 7: cc.arduino.cli.commands.v1.PlatformReference + (*TaskProgress)(nil), // 8: cc.arduino.cli.commands.v1.TaskProgress } var file_cc_arduino_cli_commands_v1_compile_proto_depIdxs = []int32{ 4, // 0: cc.arduino.cli.commands.v1.CompileRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance @@ -588,11 +603,12 @@ var file_cc_arduino_cli_commands_v1_compile_proto_depIdxs = []int32{ 2, // 4: cc.arduino.cli.commands.v1.CompileResponse.executable_sections_size:type_name -> cc.arduino.cli.commands.v1.ExecutableSectionSize 7, // 5: cc.arduino.cli.commands.v1.CompileResponse.board_platform:type_name -> cc.arduino.cli.commands.v1.PlatformReference 7, // 6: cc.arduino.cli.commands.v1.CompileResponse.build_platform:type_name -> cc.arduino.cli.commands.v1.PlatformReference - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 8, // 7: cc.arduino.cli.commands.v1.CompileResponse.progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_cc_arduino_cli_commands_v1_compile_proto_init() } diff --git a/rpc/cc/arduino/cli/commands/v1/compile.proto b/rpc/cc/arduino/cli/commands/v1/compile.proto index ac97c590bad..2288675cb4e 100644 --- a/rpc/cc/arduino/cli/commands/v1/compile.proto +++ b/rpc/cc/arduino/cli/commands/v1/compile.proto @@ -83,9 +83,9 @@ message CompileRequest { } message CompileResponse { - // The output of the compilation process. + // The output of the compilation process (stream) bytes out_stream = 1; - // The error output of the compilation process. + // The error output of the compilation process (stream) bytes err_stream = 2; // The compiler build path string build_path = 3; @@ -97,6 +97,8 @@ message CompileResponse { PlatformReference board_platform = 6; // The platform used for the build (if referenced from the board platform) PlatformReference build_platform = 7; + // Completions reports of the compilation process (stream) + TaskProgress progress = 8; } message ExecutableSectionSize {