diff --git a/cli/compile/compile.go b/cli/compile/compile.go index 4b095cdf592..5e600ec71e0 100644 --- a/cli/compile/compile.go +++ b/cli/compile/compile.go @@ -55,7 +55,6 @@ var ( optimizeForDebug bool // Optimize compile output for debug, not for release programmer string // Use the specified programmer to upload clean bool // Cleanup the build folder and do not use any cached build - exportBinaries bool // Copies compiled binaries to sketch folder when true compilationDatabaseOnly bool // Only create compilation database without actually compiling sourceOverrides string // Path to a .json file that contains a set of replacements of the sketch source code. ) @@ -100,8 +99,7 @@ func NewCommand() *cobra.Command { command.Flags().StringVarP(&programmer, "programmer", "P", "", "Optional, use the specified programmer to upload.") command.Flags().BoolVar(&compilationDatabaseOnly, "only-compilation-database", false, "Just produce the compilation database, without actually compiling.") command.Flags().BoolVar(&clean, "clean", false, "Optional, cleanup the build folder and do not use any cached build.") - // We must use the following syntax for this flag since it's also bound to settings, we could use the other one too - // but it wouldn't make sense since we still must explicitly set the exportBinaries variable by reading from settings. + // We must use the following syntax for this flag since it's also bound to settings. // This must be done because the value is set when the binding is accessed from viper. Accessing from cobra would only // read the value if the flag is set explicitly by the user. command.Flags().BoolP("export-binaries", "e", false, "If set built binaries will be exported to the sketch folder.") @@ -137,11 +135,6 @@ func run(cmd *cobra.Command, args []string) { } } - // We must read this from settings since the value is set when the binding is accessed from viper, - // accessing it from cobra would only read it if the flag is explicitly set by the user and ignore - // the config file and the env vars. - exportBinaries = configuration.Settings.GetBool("sketch.always_export_binaries") - var overrides map[string]string if sourceOverrides != "" { data, err := paths.New(sourceOverrides).ReadFile() @@ -176,7 +169,6 @@ func run(cmd *cobra.Command, args []string) { Libraries: libraries, OptimizeForDebug: optimizeForDebug, Clean: clean, - ExportBinaries: exportBinaries, CreateCompilationDatabaseOnly: compilationDatabaseOnly, SourceOverride: overrides, } diff --git a/commands/compile/compile.go b/commands/compile/compile.go index e43b0b72e47..7003bdfb88b 100644 --- a/commands/compile/compile.go +++ b/commands/compile/compile.go @@ -45,6 +45,19 @@ import ( // Compile FIXMEDOC func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.Writer, debug bool) (r *rpc.CompileResp, 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 + // package instead of the cli/compile one, otherwise we'd lose the binding. + exportBinaries := configuration.Settings.GetBool("sketch.always_export_binaries") + // If we'd just read the binding in any case, even if the request sets the export binaries setting, + // the settings value would always overwrite the request one and it wouldn't have any effect + // setting it for individual requests. To solve this we use a wrapper.BoolValue to handle + // the optionality of this property, otherwise we would have no way of knowing if the property + // was set in the request or it's just the default boolean value. + if reqExportBinaries := req.GetExportBinaries(); reqExportBinaries != nil { + exportBinaries = reqExportBinaries.Value + } + tags := map[string]string{ "fqbn": req.Fqbn, "sketchPath": metrics.Sanitize(req.SketchPath), @@ -59,7 +72,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W "jobs": strconv.FormatInt(int64(req.Jobs), 10), "libraries": strings.Join(req.Libraries, ","), "clean": strconv.FormatBool(req.GetClean()), - "exportBinaries": strconv.FormatBool(req.GetExportBinaries()), + "exportBinaries": strconv.FormatBool(exportBinaries), } // Use defer func() to evaluate tags map when function returns @@ -214,7 +227,7 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W } // If the export directory is set we assume you want to export the binaries - if req.GetExportBinaries() || req.GetExportDir() != "" { + if exportBinaries || req.GetExportDir() != "" { var exportPath *paths.Path if exportDir := req.GetExportDir(); exportDir != "" { exportPath = paths.New(exportDir) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index ce19250f8b9..8e75d2fa44d 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -4,6 +4,14 @@ Here you can find a list of migration guides to handle breaking changes between ## Unreleased +### Change type of `CompileReq.ExportBinaries` message in gRPC interface + +This change affects only the gRPC consumers. + +In the `CompileReq` message the `export_binaries` property type has been changed from `bool` to +`google.protobuf.BoolValue`. This has been done to handle settings bindings by gRPC consumers and the CLI in the same +way so that they an identical behaviour. + ## 0.15.0 ### Rename `telemetry` settings to `metrics` diff --git a/rpc/commands/compile.pb.go b/rpc/commands/compile.pb.go index ad9ad31192a..6d01bf99982 100644 --- a/rpc/commands/compile.pb.go +++ b/rpc/commands/compile.pb.go @@ -23,6 +23,7 @@ package commands import ( proto "github.com/golang/protobuf/proto" + wrappers "github.com/golang/protobuf/ptypes/wrappers" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -45,26 +46,26 @@ type CompileReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` // Arduino Core Service instance from the `Init` response. - Fqbn string `protobuf:"bytes,2,opt,name=fqbn,proto3" json:"fqbn,omitempty"` // Fully Qualified Board Name, e.g.: `arduino:avr:uno`. If this field is not defined, the FQBN of the board attached to the sketch via the `BoardAttach` method is used. - SketchPath string `protobuf:"bytes,3,opt,name=sketchPath,proto3" json:"sketchPath,omitempty"` // The path where the sketch is stored. - ShowProperties bool `protobuf:"varint,4,opt,name=showProperties,proto3" json:"showProperties,omitempty"` // Show all build preferences used instead of compiling. - Preprocess bool `protobuf:"varint,5,opt,name=preprocess,proto3" json:"preprocess,omitempty"` // Print preprocessed code to stdout instead of compiling. - BuildCachePath string `protobuf:"bytes,6,opt,name=buildCachePath,proto3" json:"buildCachePath,omitempty"` // Builds of 'core.a' are saved into this path to be cached and reused. - BuildPath string `protobuf:"bytes,7,opt,name=buildPath,proto3" json:"buildPath,omitempty"` // Path to use to store the files used for the compilation. If omitted, a directory will be created in the operating system's default temporary path. - BuildProperties []string `protobuf:"bytes,8,rep,name=buildProperties,proto3" json:"buildProperties,omitempty"` // List of custom build properties separated by commas. - Warnings string `protobuf:"bytes,9,opt,name=warnings,proto3" json:"warnings,omitempty"` // Used to tell gcc which warning level to use. The level names are: "none", "default", "more" and "all". - Verbose bool `protobuf:"varint,10,opt,name=verbose,proto3" json:"verbose,omitempty"` // Turns on verbose mode. - Quiet bool `protobuf:"varint,11,opt,name=quiet,proto3" json:"quiet,omitempty"` // Suppresses almost every output. - VidPid string `protobuf:"bytes,12,opt,name=vidPid,proto3" json:"vidPid,omitempty"` // VID/PID specific build properties. - Jobs int32 `protobuf:"varint,14,opt,name=jobs,proto3" json:"jobs,omitempty"` // The max number of concurrent compiler instances to run (as `make -jx`). If jobs is set to 0, it will use the number of available CPUs as the maximum. - Libraries []string `protobuf:"bytes,15,rep,name=libraries,proto3" json:"libraries,omitempty"` // List of custom libraries paths separated by commas. - OptimizeForDebug bool `protobuf:"varint,16,opt,name=optimizeForDebug,proto3" json:"optimizeForDebug,omitempty"` // Optimize compile output for debug, not for release. - ExportDir string `protobuf:"bytes,18,opt,name=export_dir,json=exportDir,proto3" json:"export_dir,omitempty"` // Optional: save the build artifacts in this directory, the directory must exist. - Clean bool `protobuf:"varint,19,opt,name=clean,proto3" json:"clean,omitempty"` // Optional: cleanup the build folder and do not use any previously cached build - ExportBinaries bool `protobuf:"varint,20,opt,name=export_binaries,json=exportBinaries,proto3" json:"export_binaries,omitempty"` // When set to `true` the compiled binary will be copied to the export directory. - CreateCompilationDatabaseOnly bool `protobuf:"varint,21,opt,name=create_compilation_database_only,json=createCompilationDatabaseOnly,proto3" json:"create_compilation_database_only,omitempty"` // When set to `true` only the compilation database will be produced and no actual build will be performed. - SourceOverride map[string]string `protobuf:"bytes,22,rep,name=source_override,json=sourceOverride,proto3" json:"source_override,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // This map (source file -> new content) let the builder use the provided content instead of reading the corresponding file on disk. This is useful for IDE that have unsaved changes in memory. The path must be relative to the sketch directory. Only files from the sketch are allowed. + Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` // Arduino Core Service instance from the `Init` response. + Fqbn string `protobuf:"bytes,2,opt,name=fqbn,proto3" json:"fqbn,omitempty"` // Fully Qualified Board Name, e.g.: `arduino:avr:uno`. If this field is not defined, the FQBN of the board attached to the sketch via the `BoardAttach` method is used. + SketchPath string `protobuf:"bytes,3,opt,name=sketchPath,proto3" json:"sketchPath,omitempty"` // The path where the sketch is stored. + ShowProperties bool `protobuf:"varint,4,opt,name=showProperties,proto3" json:"showProperties,omitempty"` // Show all build preferences used instead of compiling. + Preprocess bool `protobuf:"varint,5,opt,name=preprocess,proto3" json:"preprocess,omitempty"` // Print preprocessed code to stdout instead of compiling. + BuildCachePath string `protobuf:"bytes,6,opt,name=buildCachePath,proto3" json:"buildCachePath,omitempty"` // Builds of 'core.a' are saved into this path to be cached and reused. + BuildPath string `protobuf:"bytes,7,opt,name=buildPath,proto3" json:"buildPath,omitempty"` // Path to use to store the files used for the compilation. If omitted, a directory will be created in the operating system's default temporary path. + BuildProperties []string `protobuf:"bytes,8,rep,name=buildProperties,proto3" json:"buildProperties,omitempty"` // List of custom build properties separated by commas. + Warnings string `protobuf:"bytes,9,opt,name=warnings,proto3" json:"warnings,omitempty"` // Used to tell gcc which warning level to use. The level names are: "none", "default", "more" and "all". + Verbose bool `protobuf:"varint,10,opt,name=verbose,proto3" json:"verbose,omitempty"` // Turns on verbose mode. + Quiet bool `protobuf:"varint,11,opt,name=quiet,proto3" json:"quiet,omitempty"` // Suppresses almost every output. + VidPid string `protobuf:"bytes,12,opt,name=vidPid,proto3" json:"vidPid,omitempty"` // VID/PID specific build properties. + Jobs int32 `protobuf:"varint,14,opt,name=jobs,proto3" json:"jobs,omitempty"` // The max number of concurrent compiler instances to run (as `make -jx`). If jobs is set to 0, it will use the number of available CPUs as the maximum. + Libraries []string `protobuf:"bytes,15,rep,name=libraries,proto3" json:"libraries,omitempty"` // List of custom libraries paths separated by commas. + OptimizeForDebug bool `protobuf:"varint,16,opt,name=optimizeForDebug,proto3" json:"optimizeForDebug,omitempty"` // Optimize compile output for debug, not for release. + ExportDir string `protobuf:"bytes,18,opt,name=export_dir,json=exportDir,proto3" json:"export_dir,omitempty"` // Optional: save the build artifacts in this directory, the directory must exist. + Clean bool `protobuf:"varint,19,opt,name=clean,proto3" json:"clean,omitempty"` // Optional: cleanup the build folder and do not use any previously cached build + CreateCompilationDatabaseOnly bool `protobuf:"varint,21,opt,name=create_compilation_database_only,json=createCompilationDatabaseOnly,proto3" json:"create_compilation_database_only,omitempty"` // When set to `true` only the compilation database will be produced and no actual build will be performed. + SourceOverride map[string]string `protobuf:"bytes,22,rep,name=source_override,json=sourceOverride,proto3" json:"source_override,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // This map (source file -> new content) let the builder use the provided content instead of reading the corresponding file on disk. This is useful for IDE that have unsaved changes in memory. The path must be relative to the sketch directory. Only files from the sketch are allowed. + ExportBinaries *wrappers.BoolValue `protobuf:"bytes,23,opt,name=export_binaries,json=exportBinaries,proto3" json:"export_binaries,omitempty"` // When set to `true` the compiled binary will be copied to the export directory. } func (x *CompileReq) Reset() { @@ -218,13 +219,6 @@ func (x *CompileReq) GetClean() bool { return false } -func (x *CompileReq) GetExportBinaries() bool { - if x != nil { - return x.ExportBinaries - } - return false -} - func (x *CompileReq) GetCreateCompilationDatabaseOnly() bool { if x != nil { return x.CreateCompilationDatabaseOnly @@ -239,6 +233,13 @@ func (x *CompileReq) GetSourceOverride() map[string]string { return nil } +func (x *CompileReq) GetExportBinaries() *wrappers.BoolValue { + if x != nil { + return x.ExportBinaries + } + return nil +} + type CompileResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -387,9 +388,11 @@ var file_commands_compile_proto_rawDesc = []byte{ 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, + 0x73, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x2f, 0x6c, 0x69, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x06, 0x0a, + 0x64, 0x73, 0x2f, 0x6c, 0x69, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe1, 0x06, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, @@ -424,52 +427,54 @@ var file_commands_compile_proto_rawDesc = []byte{ 0x46, 0x6f, 0x72, 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x6e, - 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x27, 0x0a, - 0x0f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x69, 0x65, 0x73, - 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x69, - 0x6e, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x1d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4f, 0x6e, 0x6c, 0x79, 0x12, - 0x60, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, - 0x64, 0x65, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, + 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x12, 0x47, 0x0a, + 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6f, 0x6e, 0x6c, + 0x79, 0x18, 0x15, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x60, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x37, 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, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, + 0x65, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, + 0x69, 0x64, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x43, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x17, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x65, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x69, 0x65, 0x73, 0x1a, 0x41, 0x0a, + 0x13, 0x53, 0x6f, 0x75, 0x72, 0x63, 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, 0x9d, 0x02, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 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, 0x0a, 0x65, 0x72, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x72, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1d, + 0x0a, 0x0a, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x50, 0x61, 0x74, 0x68, 0x12, 0x47, 0x0a, + 0x0e, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 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, + 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x0d, 0x75, 0x73, 0x65, 0x64, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x68, 0x0a, 0x18, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 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, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x2e, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, - 0x65, 0x1a, 0x41, 0x0a, 0x13, 0x53, 0x6f, 0x75, 0x72, 0x63, 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, 0x9d, 0x02, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 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, 0x0a, 0x65, 0x72, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x72, 0x72, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x50, 0x61, 0x74, - 0x68, 0x12, 0x47, 0x0a, 0x0e, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x0d, 0x75, 0x73, 0x65, - 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x68, 0x0a, 0x18, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 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, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x16, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x53, 0x69, 0x7a, 0x65, 0x22, 0x59, 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, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x42, - 0x2d, 0x5a, 0x2b, 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, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x73, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x7a, 0x65, 0x52, 0x16, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x69, 0x7a, 0x65, + 0x22, 0x59, 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, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x2d, 0x5a, 0x2b, 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, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -491,18 +496,20 @@ var file_commands_compile_proto_goTypes = []interface{}{ (*ExecutableSectionSize)(nil), // 2: cc.arduino.cli.commands.ExecutableSectionSize nil, // 3: cc.arduino.cli.commands.CompileReq.SourceOverrideEntry (*Instance)(nil), // 4: cc.arduino.cli.commands.Instance - (*Library)(nil), // 5: cc.arduino.cli.commands.Library + (*wrappers.BoolValue)(nil), // 5: google.protobuf.BoolValue + (*Library)(nil), // 6: cc.arduino.cli.commands.Library } var file_commands_compile_proto_depIdxs = []int32{ 4, // 0: cc.arduino.cli.commands.CompileReq.instance:type_name -> cc.arduino.cli.commands.Instance 3, // 1: cc.arduino.cli.commands.CompileReq.source_override:type_name -> cc.arduino.cli.commands.CompileReq.SourceOverrideEntry - 5, // 2: cc.arduino.cli.commands.CompileResp.used_libraries:type_name -> cc.arduino.cli.commands.Library - 2, // 3: cc.arduino.cli.commands.CompileResp.executable_sections_size:type_name -> cc.arduino.cli.commands.ExecutableSectionSize - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 5, // 2: cc.arduino.cli.commands.CompileReq.export_binaries:type_name -> google.protobuf.BoolValue + 6, // 3: cc.arduino.cli.commands.CompileResp.used_libraries:type_name -> cc.arduino.cli.commands.Library + 2, // 4: cc.arduino.cli.commands.CompileResp.executable_sections_size:type_name -> cc.arduino.cli.commands.ExecutableSectionSize + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_commands_compile_proto_init() } diff --git a/rpc/commands/compile.proto b/rpc/commands/compile.proto index 9ef7a7eaecd..0bf0d8c68fd 100644 --- a/rpc/commands/compile.proto +++ b/rpc/commands/compile.proto @@ -19,6 +19,7 @@ package cc.arduino.cli.commands; option go_package = "github.com/arduino/arduino-cli/rpc/commands"; +import "google/protobuf/wrappers.proto"; import "commands/common.proto"; import "commands/lib.proto"; @@ -40,9 +41,9 @@ message CompileReq { bool optimizeForDebug = 16; // Optimize compile output for debug, not for release. string export_dir = 18; // Optional: save the build artifacts in this directory, the directory must exist. bool clean = 19; // Optional: cleanup the build folder and do not use any previously cached build - bool export_binaries = 20; // When set to `true` the compiled binary will be copied to the export directory. bool create_compilation_database_only = 21; // When set to `true` only the compilation database will be produced and no actual build will be performed. map source_override = 22; // This map (source file -> new content) let the builder use the provided content instead of reading the corresponding file on disk. This is useful for IDE that have unsaved changes in memory. The path must be relative to the sketch directory. Only files from the sketch are allowed. + google.protobuf.BoolValue export_binaries = 23; // When set to `true` the compiled binary will be copied to the export directory. } message CompileResp { diff --git a/rpc/settings/settings.pb.go b/rpc/settings/settings.pb.go index 2ae20db78c4..7242b11d8d1 100644 --- a/rpc/settings/settings.pb.go +++ b/rpc/settings/settings.pb.go @@ -636,7 +636,7 @@ type SettingsClient interface { GetValue(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*Value, error) // Set the value of a specific setting. SetValue(ctx context.Context, in *Value, opts ...grpc.CallOption) (*SetValueResponse, error) - // Writes to file current in memory settings + // Writes to file settings currently stored in memory Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) } @@ -703,7 +703,7 @@ type SettingsServer interface { GetValue(context.Context, *GetValueRequest) (*Value, error) // Set the value of a specific setting. SetValue(context.Context, *Value) (*SetValueResponse, error) - // Writes to file current in memory settings + // Writes to file settings currently stored in memory Write(context.Context, *WriteRequest) (*WriteResponse, error) }