From 856eff75e2b20d24b399c90d8231af872fe77181 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 13 Aug 2020 09:36:15 +0200 Subject: [PATCH 01/10] Refactored executils.Command --- commands/bundled_tools_serial_discovery.go | 3 +-- commands/debug/debug.go | 2 +- commands/upload/upload.go | 2 +- executils/executils.go | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/commands/bundled_tools_serial_discovery.go b/commands/bundled_tools_serial_discovery.go index 9ca07151e09..27c73cca1a6 100644 --- a/commands/bundled_tools_serial_discovery.go +++ b/commands/bundled_tools_serial_discovery.go @@ -131,8 +131,7 @@ func ListBoards(pm *packagemanager.PackageManager) ([]*BoardPort, error) { } // build the command to be executed - args := []string{t.InstallDir.Join("serial-discovery").String()} - cmd, err := executils.Command(args) + cmd, err := executils.Command(t.InstallDir.Join("serial-discovery").String()) if err != nil { return nil, errors.Wrap(err, "creating discovery process") } diff --git a/commands/debug/debug.go b/commands/debug/debug.go index d67d2ea7958..6bc8f108228 100644 --- a/commands/debug/debug.go +++ b/commands/debug/debug.go @@ -64,7 +64,7 @@ func Debug(ctx context.Context, req *dbg.DebugConfigReq, inStream io.Reader, out } entry.Debug("Executing debugger") - cmd, err := executils.Command(commandLine) + cmd, err := executils.Command(commandLine...) if err != nil { return nil, errors.Wrap(err, "Cannot execute debug tool") } diff --git a/commands/upload/upload.go b/commands/upload/upload.go index 373efbc6ae0..135c968e1d5 100644 --- a/commands/upload/upload.go +++ b/commands/upload/upload.go @@ -372,7 +372,7 @@ func runTool(recipeID string, props *properties.Map, outStream, errStream io.Wri if verbose { outStream.Write([]byte(fmt.Sprintln(cmdLine))) } - cmd, err := executils.Command(cmdArgs) + cmd, err := executils.Command(cmdArgs...) if err != nil { return fmt.Errorf("cannot execute upload tool: %s", err) } diff --git a/executils/executils.go b/executils/executils.go index 44fbff0f08a..3e684479a5e 100644 --- a/executils/executils.go +++ b/executils/executils.go @@ -75,7 +75,7 @@ func TellCommandNotToSpawnShell(cmd *exec.Cmd) { // Command creates a command with the provided command line arguments. // The first argument is the path to the executable, the remainder are the // arguments to the command. -func Command(args []string) (*exec.Cmd, error) { +func Command(args ...string) (*exec.Cmd, error) { if args == nil || len(args) == 0 { return nil, fmt.Errorf("no executable specified") } From 526e3e49c73570cebcaf932fbd76f767135466e1 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 13 Aug 2020 11:08:09 +0200 Subject: [PATCH 02/10] Added IsTrusted flag in PlatformReleases This is required for post_install script processing. --- arduino/cores/cores.go | 1 + arduino/cores/packageindex/index.go | 28 +++++++++++++++++++++++----- arduino/security/signatures.go | 7 +++++-- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/arduino/cores/cores.go b/arduino/cores/cores.go index bcacea1154e..9b90bc84744 100644 --- a/arduino/cores/cores.go +++ b/arduino/cores/cores.go @@ -48,6 +48,7 @@ type PlatformRelease struct { Menus *properties.Map `json:"-"` InstallDir *paths.Path `json:"-"` IsIDEBundled bool `json:"-"` + IsTrusted bool `json:"-"` } // BoardManifest contains information about a board. These metadata are usually diff --git a/arduino/cores/packageindex/index.go b/arduino/cores/packageindex/index.go index ab25e781f0a..c3ec676bc30 100644 --- a/arduino/cores/packageindex/index.go +++ b/arduino/cores/packageindex/index.go @@ -21,13 +21,16 @@ import ( "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/resources" + "github.com/arduino/arduino-cli/arduino/security" "github.com/arduino/go-paths-helper" + "github.com/sirupsen/logrus" semver "go.bug.st/relaxed-semver" ) // Index represents Cores and Tools struct as seen from package_index.json file. type Index struct { - Packages []*indexPackage `json:"packages"` + Packages []*indexPackage `json:"packages"` + IsTrusted bool } // indexPackage represents a single entry from package_index.json file. @@ -98,11 +101,11 @@ type indexHelp struct { // with the existing contents of the cores.Packages passed as parameter. func (index Index) MergeIntoPackages(outPackages cores.Packages) { for _, inPackage := range index.Packages { - inPackage.extractPackageIn(outPackages) + inPackage.extractPackageIn(outPackages, index.IsTrusted) } } -func (inPackage indexPackage) extractPackageIn(outPackages cores.Packages) { +func (inPackage indexPackage) extractPackageIn(outPackages cores.Packages, trusted bool) { outPackage := outPackages.GetOrCreatePackage(inPackage.Name) outPackage.Maintainer = inPackage.Maintainer outPackage.WebsiteURL = inPackage.WebsiteURL @@ -115,11 +118,11 @@ func (inPackage indexPackage) extractPackageIn(outPackages cores.Packages) { } for _, inPlatform := range inPackage.Platforms { - inPlatform.extractPlatformIn(outPackage) + inPlatform.extractPlatformIn(outPackage, trusted) } } -func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *cores.Package) error { +func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *cores.Package, trusted bool) error { outPlatform := outPackage.GetOrCreatePlatform(inPlatformRelease.Architecture) // FIXME: shall we use the Name and Category of the latest release? or maybe move Name and Category in PlatformRelease? outPlatform.Name = inPlatformRelease.Name @@ -133,6 +136,7 @@ func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *core if err != nil { return fmt.Errorf("creating release: %s", err) } + outPlatformRelease.IsTrusted = trusted outPlatformRelease.Resource = &resources.DownloadResource{ ArchiveFileName: inPlatformRelease.ArchiveFileName, Checksum: inPlatformRelease.Checksum, @@ -213,5 +217,19 @@ func LoadIndex(jsonIndexFile *paths.Path) (*Index, error) { return nil, err } + jsonSignatureFile := jsonIndexFile.Parent().Join(jsonIndexFile.Base() + ".sig") + trusted, _, err := security.VerifyArduinoDetachedSignature(jsonIndexFile, jsonSignatureFile) + if err != nil { + logrus. + WithField("index", jsonIndexFile). + WithField("signatureFile", jsonSignatureFile). + WithError(err).Infof("Checking signature") + } else { + logrus. + WithField("index", jsonIndexFile). + WithField("signatureFile", jsonSignatureFile). + WithField("trusted", trusted).Infof("Checking signature") + index.IsTrusted = trusted + } return &index, nil } diff --git a/arduino/security/signatures.go b/arduino/security/signatures.go index 9740a7d2b20..b4a7237f0b3 100644 --- a/arduino/security/signatures.go +++ b/arduino/security/signatures.go @@ -23,8 +23,11 @@ import ( "golang.org/x/crypto/openpgp" ) -// VerifyArduinoDetachedSignature that give signaturePath GPG signature match the given targetPath file -// ant the is an authentic signature from Arduino. +// VerifyArduinoDetachedSignature checks that the detached GPG signature (in the +// signaturePath file) matches the given targetPath file and is an authentic +// signature from the bundled trusted keychain. If any of the above conditions +// fails this function returns false. The PGP entity in the trusted keychain that +// produced the signature is returned too. func VerifyArduinoDetachedSignature(targetPath *paths.Path, signaturePath *paths.Path) (bool, *openpgp.Entity, error) { keysBox, err := rice.FindBox("keys") if err != nil { From d19ac4c74180813ad4deb9e7a763707a49a8fec4 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 13 Aug 2020 11:09:15 +0200 Subject: [PATCH 03/10] Run post_install.sh script on trusted platforms --- .../cores/packagemanager/install_uninstall.go | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/arduino/cores/packagemanager/install_uninstall.go b/arduino/cores/packagemanager/install_uninstall.go index 460af5c33ab..df5a4712b25 100644 --- a/arduino/cores/packagemanager/install_uninstall.go +++ b/arduino/cores/packagemanager/install_uninstall.go @@ -17,8 +17,12 @@ package packagemanager import ( "fmt" + "runtime" "github.com/arduino/arduino-cli/arduino/cores" + "github.com/arduino/arduino-cli/executils" + "github.com/arduino/go-paths-helper" + "github.com/pkg/errors" ) // InstallPlatform installs a specific release of a platform. @@ -28,7 +32,40 @@ func (pm *PackageManager) InstallPlatform(platformRelease *cores.PlatformRelease "hardware", platformRelease.Platform.Architecture, platformRelease.Version.String()) - return platformRelease.Resource.Install(pm.DownloadDir, pm.TempDir, destDir) + if err := platformRelease.Resource.Install(pm.DownloadDir, pm.TempDir, destDir); err != nil { + return errors.Errorf("installing platform %s: %s", platformRelease, err) + } + + // Perform post install + if platformRelease.IsTrusted { + if err := pm.runPostInstallScript(destDir); err != nil { + return errors.Errorf("running post install script for %s: %s", platformRelease, err) + } + } + + return nil +} + +func (pm *PackageManager) runPostInstallScript(destDir *paths.Path) error { + postInstallFilename := "post_install.sh" + if runtime.GOOS == "windows" { + postInstallFilename = "post_install.bat" + } + postInstall := destDir.Join(postInstallFilename) + if postInstall.Exist() && !postInstall.IsDir() { + cmd, err := executils.Command(postInstall.String()) + if err != nil { + return err + } + cmd.Dir = destDir.String() + cmd.Stdout = nil + cmd.Stderr = nil + if err := cmd.Run(); err != nil { + return err + } + } + return nil + } // IsManagedPlatformRelease returns true if the PlatforRelease is managed by the PackageManager From 7fd15e93c0768b4294c933eaeebee791471129ea Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 13 Aug 2020 12:28:07 +0200 Subject: [PATCH 04/10] Small fix on post-install precondition --- arduino/cores/packagemanager/install_uninstall.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arduino/cores/packagemanager/install_uninstall.go b/arduino/cores/packagemanager/install_uninstall.go index df5a4712b25..4e239f0e405 100644 --- a/arduino/cores/packagemanager/install_uninstall.go +++ b/arduino/cores/packagemanager/install_uninstall.go @@ -52,7 +52,7 @@ func (pm *PackageManager) runPostInstallScript(destDir *paths.Path) error { postInstallFilename = "post_install.bat" } postInstall := destDir.Join(postInstallFilename) - if postInstall.Exist() && !postInstall.IsDir() { + if postInstall.Exist() && postInstall.IsNotDir() { cmd, err := executils.Command(postInstall.String()) if err != nil { return err From f934a9c08c32a3d9cbe93ba943de822ba76b2214 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 13 Aug 2020 15:38:21 +0200 Subject: [PATCH 05/10] Use absolute path for running post_install script --- arduino/cores/packagemanager/install_uninstall.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arduino/cores/packagemanager/install_uninstall.go b/arduino/cores/packagemanager/install_uninstall.go index 4e239f0e405..ccb653f5fd6 100644 --- a/arduino/cores/packagemanager/install_uninstall.go +++ b/arduino/cores/packagemanager/install_uninstall.go @@ -47,17 +47,21 @@ func (pm *PackageManager) InstallPlatform(platformRelease *cores.PlatformRelease } func (pm *PackageManager) runPostInstallScript(destDir *paths.Path) error { + absDestDir, err := destDir.Abs() + if err != nil { + return err + } postInstallFilename := "post_install.sh" if runtime.GOOS == "windows" { postInstallFilename = "post_install.bat" } - postInstall := destDir.Join(postInstallFilename) + postInstall := absDestDir.Join(postInstallFilename) if postInstall.Exist() && postInstall.IsNotDir() { cmd, err := executils.Command(postInstall.String()) if err != nil { return err } - cmd.Dir = destDir.String() + cmd.Dir = absDestDir.String() cmd.Stdout = nil cmd.Stderr = nil if err := cmd.Run(); err != nil { @@ -65,7 +69,6 @@ func (pm *PackageManager) runPostInstallScript(destDir *paths.Path) error { } } return nil - } // IsManagedPlatformRelease returns true if the PlatforRelease is managed by the PackageManager From b0880de969a8d2b08703c8bbe764abee467fcb43 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 13 Aug 2020 17:08:11 +0200 Subject: [PATCH 06/10] Added --skip-post-install flags. Refactored PostInstall function. --- .../cores/packagemanager/install_uninstall.go | 25 +- cli/core/install.go | 6 + cli/core/upgrade.go | 6 + commands/core/install.go | 15 +- commands/core/upgrade.go | 7 +- rpc/commands/board.pb.go | 4 +- rpc/commands/commands.pb.go | 4 +- rpc/commands/common.pb.go | 4 +- rpc/commands/compile.pb.go | 4 +- rpc/commands/core.pb.go | 237 ++++++++++-------- rpc/commands/core.proto | 4 + rpc/commands/lib.pb.go | 4 +- rpc/commands/upload.pb.go | 4 +- rpc/debug/debug.pb.go | 4 +- rpc/monitor/monitor.pb.go | 4 +- rpc/settings/settings.pb.go | 4 +- 16 files changed, 191 insertions(+), 145 deletions(-) diff --git a/arduino/cores/packagemanager/install_uninstall.go b/arduino/cores/packagemanager/install_uninstall.go index ccb653f5fd6..e04d7ee1384 100644 --- a/arduino/cores/packagemanager/install_uninstall.go +++ b/arduino/cores/packagemanager/install_uninstall.go @@ -21,7 +21,6 @@ import ( "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/executils" - "github.com/arduino/go-paths-helper" "github.com/pkg/errors" ) @@ -35,33 +34,31 @@ func (pm *PackageManager) InstallPlatform(platformRelease *cores.PlatformRelease if err := platformRelease.Resource.Install(pm.DownloadDir, pm.TempDir, destDir); err != nil { return errors.Errorf("installing platform %s: %s", platformRelease, err) } - - // Perform post install - if platformRelease.IsTrusted { - if err := pm.runPostInstallScript(destDir); err != nil { - return errors.Errorf("running post install script for %s: %s", platformRelease, err) - } + if d, err := destDir.Abs(); err == nil { + platformRelease.InstallDir = d + } else { + return err } - return nil } -func (pm *PackageManager) runPostInstallScript(destDir *paths.Path) error { - absDestDir, err := destDir.Abs() - if err != nil { - return err +// RunPostInstallScript runs the post_install.sh (or post_install.bat) script for the +// specified platformRelease. +func (pm *PackageManager) RunPostInstallScript(platformRelease *cores.PlatformRelease) error { + if !platformRelease.IsInstalled() { + return errors.New("platform not installed") } postInstallFilename := "post_install.sh" if runtime.GOOS == "windows" { postInstallFilename = "post_install.bat" } - postInstall := absDestDir.Join(postInstallFilename) + postInstall := platformRelease.InstallDir.Join(postInstallFilename) if postInstall.Exist() && postInstall.IsNotDir() { cmd, err := executils.Command(postInstall.String()) if err != nil { return err } - cmd.Dir = absDestDir.String() + cmd.Dir = platformRelease.InstallDir.String() cmd.Stdout = nil cmd.Stderr = nil if err := cmd.Run(); err != nil { diff --git a/cli/core/install.go b/cli/core/install.go index 6bbcb958d32..5f9db92f958 100644 --- a/cli/core/install.go +++ b/cli/core/install.go @@ -42,9 +42,14 @@ func initInstallCommand() *cobra.Command { Args: cobra.MinimumNArgs(1), Run: runInstallCommand, } + installCommand.Flags().BoolVar(&installFlags.skipPostInstall, "skip-post-install", false, "Do not run post-install scripts.") return installCommand } +var installFlags struct { + skipPostInstall bool +} + func runInstallCommand(cmd *cobra.Command, args []string) { inst, err := instance.CreateInstance() if err != nil { @@ -66,6 +71,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) { PlatformPackage: platformRef.PackageName, Architecture: platformRef.Architecture, Version: platformRef.Version, + SkipPostInstall: installFlags.skipPostInstall, } _, err := core.PlatformInstall(context.Background(), platformInstallReq, output.ProgressBar(), output.TaskProgress()) if err != nil { diff --git a/cli/core/upgrade.go b/cli/core/upgrade.go index febc1bcebcf..c5bce7ab130 100644 --- a/cli/core/upgrade.go +++ b/cli/core/upgrade.go @@ -42,9 +42,14 @@ func initUpgradeCommand() *cobra.Command { " " + os.Args[0] + " core upgrade arduino:samd", Run: runUpgradeCommand, } + upgradeCommand.Flags().BoolVar(&upgradeFlags.skipPostInstall, "skip-post-install", false, "Do not run post-install scripts.") return upgradeCommand } +var upgradeFlags struct { + skipPostInstall bool +} + func runUpgradeCommand(cmd *cobra.Command, args []string) { inst, err := instance.CreateInstance() if err != nil { @@ -91,6 +96,7 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) { Instance: inst, PlatformPackage: platformRef.PackageName, Architecture: platformRef.Architecture, + SkipPostInstall: upgradeFlags.skipPostInstall, } _, err := core.PlatformUpgrade(context.Background(), r, output.ProgressBar(), output.TaskProgress()) diff --git a/commands/core/install.go b/commands/core/install.go index 24fa4c57537..a37df5ff493 100644 --- a/commands/core/install.go +++ b/commands/core/install.go @@ -17,13 +17,13 @@ package core import ( "context" - "errors" "fmt" "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/cores/packagemanager" "github.com/arduino/arduino-cli/commands" rpc "github.com/arduino/arduino-cli/rpc/commands" + "github.com/pkg/errors" ) // PlatformInstall FIXMEDOC @@ -49,7 +49,7 @@ func PlatformInstall(ctx context.Context, req *rpc.PlatformInstallReq, return nil, fmt.Errorf("finding platform dependencies: %s", err) } - err = installPlatform(pm, platform, tools, downloadCB, taskCB) + err = installPlatform(pm, platform, tools, downloadCB, taskCB, req.GetSkipPostInstall()) if err != nil { return nil, err } @@ -64,7 +64,8 @@ func PlatformInstall(ctx context.Context, req *rpc.PlatformInstallReq, func installPlatform(pm *packagemanager.PackageManager, platformRelease *cores.PlatformRelease, requiredTools []*cores.ToolRelease, - downloadCB commands.DownloadProgressCB, taskCB commands.TaskProgressCB) error { + downloadCB commands.DownloadProgressCB, taskCB commands.TaskProgressCB, + skipPostInstall bool) error { log := pm.Log.WithField("platform", platformRelease) // Prerequisite checks before install @@ -138,6 +139,14 @@ func installPlatform(pm *packagemanager.PackageManager, } } + // Perform post install + if !skipPostInstall && platformRelease.IsTrusted { + log.Info("Running post_install script") + if err := pm.RunPostInstallScript(platformRelease); err != nil { + return errors.Errorf("running post install: %s", err) + } + } + log.Info("Platform installed") taskCB(&rpc.TaskProgress{Message: platformRelease.String() + " installed", Completed: true}) return nil diff --git a/commands/core/upgrade.go b/commands/core/upgrade.go index 1297496da1c..7b77f6e436b 100644 --- a/commands/core/upgrade.go +++ b/commands/core/upgrade.go @@ -45,7 +45,7 @@ func PlatformUpgrade(ctx context.Context, req *rpc.PlatformUpgradeReq, Package: req.PlatformPackage, PlatformArchitecture: req.Architecture, } - if err := upgradePlatform(pm, ref, downloadCB, taskCB); err != nil { + if err := upgradePlatform(pm, ref, downloadCB, taskCB, req.GetSkipPostInstall()); err != nil { return nil, err } @@ -57,7 +57,8 @@ func PlatformUpgrade(ctx context.Context, req *rpc.PlatformUpgradeReq, } func upgradePlatform(pm *packagemanager.PackageManager, platformRef *packagemanager.PlatformReference, - downloadCB commands.DownloadProgressCB, taskCB commands.TaskProgressCB) error { + downloadCB commands.DownloadProgressCB, taskCB commands.TaskProgressCB, + skipPostInstall bool) error { if platformRef.PlatformVersion != nil { return fmt.Errorf("upgrade doesn't accept parameters with version") } @@ -84,7 +85,7 @@ func upgradePlatform(pm *packagemanager.PackageManager, platformRef *packagemana if err != nil { return fmt.Errorf("platform %s is not installed", platformRef) } - err = installPlatform(pm, platform, tools, downloadCB, taskCB) + err = installPlatform(pm, platform, tools, downloadCB, taskCB, skipPostInstall) if err != nil { return err } diff --git a/rpc/commands/board.pb.go b/rpc/commands/board.pb.go index 1c437c2aefe..bf7e2c8ccd6 100644 --- a/rpc/commands/board.pb.go +++ b/rpc/commands/board.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: commands/board.proto package commands diff --git a/rpc/commands/commands.pb.go b/rpc/commands/commands.pb.go index e23158b6544..05e518b4b94 100644 --- a/rpc/commands/commands.pb.go +++ b/rpc/commands/commands.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: commands/commands.proto package commands diff --git a/rpc/commands/common.pb.go b/rpc/commands/common.pb.go index 01e9abcb10c..a833abece29 100644 --- a/rpc/commands/common.pb.go +++ b/rpc/commands/common.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: commands/common.proto package commands diff --git a/rpc/commands/compile.pb.go b/rpc/commands/compile.pb.go index d6159bd7924..021c906d0d7 100644 --- a/rpc/commands/compile.pb.go +++ b/rpc/commands/compile.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: commands/compile.proto package commands diff --git a/rpc/commands/core.pb.go b/rpc/commands/core.pb.go index 7f6f517c61b..6302b691249 100644 --- a/rpc/commands/core.pb.go +++ b/rpc/commands/core.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: commands/core.proto package commands @@ -53,6 +53,8 @@ type PlatformInstallReq struct { Architecture string `protobuf:"bytes,3,opt,name=architecture,proto3" json:"architecture,omitempty"` // Platform version to install. Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + // Set to true to not run (eventual) post install scripts for trusted platforms + SkipPostInstall bool `protobuf:"varint,5,opt,name=skipPostInstall,proto3" json:"skipPostInstall,omitempty"` } func (x *PlatformInstallReq) Reset() { @@ -115,6 +117,13 @@ func (x *PlatformInstallReq) GetVersion() string { return "" } +func (x *PlatformInstallReq) GetSkipPostInstall() bool { + if x != nil { + return x.SkipPostInstall + } + return false +} + type PlatformInstallResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -419,6 +428,8 @@ type PlatformUpgradeReq struct { PlatformPackage string `protobuf:"bytes,2,opt,name=platform_package,json=platformPackage,proto3" json:"platform_package,omitempty"` // Architecture name of the platform (e.g., `avr`). Architecture string `protobuf:"bytes,3,opt,name=architecture,proto3" json:"architecture,omitempty"` + // Set to true to not run (eventual) post install scripts for trusted platforms + SkipPostInstall bool `protobuf:"varint,4,opt,name=skipPostInstall,proto3" json:"skipPostInstall,omitempty"` } func (x *PlatformUpgradeReq) Reset() { @@ -474,6 +485,13 @@ func (x *PlatformUpgradeReq) GetArchitecture() string { return "" } +func (x *PlatformUpgradeReq) GetSkipPostInstall() bool { + if x != nil { + return x.SkipPostInstall + } + return false +} + type PlatformUpgradeResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -932,7 +950,7 @@ var file_commands_core_proto_rawDesc = []byte{ 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, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, 0x01, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe6, 0x01, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 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, @@ -944,53 +962,39 @@ var file_commands_core_proto_rawDesc = []byte{ 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x13, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x08, - 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, - 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, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, - 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x4a, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 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, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, - 0x73, 0x52, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, - 0xbd, 0x01, 0x0a, 0x13, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x44, 0x6f, 0x77, 0x6e, - 0x6c, 0x6f, 0x61, 0x64, 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, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, - 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x5d, 0x0a, 0x14, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x6c, - 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 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, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa4, - 0x01, 0x0a, 0x14, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x6e, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 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, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, - 0x63, 0x74, 0x75, 0x72, 0x65, 0x22, 0x63, 0x0a, 0x15, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, - 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 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, - 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, - 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa2, 0x01, 0x0a, 0x12, 0x50, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x6b, 0x69, 0x70, 0x50, 0x6f, 0x73, 0x74, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x73, + 0x6b, 0x69, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x22, 0xa8, + 0x01, 0x0a, 0x13, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 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, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4a, 0x0a, + 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 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, 0x54, + 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, 0x73, + 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0xbd, 0x01, 0x0a, 0x13, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 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, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x29, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, + 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x0a, 0x14, 0x50, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x12, 0x45, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 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, 0x44, 0x6f, + 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, + 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x14, 0x50, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 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, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, @@ -1000,68 +1004,87 @@ var file_commands_core_proto_rawDesc = []byte{ 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x22, - 0xa8, 0x01, 0x0a, 0x13, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x70, 0x67, 0x72, - 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x63, 0x2e, 0x61, + 0x63, 0x0a, 0x15, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x6e, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4a, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, + 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 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, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x22, 0xcc, 0x01, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 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, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, + 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, + 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x6b, 0x69, + 0x70, 0x50, 0x6f, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0f, 0x73, 0x6b, 0x69, 0x70, 0x50, 0x6f, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x22, 0xa8, 0x01, 0x0a, 0x13, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 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, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x4a, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 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, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4a, - 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 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, - 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, - 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x96, 0x01, 0x0a, 0x11, 0x50, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 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, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x72, 0x67, 0x73, - 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x6c, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x22, 0x5c, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x0d, 0x73, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 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, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x22, 0x77, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x6e, 0x64, 0x73, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x96, + 0x01, 0x0a, 0x11, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 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, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x64, 0x0a, 0x10, 0x50, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x50, - 0x0a, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, + 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x61, 0x72, + 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x41, 0x72, 0x67, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x61, 0x6c, 0x6c, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5c, 0x0a, 0x12, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, + 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, + 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, 0x50, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x77, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x4c, 0x69, 0x73, 0x74, 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, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x11, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x22, 0xec, 0x01, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, - 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x44, 0x12, 0x1c, 0x0a, - 0x09, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x4c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4c, 0x61, 0x74, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x61, 0x69, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x4d, 0x61, 0x69, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x57, 0x65, 0x62, 0x73, 0x69, - 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x57, 0x65, 0x62, 0x73, 0x69, 0x74, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x36, 0x0a, 0x06, 0x42, 0x6f, 0x61, 0x72, 0x64, - 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 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, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x06, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x73, 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, 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, + 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x64, + 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x50, 0x0a, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 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, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x52, 0x11, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x22, 0xec, 0x01, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, + 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, + 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, + 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x4d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x57, + 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x57, 0x65, + 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x36, 0x0a, 0x06, 0x42, + 0x6f, 0x61, 0x72, 0x64, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 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, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x06, 0x42, 0x6f, 0x61, + 0x72, 0x64, 0x73, 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, 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 ( diff --git a/rpc/commands/core.proto b/rpc/commands/core.proto index b928823fef8..030e38be92b 100644 --- a/rpc/commands/core.proto +++ b/rpc/commands/core.proto @@ -30,6 +30,8 @@ message PlatformInstallReq { string architecture = 3; // Platform version to install. string version = 4; + // Set to true to not run (eventual) post install scripts for trusted platforms + bool skipPostInstall = 5; } message PlatformInstallResp { @@ -75,6 +77,8 @@ message PlatformUpgradeReq { string platform_package = 2; // Architecture name of the platform (e.g., `avr`). string architecture = 3; + // Set to true to not run (eventual) post install scripts for trusted platforms + bool skipPostInstall = 4; } message PlatformUpgradeResp { diff --git a/rpc/commands/lib.pb.go b/rpc/commands/lib.pb.go index 2acacd386cb..73a7979f84e 100644 --- a/rpc/commands/lib.pb.go +++ b/rpc/commands/lib.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: commands/lib.proto package commands diff --git a/rpc/commands/upload.pb.go b/rpc/commands/upload.pb.go index 2f474b5f99b..79754301619 100644 --- a/rpc/commands/upload.pb.go +++ b/rpc/commands/upload.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: commands/upload.proto package commands diff --git a/rpc/debug/debug.pb.go b/rpc/debug/debug.pb.go index 6ceeb5def52..baad7cd1832 100644 --- a/rpc/debug/debug.pb.go +++ b/rpc/debug/debug.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: debug/debug.proto package debug diff --git a/rpc/monitor/monitor.pb.go b/rpc/monitor/monitor.pb.go index bc01ec0236e..d3fdcc2942c 100644 --- a/rpc/monitor/monitor.pb.go +++ b/rpc/monitor/monitor.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: monitor/monitor.proto package monitor diff --git a/rpc/settings/settings.pb.go b/rpc/settings/settings.pb.go index 239908e48ff..eb5d02fa8b6 100644 --- a/rpc/settings/settings.pb.go +++ b/rpc/settings/settings.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.23.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.11.3 // source: settings/settings.proto package settings From e5bf82df4f8a979cf9b322260304692e30afcdaa Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 13 Aug 2020 17:12:41 +0200 Subject: [PATCH 07/10] Do not perform drivers install during integration tests --- test/test_board.py | 2 +- test/test_compile.py | 20 ++++++++++---------- test/test_core.py | 10 +++++----- test/test_outdated.py | 4 ++-- test/test_update.py | 4 ++-- test/test_upgrade.py | 4 ++-- test/test_upload.py | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/test_board.py b/test/test_board.py index f1e3365b9db..2e1c4d1823c 100644 --- a/test/test_board.py +++ b/test/test_board.py @@ -422,7 +422,7 @@ def test_board_details_old(run_command): result = run_command("core update-index") assert result.ok # Download samd core pinned to 1.8.6 - result = run_command("core install arduino:samd@1.8.6") + result = run_command("core install --skip-post-install arduino:samd@1.8.6") assert result.ok result = run_command("board details arduino:samd:nano_33_iot --format json") assert result.ok diff --git a/test/test_compile.py b/test/test_compile.py index 341779b383a..74e72217e56 100644 --- a/test/test_compile.py +++ b/test/test_compile.py @@ -27,7 +27,7 @@ def test_compile_without_fqbn(run_command): assert result.ok # Install Arduino AVR Boards - result = run_command("core install arduino:avr@1.8.3") + result = run_command("core install --skip-post-install arduino:avr@1.8.3") assert result.ok # Build sketch without FQBN @@ -41,7 +41,7 @@ def test_compile_with_simple_sketch(run_command, data_dir, working_dir): assert result.ok # Download latest AVR - result = run_command("core install arduino:avr") + result = run_command("core install --skip-post-install arduino:avr") assert result.ok sketch_name = "CompileIntegrationTest" @@ -93,7 +93,7 @@ def test_output_flag_default_path(run_command, data_dir, working_dir): assert result.ok # Install Arduino AVR Boards - result = run_command("core install arduino:avr@1.8.3") + result = run_command("core install --skip-post-install arduino:avr@1.8.3") assert result.ok # Create a test sketch @@ -115,7 +115,7 @@ def test_compile_with_sketch_with_symlink_selfloop(run_command, data_dir): assert result.ok # Install Arduino AVR Boards - result = run_command("core install arduino:avr@1.8.3") + result = run_command("core install --skip-post-install arduino:avr@1.8.3") assert result.ok sketch_name = "CompileIntegrationTestSymlinkSelfLoop" @@ -168,8 +168,8 @@ def test_compile_and_upload_combo(run_command, data_dir, detected_boards): assert result.ok # Install required core(s) - result = run_command("core install arduino:avr@1.8.3") - result = run_command("core install arduino:samd@1.8.7") + result = run_command("core install --skip-post-install arduino:avr@1.8.3") + result = run_command("core install --skip-post-install arduino:samd@1.8.7") assert result.ok # Create a test sketch @@ -229,7 +229,7 @@ def test_compile_blacklisted_sketchname(run_command, data_dir): assert result.ok # Install Arduino AVR Boards - result = run_command("core install arduino:avr@1.8.3") + result = run_command("core install --skip-post-install arduino:avr@1.8.3") assert result.ok sketch_name = "RCS" @@ -253,11 +253,11 @@ def test_compile_without_precompiled_libraries(run_command, data_dir): assert result.ok # arduino:mbed 1.1.5 is incompatible with the Arduino_TensorFlowLite library # see: https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/93 - result = run_command("core install arduino:mbed@1.1.4 --additional-urls={}".format(url)) + result = run_command("core install --skip-post-install arduino:mbed@1.1.4 --additional-urls={}".format(url)) assert result.ok - result = run_command("core install arduino:samd@1.8.7 --additional-urls={}".format(url)) + result = run_command("core install --skip-post-install arduino:samd@1.8.7 --additional-urls={}".format(url)) assert result.ok - result = run_command("core install adafruit:samd@1.6.0 --additional-urls={}".format(url)) + result = run_command("core install --skip-post-install adafruit:samd@1.6.0 --additional-urls={}".format(url)) assert result.ok # Install pre-release version of Arduino_TensorFlowLite (will be officially released diff --git a/test/test_core.py b/test/test_core.py index ffc0ac70b30..99ce33a15bb 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -49,7 +49,7 @@ def test_core_search_no_args(run_command): # update custom index and install test core (installed cores affect `core search`) url = "https://raw.githubusercontent.com/arduino/arduino-cli/master/test/testdata/test_index.json" assert run_command("core update-index --additional-urls={}".format(url)) - assert run_command("core install test:x86 --additional-urls={}".format(url)) + assert run_command("core install test:x86 --skip-post-install --additional-urls={}".format(url)) # list all with no additional urls, ensure the test core won't show up result = run_command("core search") @@ -115,7 +115,7 @@ def test_core_install_esp32(run_command, data_dir): url = "https://dl.espressif.com/dl/package_esp32_index.json" assert run_command("core update-index --additional-urls={}".format(url)) # install 3rd-party core - assert run_command("core install esp32:esp32@1.0.4 --additional-urls={}".format(url)) + assert run_command("core install esp32:esp32@1.0.4 --skip-post-install --additional-urls={}".format(url)) # create a sketch and compile to double check the core was successfully installed sketch_path = os.path.join(data_dir, "test_core_install_esp32") assert run_command("sketch new {}".format(sketch_path)) @@ -157,13 +157,13 @@ def test_core_install(run_command): assert run_command("core update-index") # Install a specific core version - assert run_command("core install arduino:avr@1.6.16") + assert run_command("core install --skip-post-install arduino:avr@1.6.16") result = run_command("core list --format json") assert result.ok assert _in(result.stdout, "arduino:avr", "1.6.16") # Replace it with a more recent one - assert run_command("core install arduino:avr@1.6.17") + assert run_command("core install --skip-post-install arduino:avr@1.6.17") result = run_command("core list --format json") assert result.ok assert _in(result.stdout, "arduino:avr", "1.6.17") @@ -186,7 +186,7 @@ def test_core_install(run_command): def test_core_uninstall(run_command): assert run_command("core update-index") - assert run_command("core install arduino:avr") + assert run_command("core install --skip-post-install arduino:avr") result = run_command("core list --format json") assert result.ok assert _in(result.stdout, "arduino:avr") diff --git a/test/test_outdated.py b/test/test_outdated.py index 99b83ee9271..aa2b62875e3 100644 --- a/test/test_outdated.py +++ b/test/test_outdated.py @@ -20,11 +20,11 @@ def test_outdated(run_command): assert run_command("lib update-index") # Installs an outdated core and library - assert run_command("core install arduino:avr@1.6.3") + assert run_command("core install --skip-post-install arduino:avr@1.6.3") assert run_command("lib install USBHost@1.0.0") # Installs latest version of a core and a library - assert run_command("core install arduino:samd") + assert run_command("core install --skip-post-install arduino:samd") assert run_command("lib install ArduinoJson") # Verifies only outdated cores and libraries are returned diff --git a/test/test_update.py b/test/test_update.py index d08580e7666..68fc370c26c 100644 --- a/test/test_update.py +++ b/test/test_update.py @@ -30,11 +30,11 @@ def test_update_showing_outdated(run_command): assert run_command("lib update-index") # Installs an outdated core and library - assert run_command("core install arduino:avr@1.6.3") + assert run_command("core install --skip-post-install arduino:avr@1.6.3") assert run_command("lib install USBHost@1.0.0") # Installs latest version of a core and a library - assert run_command("core install arduino:samd") + assert run_command("core install --skip-post-install arduino:samd") assert run_command("lib install ArduinoJson") # Verifies outdated cores and libraries are printed after updating indexes diff --git a/test/test_upgrade.py b/test/test_upgrade.py index f90a5356520..15611a9cd63 100644 --- a/test/test_upgrade.py +++ b/test/test_upgrade.py @@ -20,11 +20,11 @@ def test_upgrade(run_command): assert run_command("lib update-index") # Installs an outdated core and library - assert run_command("core install arduino:avr@1.6.3") + assert run_command("core install arduino:avr@1.6.3 --skip-post-install") assert run_command("lib install USBHost@1.0.0") # Installs latest version of a core and a library - assert run_command("core install arduino:samd") + assert run_command("core install arduino:samd --skip-post-install") assert run_command("lib install ArduinoJson") # Verifies outdated core and libraries are shown diff --git a/test/test_upload.py b/test/test_upload.py index 439bd98d084..228417f82af 100644 --- a/test/test_upload.py +++ b/test/test_upload.py @@ -28,7 +28,7 @@ def test_upload(run_command, data_dir, detected_boards): for board in detected_boards: # Download core - assert run_command("core install {}".format(board.core)) + assert run_command("core install --skip-post-install {}".format(board.core)) # Create a sketch sketch_path = os.path.join(data_dir, "foo") assert run_command("sketch new {}".format(sketch_path)) @@ -51,7 +51,7 @@ def test_upload_after_attach(run_command, data_dir, detected_boards): for board in detected_boards: # Download core - assert run_command("core install {}".format(board.core)) + assert run_command("core install --skip-post-install {}".format(board.core)) # Create a sketch sketch_path = os.path.join(data_dir, "foo") assert run_command("sketch new {}".format(sketch_path)) From b9f82149800f0731bc8fa6522d8b93d956d67086 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 17 Aug 2020 11:43:42 +0200 Subject: [PATCH 08/10] Revert "Do not perform drivers install during integration tests" This reverts commit 382581a9644def74417059ff5ad5ab2336325936. --- test/test_board.py | 2 +- test/test_compile.py | 20 ++++++++++---------- test/test_core.py | 10 +++++----- test/test_outdated.py | 4 ++-- test/test_update.py | 4 ++-- test/test_upgrade.py | 4 ++-- test/test_upload.py | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/test/test_board.py b/test/test_board.py index 2e1c4d1823c..f1e3365b9db 100644 --- a/test/test_board.py +++ b/test/test_board.py @@ -422,7 +422,7 @@ def test_board_details_old(run_command): result = run_command("core update-index") assert result.ok # Download samd core pinned to 1.8.6 - result = run_command("core install --skip-post-install arduino:samd@1.8.6") + result = run_command("core install arduino:samd@1.8.6") assert result.ok result = run_command("board details arduino:samd:nano_33_iot --format json") assert result.ok diff --git a/test/test_compile.py b/test/test_compile.py index 74e72217e56..341779b383a 100644 --- a/test/test_compile.py +++ b/test/test_compile.py @@ -27,7 +27,7 @@ def test_compile_without_fqbn(run_command): assert result.ok # Install Arduino AVR Boards - result = run_command("core install --skip-post-install arduino:avr@1.8.3") + result = run_command("core install arduino:avr@1.8.3") assert result.ok # Build sketch without FQBN @@ -41,7 +41,7 @@ def test_compile_with_simple_sketch(run_command, data_dir, working_dir): assert result.ok # Download latest AVR - result = run_command("core install --skip-post-install arduino:avr") + result = run_command("core install arduino:avr") assert result.ok sketch_name = "CompileIntegrationTest" @@ -93,7 +93,7 @@ def test_output_flag_default_path(run_command, data_dir, working_dir): assert result.ok # Install Arduino AVR Boards - result = run_command("core install --skip-post-install arduino:avr@1.8.3") + result = run_command("core install arduino:avr@1.8.3") assert result.ok # Create a test sketch @@ -115,7 +115,7 @@ def test_compile_with_sketch_with_symlink_selfloop(run_command, data_dir): assert result.ok # Install Arduino AVR Boards - result = run_command("core install --skip-post-install arduino:avr@1.8.3") + result = run_command("core install arduino:avr@1.8.3") assert result.ok sketch_name = "CompileIntegrationTestSymlinkSelfLoop" @@ -168,8 +168,8 @@ def test_compile_and_upload_combo(run_command, data_dir, detected_boards): assert result.ok # Install required core(s) - result = run_command("core install --skip-post-install arduino:avr@1.8.3") - result = run_command("core install --skip-post-install arduino:samd@1.8.7") + result = run_command("core install arduino:avr@1.8.3") + result = run_command("core install arduino:samd@1.8.7") assert result.ok # Create a test sketch @@ -229,7 +229,7 @@ def test_compile_blacklisted_sketchname(run_command, data_dir): assert result.ok # Install Arduino AVR Boards - result = run_command("core install --skip-post-install arduino:avr@1.8.3") + result = run_command("core install arduino:avr@1.8.3") assert result.ok sketch_name = "RCS" @@ -253,11 +253,11 @@ def test_compile_without_precompiled_libraries(run_command, data_dir): assert result.ok # arduino:mbed 1.1.5 is incompatible with the Arduino_TensorFlowLite library # see: https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/93 - result = run_command("core install --skip-post-install arduino:mbed@1.1.4 --additional-urls={}".format(url)) + result = run_command("core install arduino:mbed@1.1.4 --additional-urls={}".format(url)) assert result.ok - result = run_command("core install --skip-post-install arduino:samd@1.8.7 --additional-urls={}".format(url)) + result = run_command("core install arduino:samd@1.8.7 --additional-urls={}".format(url)) assert result.ok - result = run_command("core install --skip-post-install adafruit:samd@1.6.0 --additional-urls={}".format(url)) + result = run_command("core install adafruit:samd@1.6.0 --additional-urls={}".format(url)) assert result.ok # Install pre-release version of Arduino_TensorFlowLite (will be officially released diff --git a/test/test_core.py b/test/test_core.py index 99ce33a15bb..ffc0ac70b30 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -49,7 +49,7 @@ def test_core_search_no_args(run_command): # update custom index and install test core (installed cores affect `core search`) url = "https://raw.githubusercontent.com/arduino/arduino-cli/master/test/testdata/test_index.json" assert run_command("core update-index --additional-urls={}".format(url)) - assert run_command("core install test:x86 --skip-post-install --additional-urls={}".format(url)) + assert run_command("core install test:x86 --additional-urls={}".format(url)) # list all with no additional urls, ensure the test core won't show up result = run_command("core search") @@ -115,7 +115,7 @@ def test_core_install_esp32(run_command, data_dir): url = "https://dl.espressif.com/dl/package_esp32_index.json" assert run_command("core update-index --additional-urls={}".format(url)) # install 3rd-party core - assert run_command("core install esp32:esp32@1.0.4 --skip-post-install --additional-urls={}".format(url)) + assert run_command("core install esp32:esp32@1.0.4 --additional-urls={}".format(url)) # create a sketch and compile to double check the core was successfully installed sketch_path = os.path.join(data_dir, "test_core_install_esp32") assert run_command("sketch new {}".format(sketch_path)) @@ -157,13 +157,13 @@ def test_core_install(run_command): assert run_command("core update-index") # Install a specific core version - assert run_command("core install --skip-post-install arduino:avr@1.6.16") + assert run_command("core install arduino:avr@1.6.16") result = run_command("core list --format json") assert result.ok assert _in(result.stdout, "arduino:avr", "1.6.16") # Replace it with a more recent one - assert run_command("core install --skip-post-install arduino:avr@1.6.17") + assert run_command("core install arduino:avr@1.6.17") result = run_command("core list --format json") assert result.ok assert _in(result.stdout, "arduino:avr", "1.6.17") @@ -186,7 +186,7 @@ def test_core_install(run_command): def test_core_uninstall(run_command): assert run_command("core update-index") - assert run_command("core install --skip-post-install arduino:avr") + assert run_command("core install arduino:avr") result = run_command("core list --format json") assert result.ok assert _in(result.stdout, "arduino:avr") diff --git a/test/test_outdated.py b/test/test_outdated.py index aa2b62875e3..99b83ee9271 100644 --- a/test/test_outdated.py +++ b/test/test_outdated.py @@ -20,11 +20,11 @@ def test_outdated(run_command): assert run_command("lib update-index") # Installs an outdated core and library - assert run_command("core install --skip-post-install arduino:avr@1.6.3") + assert run_command("core install arduino:avr@1.6.3") assert run_command("lib install USBHost@1.0.0") # Installs latest version of a core and a library - assert run_command("core install --skip-post-install arduino:samd") + assert run_command("core install arduino:samd") assert run_command("lib install ArduinoJson") # Verifies only outdated cores and libraries are returned diff --git a/test/test_update.py b/test/test_update.py index 68fc370c26c..d08580e7666 100644 --- a/test/test_update.py +++ b/test/test_update.py @@ -30,11 +30,11 @@ def test_update_showing_outdated(run_command): assert run_command("lib update-index") # Installs an outdated core and library - assert run_command("core install --skip-post-install arduino:avr@1.6.3") + assert run_command("core install arduino:avr@1.6.3") assert run_command("lib install USBHost@1.0.0") # Installs latest version of a core and a library - assert run_command("core install --skip-post-install arduino:samd") + assert run_command("core install arduino:samd") assert run_command("lib install ArduinoJson") # Verifies outdated cores and libraries are printed after updating indexes diff --git a/test/test_upgrade.py b/test/test_upgrade.py index 15611a9cd63..f90a5356520 100644 --- a/test/test_upgrade.py +++ b/test/test_upgrade.py @@ -20,11 +20,11 @@ def test_upgrade(run_command): assert run_command("lib update-index") # Installs an outdated core and library - assert run_command("core install arduino:avr@1.6.3 --skip-post-install") + assert run_command("core install arduino:avr@1.6.3") assert run_command("lib install USBHost@1.0.0") # Installs latest version of a core and a library - assert run_command("core install arduino:samd --skip-post-install") + assert run_command("core install arduino:samd") assert run_command("lib install ArduinoJson") # Verifies outdated core and libraries are shown diff --git a/test/test_upload.py b/test/test_upload.py index 228417f82af..439bd98d084 100644 --- a/test/test_upload.py +++ b/test/test_upload.py @@ -28,7 +28,7 @@ def test_upload(run_command, data_dir, detected_boards): for board in detected_boards: # Download core - assert run_command("core install --skip-post-install {}".format(board.core)) + assert run_command("core install {}".format(board.core)) # Create a sketch sketch_path = os.path.join(data_dir, "foo") assert run_command("sketch new {}".format(sketch_path)) @@ -51,7 +51,7 @@ def test_upload_after_attach(run_command, data_dir, detected_boards): for board in detected_boards: # Download core - assert run_command("core install --skip-post-install {}".format(board.core)) + assert run_command("core install {}".format(board.core)) # Create a sketch sketch_path = os.path.join(data_dir, "foo") assert run_command("sketch new {}".format(sketch_path)) From 8771bae728f0c80fbfd25ea6dc467b03bca5043b Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 17 Aug 2020 16:36:46 +0200 Subject: [PATCH 09/10] Run post-install scripts by default only if the CLI is interactive This should prevent CI-based runs to block waiting for user interaction. --- cli/core/install.go | 35 ++++++++++++++++++++++++++++++++--- cli/core/upgrade.go | 8 ++------ configuration/term.go | 28 ++++++++++++++++++++++++++++ go.mod | 3 ++- go.sum | 12 ++---------- 5 files changed, 66 insertions(+), 20 deletions(-) create mode 100644 configuration/term.go diff --git a/cli/core/install.go b/cli/core/install.go index 5f9db92f958..d2c262fca9d 100644 --- a/cli/core/install.go +++ b/cli/core/install.go @@ -25,6 +25,7 @@ import ( "github.com/arduino/arduino-cli/cli/instance" "github.com/arduino/arduino-cli/cli/output" "github.com/arduino/arduino-cli/commands/core" + "github.com/arduino/arduino-cli/configuration" rpc "github.com/arduino/arduino-cli/rpc/commands" "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -42,14 +43,42 @@ func initInstallCommand() *cobra.Command { Args: cobra.MinimumNArgs(1), Run: runInstallCommand, } - installCommand.Flags().BoolVar(&installFlags.skipPostInstall, "skip-post-install", false, "Do not run post-install scripts.") + addPostInstallFlagsToCommand(installCommand) return installCommand } -var installFlags struct { +var postInstallFlags struct { + runPostInstall bool skipPostInstall bool } +func addPostInstallFlagsToCommand(cmd *cobra.Command) { + cmd.Flags().BoolVar(&postInstallFlags.runPostInstall, "run-post-install", false, "Force run of post-install scripts (if the CLI is not running interactively).") + cmd.Flags().BoolVar(&postInstallFlags.skipPostInstall, "skip-post-install", false, "Force skip of post-install scripts (if the CLI is running interactively).") +} + +func detectSkipPostInstallValue() bool { + if postInstallFlags.runPostInstall && postInstallFlags.skipPostInstall { + feedback.Errorf("The flags --run-post-install and --skip-post-install can't be both set at the same time.") + os.Exit(errorcodes.ErrBadArgument) + } + if postInstallFlags.runPostInstall { + logrus.Info("Will run post-install by user request") + return false + } + if postInstallFlags.skipPostInstall { + logrus.Info("Will skip post-install by user request") + return true + } + + if !configuration.IsInteractive { + logrus.Info("Not running from console, will skip post-install by default") + return true + } + logrus.Info("Running from console, will run post-install by default") + return false +} + func runInstallCommand(cmd *cobra.Command, args []string) { inst, err := instance.CreateInstance() if err != nil { @@ -71,7 +100,7 @@ func runInstallCommand(cmd *cobra.Command, args []string) { PlatformPackage: platformRef.PackageName, Architecture: platformRef.Architecture, Version: platformRef.Version, - SkipPostInstall: installFlags.skipPostInstall, + SkipPostInstall: detectSkipPostInstallValue(), } _, err := core.PlatformInstall(context.Background(), platformInstallReq, output.ProgressBar(), output.TaskProgress()) if err != nil { diff --git a/cli/core/upgrade.go b/cli/core/upgrade.go index c5bce7ab130..6fac411424f 100644 --- a/cli/core/upgrade.go +++ b/cli/core/upgrade.go @@ -42,14 +42,10 @@ func initUpgradeCommand() *cobra.Command { " " + os.Args[0] + " core upgrade arduino:samd", Run: runUpgradeCommand, } - upgradeCommand.Flags().BoolVar(&upgradeFlags.skipPostInstall, "skip-post-install", false, "Do not run post-install scripts.") + addPostInstallFlagsToCommand(upgradeCommand) return upgradeCommand } -var upgradeFlags struct { - skipPostInstall bool -} - func runUpgradeCommand(cmd *cobra.Command, args []string) { inst, err := instance.CreateInstance() if err != nil { @@ -96,7 +92,7 @@ func runUpgradeCommand(cmd *cobra.Command, args []string) { Instance: inst, PlatformPackage: platformRef.PackageName, Architecture: platformRef.Architecture, - SkipPostInstall: upgradeFlags.skipPostInstall, + SkipPostInstall: detectSkipPostInstallValue(), } _, err := core.PlatformUpgrade(context.Background(), r, output.ProgressBar(), output.TaskProgress()) diff --git a/configuration/term.go b/configuration/term.go new file mode 100644 index 00000000000..5d83f50e7fa --- /dev/null +++ b/configuration/term.go @@ -0,0 +1,28 @@ +// This file is part of arduino-cli. +// +// Copyright 2020 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package configuration + +import ( + "os" + + "github.com/mattn/go-isatty" +) + +// IsInteractive is set to true if the CLI is interactive (it can receive inputs from terminal/console) +var IsInteractive = isatty.IsTerminal(os.Stdin.Fd()) || isatty.IsCygwinTerminal(os.Stdin.Fd()) + +// HasConsole is set to true if the CLI outputs to a terminal/console +var HasConsole = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd()) diff --git a/go.mod b/go.mod index 958cb993898..98777a870ef 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,8 @@ require ( github.com/leonelquinteros/gotext v1.4.0 github.com/marcinbor85/gohex v0.0.0-20200531163658-baab2527a9a2 github.com/mattn/go-colorable v0.1.2 - github.com/mattn/go-runewidth v0.0.2 // indirect + github.com/mattn/go-isatty v0.0.8 + github.com/mattn/go-runewidth v0.0.9 // indirect github.com/miekg/dns v1.0.5 // indirect github.com/oleksandr/bonjour v0.0.0-20160508152359-5dcf00d8b228 // indirect github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index b9f3a932c64..19593a3e1b2 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,6 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/GeertJohan/go.incremental v1.0.0 h1:7AH+pY1XUgQE4Y1HcXYaMqAI0m9yrFqo/jt0CW30vsg= github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= -github.com/GeertJohan/go.rice v1.0.0 h1:KkI6O9uMaQU3VEKaj01ulavtF7o1fWT7+pk/4voiMLQ= -github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/akavel/rsrc v0.8.0 h1:zjWn7ukO9Kc5Q62DOJCcxGpXC18RawVtYAGdz2aLlfw= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= @@ -143,8 +141,8 @@ github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mdlayher/genetlink v0.0.0-20190313224034-60417448a851/go.mod h1:EsbsAEUEs15qC1cosAwxgCWV0Qhd8TmkxnA9Kw1Vhl4= github.com/mdlayher/netlink v0.0.0-20190313131330-258ea9dff42c/go.mod h1:eQB3mZE4aiYnlUsyGGCOpPETfdQq4Jhsgf1fk3cwQaA= @@ -155,8 +153,6 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229 h1:E2B8qYyeSgv5MXpmzZXRNp8IAQ4vjxIjhpAf5hv/tAg= -github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= github.com/nkovacs/streamquote v1.0.0/go.mod h1:BN+NaZ2CmdKqUuTUXUEm9j95B2TRbpOWpxbJYzzgUsc= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oleksandr/bonjour v0.0.0-20160508152359-5dcf00d8b228 h1:Cvfd2dOlXIPTeEkOT/h8PyK4phBngOM4at9/jlgy7d4= @@ -208,10 +204,6 @@ github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.0.1-0.20200629195214-2c5a0d300f8b h1:grM+VdcoRu+xbzmCXM1KuH5UQGk9Lc8yCiwZZ2PKVdU= -github.com/spf13/cobra v1.0.1-0.20200629195214-2c5a0d300f8b/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.0.1-0.20200710201246-675ae5f5a98c h1:/dP/1GnfVIlWnB0YDImenSmneUCw3wjyq2RMgAG1e2o= github.com/spf13/cobra v1.0.1-0.20200710201246-675ae5f5a98c/go.mod h1:aeNIJzz/GSSVlS+gpCpQWZ83BKbsoW57mr90+YthtkQ= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= From 522135b750d817408418677ea0d843a3a7935163 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 20 Aug 2020 11:35:44 +0200 Subject: [PATCH 10/10] Added post_install run messages --- commands/core/install.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/core/install.go b/commands/core/install.go index a37df5ff493..2f16c9bb77b 100644 --- a/commands/core/install.go +++ b/commands/core/install.go @@ -142,9 +142,13 @@ func installPlatform(pm *packagemanager.PackageManager, // Perform post install if !skipPostInstall && platformRelease.IsTrusted { log.Info("Running post_install script") + taskCB(&rpc.TaskProgress{Message: "Configuring platform (post_install run)"}) if err := pm.RunPostInstallScript(platformRelease); err != nil { return errors.Errorf("running post install: %s", err) } + } else if skipPostInstall { + log.Info("Skipping platform configuration (post_install run).") + taskCB(&rpc.TaskProgress{Message: "Skipping platform configuration (post_install run)"}) } log.Info("Platform installed")