diff --git a/internal/orchestrator/orchestrator.go b/internal/orchestrator/orchestrator.go index 8eb26001..b6e61b59 100644 --- a/internal/orchestrator/orchestrator.go +++ b/internal/orchestrator/orchestrator.go @@ -1184,7 +1184,7 @@ func compileUploadSketch( response = helpers.ArduinoCLIDownloadProgressToString(progress) } case *rpc.InitResponse_Error: - response = "Error: " + msg.Error.String() + response = "Error: " + msg.Error.String() + "\n" case *rpc.InitResponse_Profile: response = fmt.Sprintf( "Sketch profile configured: Name=%q, Port=%q", @@ -1192,7 +1192,7 @@ func compileUploadSketch( msg.Profile.GetPort(), ) } - if _, err := w.Write([]byte(response + "\n")); err != nil { + if _, err := w.Write([]byte(response)); err != nil { return err } @@ -1202,14 +1202,19 @@ func compileUploadSketch( return err } + callback := NewCallbackWriter(func(line string) { + _, _ = w.Write([]byte(".\n")) + }) + // build the sketch - server, getCompileResult := commands.CompilerServerToStreams(ctx, w, w, nil) + server, getCompileResult := commands.CompilerServerToStreams(ctx, callback, w, nil) compileReq := rpc.CompileRequest{ Instance: inst, Fqbn: "arduino:zephyr:unoq", SketchPath: sketchPath.String(), BuildPath: buildPath, Jobs: 2, + Verbose: true, } err = srv.Compile(&compileReq, server) @@ -1224,13 +1229,20 @@ func compileUploadSketch( boardPlatform := result.GetBoardPlatform() if boardPlatform != nil { slog.Info("Board platform: " + boardPlatform.GetId() + " (" + boardPlatform.GetVersion() + ") in " + boardPlatform.GetInstallDir()) + + w.Write([]byte("Board platform: " + boardPlatform.GetId() + " (" + boardPlatform.GetVersion() + ") in " + boardPlatform.GetInstallDir() + "\n")) } buildPlatform := result.GetBuildPlatform() if buildPlatform != nil && buildPlatform.GetInstallDir() != boardPlatform.GetInstallDir() { slog.Info("Build platform: " + buildPlatform.GetId() + " (" + buildPlatform.GetVersion() + ") in " + buildPlatform.GetInstallDir()) + + w.Write([]byte("Build platform: " + buildPlatform.GetId() + " (" + buildPlatform.GetVersion() + ") in " + buildPlatform.GetInstallDir() + "\n")) + } for _, lib := range result.GetUsedLibraries() { slog.Info("Used library " + lib.GetName() + " (" + lib.GetVersion() + ") in " + lib.GetInstallDir()) + + w.Write([]byte("Used library " + lib.GetName() + " (" + lib.GetVersion() + ") in " + lib.GetInstallDir() + "\n")) } if err := uploadSketchInRam(ctx, w, srv, inst, sketchPath.String(), buildPath); err != nil {