diff --git a/arduino/cores/cores.go b/arduino/cores/cores.go index aa5d865a991..19ba9eeaf76 100644 --- a/arduino/cores/cores.go +++ b/arduino/cores/cores.go @@ -44,6 +44,7 @@ type Platform struct { Package *Package `json:"-"` ManuallyInstalled bool // true if the Platform has been installed without the CLI Deprecated bool // true if the Platform has been deprecated + Indexed bool // true if the Platform has been indexed from additional-urls } // PlatformReleaseHelp represents the help URL for this Platform release @@ -409,3 +410,13 @@ func (release *PlatformRelease) MarshalJSON() ([]byte, error) { Name: release.Platform.Name, }) } + +// HasMetadata returns true if the PlatformRelease installation dir contains the installed.json file +func (release *PlatformRelease) HasMetadata() bool { + if release.InstallDir == nil { + return false + } + + installedJSONPath := release.InstallDir.Join("installed.json") + return installedJSONPath.Exist() +} diff --git a/arduino/cores/packageindex/index.go b/arduino/cores/packageindex/index.go index 7a94e2c4bc7..61621ed4cca 100644 --- a/arduino/cores/packageindex/index.go +++ b/arduino/cores/packageindex/index.go @@ -33,8 +33,9 @@ import ( // //easyjson:json type Index struct { - Packages []*indexPackage `json:"packages"` - IsTrusted bool + Packages []*indexPackage `json:"packages"` + IsTrusted bool + isInstalledJSON bool } // indexPackage represents a single entry from package_index.json file. @@ -144,7 +145,7 @@ var tr = i18n.Tr // 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, index.IsTrusted) + inPackage.extractPackageIn(outPackages, index.IsTrusted, index.isInstalledJSON) } } @@ -243,7 +244,7 @@ func IndexFromPlatformRelease(pr *cores.PlatformRelease) Index { } } -func (inPackage indexPackage) extractPackageIn(outPackages cores.Packages, trusted bool) { +func (inPackage indexPackage) extractPackageIn(outPackages cores.Packages, trusted bool, isInstallJSON bool) { outPackage := outPackages.GetOrCreatePackage(inPackage.Name) outPackage.Maintainer = inPackage.Maintainer outPackage.WebsiteURL = inPackage.WebsiteURL @@ -256,15 +257,19 @@ func (inPackage indexPackage) extractPackageIn(outPackages cores.Packages, trust } for _, inPlatform := range inPackage.Platforms { - inPlatform.extractPlatformIn(outPackage, trusted) + inPlatform.extractPlatformIn(outPackage, trusted, isInstallJSON) } } -func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *cores.Package, trusted bool) error { +func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *cores.Package, trusted bool, isInstallJSON 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 outPlatform.Category = inPlatformRelease.Category + // If the variable `isInstallJSON` is false it means that the index we're reading is coming from the additional-urls. + // Therefore, the `outPlatform.Indexed` will be set at `true`. + outPlatform.Indexed = outPlatform.Indexed || !isInstallJSON + // If the Platform is installed before deprecation installed.json file does not include "deprecated" field. // The installed.json is read during loading phase of an installed Platform, if the deprecated field is not found // the package_index.json field would be overwritten and the deprecation info would be lost. @@ -398,6 +403,11 @@ func LoadIndex(jsonIndexFile *paths.Path) (*Index, error) { } else { logrus.WithField("index", jsonIndexFile).Infof("Missing signature file") } + + if jsonIndexFile.Base() == "installed.json" { + index.isInstalledJSON = true + } + return &index, nil } diff --git a/arduino/cores/packagemanager/install_uninstall.go b/arduino/cores/packagemanager/install_uninstall.go index ca18e794cd1..73a75c7b00d 100644 --- a/arduino/cores/packagemanager/install_uninstall.go +++ b/arduino/cores/packagemanager/install_uninstall.go @@ -38,35 +38,35 @@ func (pme *Explorer) DownloadAndInstallPlatformUpgrades( downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB, skipPostInstall bool, -) error { +) (*cores.PlatformRelease, error) { if platformRef.PlatformVersion != nil { - return &arduino.InvalidArgumentError{Message: tr("Upgrade doesn't accept parameters with version")} + return nil, &arduino.InvalidArgumentError{Message: tr("Upgrade doesn't accept parameters with version")} } // Search the latest version for all specified platforms platform := pme.FindPlatform(platformRef) if platform == nil { - return &arduino.PlatformNotFoundError{Platform: platformRef.String()} + return nil, &arduino.PlatformNotFoundError{Platform: platformRef.String()} } installed := pme.GetInstalledPlatformRelease(platform) if installed == nil { - return &arduino.PlatformNotFoundError{Platform: platformRef.String()} + return nil, &arduino.PlatformNotFoundError{Platform: platformRef.String()} } latest := platform.GetLatestRelease() if !latest.Version.GreaterThan(installed.Version) { - return &arduino.PlatformAlreadyAtTheLatestVersionError{} + return installed, &arduino.PlatformAlreadyAtTheLatestVersionError{Platform: platformRef.String()} } platformRef.PlatformVersion = latest.Version platformRelease, tools, err := pme.FindPlatformReleaseDependencies(platformRef) if err != nil { - return &arduino.PlatformNotFoundError{Platform: platformRef.String()} + return nil, &arduino.PlatformNotFoundError{Platform: platformRef.String()} } if err := pme.DownloadAndInstallPlatformAndTools(platformRelease, tools, downloadCB, taskCB, skipPostInstall); err != nil { - return err + return nil, err } - return nil + return platformRelease, nil } // DownloadAndInstallPlatformAndTools runs a full installation process for the given platform and tools. diff --git a/commands/board/listall.go b/commands/board/listall.go index afa0d78b540..99735658038 100644 --- a/commands/board/listall.go +++ b/commands/board/listall.go @@ -62,6 +62,8 @@ func ListAll(ctx context.Context, req *rpc.BoardListAllRequest) (*rpc.BoardListA Website: platform.Package.WebsiteURL, Email: platform.Package.Email, ManuallyInstalled: platform.ManuallyInstalled, + Indexed: platform.Indexed, + MissingMetadata: !installedPlatformRelease.HasMetadata(), } toTest := []string{ diff --git a/commands/board/search.go b/commands/board/search.go index dd881a39023..74d5946faaf 100644 --- a/commands/board/search.go +++ b/commands/board/search.go @@ -54,6 +54,7 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR Website: platform.Package.WebsiteURL, Email: platform.Package.Email, ManuallyInstalled: platform.ManuallyInstalled, + Indexed: platform.Indexed, } if latestPlatformRelease != nil { @@ -61,6 +62,7 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR } if installedPlatformRelease != nil { rpcPlatform.Installed = installedPlatformRelease.Version.String() + rpcPlatform.MissingMetadata = !installedPlatformRelease.HasMetadata() } // Platforms that are not installed don't have a list of boards diff --git a/commands/core.go b/commands/core.go index 4a214773c46..f75fbce04f4 100644 --- a/commands/core.go +++ b/commands/core.go @@ -62,6 +62,8 @@ func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform ManuallyInstalled: platformRelease.Platform.ManuallyInstalled, Deprecated: platformRelease.Platform.Deprecated, Type: []string{platformRelease.Platform.Category}, + Indexed: platformRelease.Platform.Indexed, + MissingMetadata: !platformRelease.HasMetadata(), } return result diff --git a/commands/core/search_test.go b/commands/core/search_test.go index 3fb86782457..2bbb027abf5 100644 --- a/commands/core/search_test.go +++ b/commands/core/search_test.go @@ -53,28 +53,32 @@ func TestPlatformSearch(t *testing.T) { require.Len(t, res.SearchOutput, 2) require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Id: "Retrokits-RK002:arm", + Installed: "", + Latest: "1.0.5", + Name: "RK002", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Boards: []*rpc.Board{{Name: "RK002"}}, + Type: []string{"Contributed"}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Indexed: true, + MissingMetadata: true, }) require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Id: "Retrokits-RK002:arm", + Installed: "", + Latest: "1.0.6", + Name: "RK002", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Boards: []*rpc.Board{{Name: "RK002"}}, + Type: []string{"Contributed"}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Indexed: true, + MissingMetadata: true, }) res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ @@ -86,16 +90,18 @@ func TestPlatformSearch(t *testing.T) { require.NotNil(t, res) require.Len(t, res.SearchOutput, 1) require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Id: "Retrokits-RK002:arm", + Installed: "", + Latest: "1.0.6", + Name: "RK002", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Boards: []*rpc.Board{{Name: "RK002"}}, + Type: []string{"Contributed"}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Indexed: true, + MissingMetadata: true, }) // Search the Package Maintainer @@ -108,28 +114,32 @@ func TestPlatformSearch(t *testing.T) { require.NotNil(t, res) require.Len(t, res.SearchOutput, 2) require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Id: "Retrokits-RK002:arm", + Installed: "", + Latest: "1.0.5", + Name: "RK002", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Boards: []*rpc.Board{{Name: "RK002"}}, + Type: []string{"Contributed"}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Indexed: true, + MissingMetadata: true, }) require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Id: "Retrokits-RK002:arm", + Installed: "", + Latest: "1.0.6", + Name: "RK002", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Boards: []*rpc.Board{{Name: "RK002"}}, + Type: []string{"Contributed"}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Indexed: true, + MissingMetadata: true, }) // Search using the Package name @@ -142,28 +152,32 @@ func TestPlatformSearch(t *testing.T) { require.NotNil(t, res) require.Len(t, res.SearchOutput, 2) require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Id: "Retrokits-RK002:arm", + Installed: "", + Latest: "1.0.5", + Name: "RK002", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Boards: []*rpc.Board{{Name: "RK002"}}, + Type: []string{"Contributed"}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Indexed: true, + MissingMetadata: true, }) require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Id: "Retrokits-RK002:arm", + Installed: "", + Latest: "1.0.6", + Name: "RK002", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Boards: []*rpc.Board{{Name: "RK002"}}, + Type: []string{"Contributed"}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Indexed: true, + MissingMetadata: true, }) // Search using the Platform name @@ -176,28 +190,32 @@ func TestPlatformSearch(t *testing.T) { require.NotNil(t, res) require.Len(t, res.SearchOutput, 2) require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Id: "Retrokits-RK002:arm", + Installed: "", + Latest: "1.0.5", + Name: "RK002", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Boards: []*rpc.Board{{Name: "RK002"}}, + Type: []string{"Contributed"}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Indexed: true, + MissingMetadata: true, }) require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Id: "Retrokits-RK002:arm", + Installed: "", + Latest: "1.0.6", + Name: "RK002", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Boards: []*rpc.Board{{Name: "RK002"}}, + Type: []string{"Contributed"}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + Indexed: true, + MissingMetadata: true, }) // Search using a board name @@ -246,7 +264,9 @@ func TestPlatformSearch(t *testing.T) { {Name: "Arduino Industrial 101"}, {Name: "Linino One"}, }, - Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, + Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, + Indexed: true, + MissingMetadata: true, }) res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ @@ -294,7 +314,9 @@ func TestPlatformSearch(t *testing.T) { {Name: "Arduino Industrial 101"}, {Name: "Linino One"}, }, - Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, + Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, + Indexed: true, + MissingMetadata: true, }) } diff --git a/commands/core/upgrade.go b/commands/core/upgrade.go index cee01487603..ee8f4b0a3f7 100644 --- a/commands/core/upgrade.go +++ b/commands/core/upgrade.go @@ -17,6 +17,7 @@ package core import ( "context" + "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino" "github.com/arduino/arduino-cli/arduino/cores/packagemanager" @@ -26,10 +27,10 @@ import ( // PlatformUpgrade FIXMEDOC func PlatformUpgrade(ctx context.Context, req *rpc.PlatformUpgradeRequest, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) (*rpc.PlatformUpgradeResponse, error) { - upgrade := func() error { + upgrade := func() (*cores.PlatformRelease, error) { pme, release := commands.GetPackageManagerExplorer(req) if pme == nil { - return &arduino.InvalidInstanceError{} + return nil, &arduino.InvalidInstanceError{} } defer release() @@ -38,18 +39,26 @@ func PlatformUpgrade(ctx context.Context, req *rpc.PlatformUpgradeRequest, downl Package: req.PlatformPackage, PlatformArchitecture: req.Architecture, } - if err := pme.DownloadAndInstallPlatformUpgrades(ref, downloadCB, taskCB, req.GetSkipPostInstall()); err != nil { - return err + platform, err := pme.DownloadAndInstallPlatformUpgrades(ref, downloadCB, taskCB, req.GetSkipPostInstall()) + if err != nil { + return platform, err } - return nil + return platform, nil } - if err := upgrade(); err != nil { - return nil, err + var rpcPlatform *rpc.Platform + + platformRelease, err := upgrade() + if platformRelease != nil { + rpcPlatform = commands.PlatformReleaseToRPC(platformRelease) + } + if err != nil { + return &rpc.PlatformUpgradeResponse{Platform: rpcPlatform}, err } if err := commands.Init(&rpc.InitRequest{Instance: req.Instance}, nil); err != nil { return nil, err } - return &rpc.PlatformUpgradeResponse{}, nil + + return &rpc.PlatformUpgradeResponse{Platform: rpcPlatform}, nil } diff --git a/commands/daemon/daemon.go b/commands/daemon/daemon.go index 748e7bfaf6a..7d01aef850b 100644 --- a/commands/daemon/daemon.go +++ b/commands/daemon/daemon.go @@ -270,10 +270,10 @@ func (s *ArduinoCoreServerImpl) PlatformUpgrade(req *rpc.PlatformUpgradeRequest, func(p *rpc.DownloadProgress) { syncSend.Send(&rpc.PlatformUpgradeResponse{Progress: p}) }, func(p *rpc.TaskProgress) { syncSend.Send(&rpc.PlatformUpgradeResponse{TaskProgress: p}) }, ) - if err != nil { - return convertErrorToRPCStatus(err) + if err2 := syncSend.Send(resp); err2 != nil { + return err2 } - return syncSend.Send(resp) + return convertErrorToRPCStatus(err) } // PlatformSearch FIXMEDOC diff --git a/commands/instances.go b/commands/instances.go index 8194f3dbd03..cbd8df340df 100644 --- a/commands/instances.go +++ b/commands/instances.go @@ -270,31 +270,6 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro // even if it should not. pmb, commitPackageManager := instance.pm.NewBuilder() - loadBuiltinTools := func() []error { - builtinPackage := pmb.GetOrCreatePackage("builtin") - return pmb.LoadToolsFromPackageDir(builtinPackage, pmb.PackagesDir.Join("builtin", "tools")) - } - - // Load Platforms - if profile == nil { - for _, err := range pmb.LoadHardware() { - s := &arduino.PlatformLoadingError{Cause: err} - responseError(s.ToRPCStatus()) - } - } else { - // Load platforms from profile - errs := pmb.LoadHardwareForProfile( - profile, true, downloadCallback, taskCallback, - ) - for _, err := range errs { - s := &arduino.PlatformLoadingError{Cause: err} - responseError(s.ToRPCStatus()) - } - - // Load "builtin" tools - _ = loadBuiltinTools() - } - // Load packages index urls := []string{globals.DefaultIndexURL} if profile == nil { @@ -335,6 +310,31 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro } } + loadBuiltinTools := func() []error { + builtinPackage := pmb.GetOrCreatePackage("builtin") + return pmb.LoadToolsFromPackageDir(builtinPackage, pmb.PackagesDir.Join("builtin", "tools")) + } + + // Load Platforms + if profile == nil { + for _, err := range pmb.LoadHardware() { + s := &arduino.PlatformLoadingError{Cause: err} + responseError(s.ToRPCStatus()) + } + } else { + // Load platforms from profile + errs := pmb.LoadHardwareForProfile( + profile, true, downloadCallback, taskCallback, + ) + for _, err := range errs { + s := &arduino.PlatformLoadingError{Cause: err} + responseError(s.ToRPCStatus()) + } + + // Load "builtin" tools + _ = loadBuiltinTools() + } + // We load hardware before verifying builtin tools are installed // otherwise we wouldn't find them and reinstall them each time // and they would never get reloaded. diff --git a/internal/cli/core/upgrade.go b/internal/cli/core/upgrade.go index bee890dcac5..3884bdd8129 100644 --- a/internal/cli/core/upgrade.go +++ b/internal/cli/core/upgrade.go @@ -78,6 +78,15 @@ func Upgrade(inst *rpc.Instance, args []string, skipPostInstall bool) { } } + warningMissingIndex := func(response *rpc.PlatformUpgradeResponse) { + if response == nil || response.Platform == nil { + return + } + if !response.Platform.Indexed { + feedback.Warning(tr("missing package index for %s, future updates cannot be guaranteed", response.Platform.Id)) + } + } + // proceed upgrading, if anything is upgradable platformsRefs, err := arguments.ParseReferences(args) if err != nil { @@ -98,7 +107,9 @@ func Upgrade(inst *rpc.Instance, args []string, skipPostInstall bool) { Architecture: platformRef.Architecture, SkipPostInstall: skipPostInstall, } - if _, err := core.PlatformUpgrade(context.Background(), r, feedback.ProgressBar(), feedback.TaskProgress()); err != nil { + response, err := core.PlatformUpgrade(context.Background(), r, feedback.ProgressBar(), feedback.TaskProgress()) + warningMissingIndex(response) + if err != nil { if errors.Is(err, &arduino.PlatformAlreadyAtTheLatestVersionError{}) { feedback.Print(err.Error()) continue diff --git a/internal/integrationtest/arduino-cli.go b/internal/integrationtest/arduino-cli.go index 6df85c7a1ff..5f550e03693 100644 --- a/internal/integrationtest/arduino-cli.go +++ b/internal/integrationtest/arduino-cli.go @@ -458,3 +458,15 @@ func (inst *ArduinoCLIInstance) UpdateIndex(ctx context.Context, ignoreCustomPac logCallf(">>> UpdateIndex(%+v)\n", req) return updCl, err } + +// PlatformUpgrade calls the "PlatformUpgrade" gRPC method. +func (inst *ArduinoCLIInstance) PlatformUpgrade(ctx context.Context, packager, arch string, skipPostInst bool) (commands.ArduinoCoreService_PlatformUpgradeClient, error) { + installCl, err := inst.cli.daemonClient.PlatformUpgrade(ctx, &commands.PlatformUpgradeRequest{ + Instance: inst.instance, + PlatformPackage: packager, + Architecture: arch, + SkipPostInstall: skipPostInst, + }) + logCallf(">>> PlatformUpgrade(%v:%v)\n", packager, arch) + return installCl, err +} diff --git a/internal/integrationtest/core/core_test.go b/internal/integrationtest/core/core_test.go index 55030c1d316..da13160ee1e 100644 --- a/internal/integrationtest/core/core_test.go +++ b/internal/integrationtest/core/core_test.go @@ -1026,3 +1026,31 @@ func TestCoreBrokenDependency(t *testing.T) { require.Error(t, err) require.Contains(t, string(stderr), "try contacting test@example.com") } + +func TestCoreUpgradeWarningWithPackageInstalledButNotIndexed(t *testing.T) { + env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) + defer env.CleanUp() + + url := env.HTTPServeFile(8000, paths.New("..", "testdata", "test_index.json")).String() + + t.Run("missing additional-urls", func(t *testing.T) { + // update index + _, _, err := cli.Run("core", "update-index", "--additional-urls="+url) + require.NoError(t, err) + // install 3rd-party core outdated version + _, _, err = cli.Run("core", "install", "test:x86@1.0.0", "--additional-urls="+url) + require.NoError(t, err) + //upgrade without index fires a warning + _, jsonStderr, _ := cli.Run("core", "upgrade", "test:x86", "--format", "json") + requirejson.Query(t, jsonStderr, ".warnings[]", `"missing package index for test:x86, future updates cannot be guaranteed"`) + }) + + // removing installed.json + installedJson := cli.DataDir().Join("packages", "test", "hardware", "x86", "1.0.0", "installed.json") + require.NoError(t, os.Remove(installedJson.String())) + + t.Run("missing both installed.json and additional-urls", func(t *testing.T) { + _, jsonStderr, _ := cli.Run("core", "upgrade", "test:x86", "--format", "json") + requirejson.Query(t, jsonStderr, ".warnings[]", `"missing package index for test:x86, future updates cannot be guaranteed"`) + }) +} diff --git a/internal/integrationtest/daemon/daemon_test.go b/internal/integrationtest/daemon/daemon_test.go index 45967c0b23a..4f0356f06a8 100644 --- a/internal/integrationtest/daemon/daemon_test.go +++ b/internal/integrationtest/daemon/daemon_test.go @@ -22,9 +22,11 @@ import ( "testing" "time" + "github.com/arduino/arduino-cli/arduino" "github.com/arduino/arduino-cli/internal/integrationtest" "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/go-paths-helper" + "github.com/stretchr/testify/require" ) @@ -215,26 +217,10 @@ func TestDaemonCoreUpdateIndex(t *testing.T) { ` "http://downloads.arduino.cc/package_inexistent_index.json"]`) require.NoError(t, err) - analyzeUpdateIndexClient := func(cl commands.ArduinoCoreService_UpdateIndexClient) (map[string]*commands.DownloadProgressEnd, error) { - analyzer := NewDownloadProgressAnalyzer(t) - for { - msg, err := cl.Recv() - // fmt.Println("DOWNLOAD>", msg) - if err == io.EOF { - return analyzer.Results, nil - } - if err != nil { - return analyzer.Results, err - } - require.NoError(t, err) - analyzer.Process(msg.GetDownloadProgress()) - } - } - { cl, err := grpcInst.UpdateIndex(context.Background(), true) require.NoError(t, err) - res, err := analyzeUpdateIndexClient(cl) + res, err := analyzeUpdateIndexClient(t, cl) require.NoError(t, err) require.Len(t, res, 1) require.True(t, res["https://downloads.arduino.cc/packages/package_index.tar.bz2"].Success) @@ -242,7 +228,7 @@ func TestDaemonCoreUpdateIndex(t *testing.T) { { cl, err := grpcInst.UpdateIndex(context.Background(), false) require.NoError(t, err) - res, err := analyzeUpdateIndexClient(cl) + res, err := analyzeUpdateIndexClient(t, cl) require.Error(t, err) require.Len(t, res, 3) require.True(t, res["https://downloads.arduino.cc/packages/package_index.tar.bz2"].Success) @@ -413,3 +399,158 @@ func TestDaemonLibrariesRescanOnInstall(t *testing.T) { } } + +func TestDaemonCoreUpgradePlatform(t *testing.T) { + refreshInstance := func(t *testing.T, grpcInst *integrationtest.ArduinoCLIInstance) { + require.NoError(t, grpcInst.Init("", "", func(ir *commands.InitResponse) {})) + } + updateIndexAndInstallPlatform := func(cli *integrationtest.ArduinoCLI, grpcInst *integrationtest.ArduinoCLIInstance, version string) { + refreshInstance(t, grpcInst) + + // adding the additional urls + err := cli.SetValue("board_manager.additional_urls", `["https://arduino.esp8266.com/stable/package_esp8266com_index.json"]`) + require.NoError(t, err) + + cl, err := grpcInst.UpdateIndex(context.Background(), false) + require.NoError(t, err) + res, err := analyzeUpdateIndexClient(t, cl) + require.NoError(t, err) + require.Len(t, res, 2) + require.True(t, res["https://arduino.esp8266.com/stable/package_esp8266com_index.json"].Success) + + refreshInstance(t, grpcInst) + + // installing outdated version + plInst, err := grpcInst.PlatformInstall(context.Background(), "esp8266", "esp8266", version, true) + require.NoError(t, err) + for { + _, err := plInst.Recv() + if err == io.EOF { + break + } + require.NoError(t, err) + } + } + + t.Run("upgraded successfully with additional urls", func(t *testing.T) { + t.Run("and install.json is present", func(t *testing.T) { + env, cli := createEnvForDaemon(t) + defer env.CleanUp() + + grpcInst := cli.Create() + updateIndexAndInstallPlatform(cli, grpcInst, "3.1.0") + + plUpgrade, err := grpcInst.PlatformUpgrade(context.Background(), "esp8266", "esp8266", true) + require.NoError(t, err) + + platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) + require.NoError(t, upgradeError) + require.NotNil(t, platform) + require.True(t, platform.Indexed) // the esp866 is present in the additional-urls + require.False(t, platform.MissingMetadata) // install.json is present + }) + t.Run("and install.json is missing", func(t *testing.T) { + env, cli := createEnvForDaemon(t) + defer env.CleanUp() + + grpcInst := cli.Create() + updateIndexAndInstallPlatform(cli, grpcInst, "3.1.0") + + // remove installed.json + x := env.RootDir().Join("A/packages/esp8266/hardware/esp8266/3.1.0/installed.json") + require.NoError(t, x.Remove()) + + plUpgrade, err := grpcInst.PlatformUpgrade(context.Background(), "esp8266", "esp8266", true) + require.NoError(t, err) + + platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) + require.NoError(t, upgradeError) + require.NotNil(t, platform) + require.True(t, platform.Indexed) // the esp866 is not present in the additional-urls + require.False(t, platform.MissingMetadata) // install.json is present because the old version got upgraded + + }) + }) + + t.Run("upgrade failed", func(t *testing.T) { + t.Run("without additional URLs", func(t *testing.T) { + env, cli := createEnvForDaemon(t) + defer env.CleanUp() + + grpcInst := cli.Create() + updateIndexAndInstallPlatform(cli, grpcInst, "3.1.0") + + // remove esp8266 from the additional-urls + require.NoError(t, cli.SetValue("board_manager.additional_urls", `[]`)) + refreshInstance(t, grpcInst) + + plUpgrade, err := grpcInst.PlatformUpgrade(context.Background(), "esp8266", "esp8266", true) + require.NoError(t, err) + + platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) + require.ErrorIs(t, upgradeError, (&arduino.PlatformAlreadyAtTheLatestVersionError{Platform: "esp8266:esp8266"}).ToRPCStatus().Err()) + require.NotNil(t, platform) + require.False(t, platform.Indexed) // the esp866 is not present in the additional-urls + require.False(t, platform.MissingMetadata) // install.json is present + }) + t.Run("missing both additional URLs and install.json", func(t *testing.T) { + env, cli := createEnvForDaemon(t) + defer env.CleanUp() + + grpcInst := cli.Create() + updateIndexAndInstallPlatform(cli, grpcInst, "3.1.0") + + // remove additional urls and installed.json + { + require.NoError(t, cli.SetValue("board_manager.additional_urls", `[]`)) + refreshInstance(t, grpcInst) + + x := env.RootDir().Join("A/packages/esp8266/hardware/esp8266/3.1.0/installed.json") + require.NoError(t, x.Remove()) + } + + plUpgrade, err := grpcInst.PlatformUpgrade(context.Background(), "esp8266", "esp8266", true) + require.NoError(t, err) + + platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) + require.ErrorIs(t, upgradeError, (&arduino.PlatformAlreadyAtTheLatestVersionError{Platform: "esp8266:esp8266"}).ToRPCStatus().Err()) + require.NotNil(t, platform) + require.False(t, platform.Indexed) // the esp866 is not present in the additional-urls + require.True(t, platform.MissingMetadata) // install.json is present + }) + }) +} + +func analyzeUpdateIndexClient(t *testing.T, cl commands.ArduinoCoreService_UpdateIndexClient) (map[string]*commands.DownloadProgressEnd, error) { + analyzer := NewDownloadProgressAnalyzer(t) + for { + msg, err := cl.Recv() + if err == io.EOF { + return analyzer.Results, nil + } + if err != nil { + return analyzer.Results, err + } + require.NoError(t, err) + analyzer.Process(msg.GetDownloadProgress()) + } +} + +func analyzePlatformUpgradeClient(cl commands.ArduinoCoreService_PlatformUpgradeClient) (*commands.Platform, error) { + var platform *commands.Platform + var upgradeError error + for { + msg, err := cl.Recv() + if err == io.EOF { + break + } + if msg.GetPlatform() != nil { + platform = msg.GetPlatform() + } + if err != nil { + upgradeError = err + break + } + } + return platform, upgradeError +} diff --git a/rpc/cc/arduino/cli/commands/v1/common.pb.go b/rpc/cc/arduino/cli/commands/v1/common.pb.go index 75ea4dc080d..6a8e19b88bf 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/common.pb.go @@ -89,6 +89,7 @@ type DownloadProgress struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Message: + // // *DownloadProgress_Start // *DownloadProgress_Update // *DownloadProgress_End @@ -522,6 +523,12 @@ type Platform struct { // A URL provided by the author of the platform's package, intended to point // to their online help service. Help *HelpResources `protobuf:"bytes,12,opt,name=help,proto3" json:"help,omitempty"` + // If true the platform is indexed + Indexed bool `protobuf:"varint,13,opt,name=indexed,proto3" json:"indexed,omitempty"` + // This field is true when the platform is installed with the Arduino IDE 1.8. + // If the platform is also not indexed it may fail to work correctly in some + // circumstances, and it may need to be re-installed. + MissingMetadata bool `protobuf:"varint,14,opt,name=missing_metadata,json=missingMetadata,proto3" json:"missing_metadata,omitempty"` } func (x *Platform) Reset() { @@ -640,6 +647,20 @@ func (x *Platform) GetHelp() *HelpResources { return nil } +func (x *Platform) GetIndexed() bool { + if x != nil { + return x.Indexed + } + return false +} + +func (x *Platform) GetMissingMetadata() bool { + if x != nil { + return x.MissingMetadata + } + return false +} + type InstalledPlatformReference struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -930,7 +951,7 @@ var file_cc_arduino_cli_commands_v1_common_proto_rawDesc = []byte{ 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x91, 0x03, 0x0a, 0x08, 0x50, 0x6c, 0x61, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xd6, 0x03, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, @@ -955,30 +976,34 @@ var file_cc_arduino_cli_commands_v1_common_proto_rawDesc = []byte{ 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x0c, 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, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x22, 0x88, 0x01, 0x0a, - 0x1a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x5f, 0x64, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, - 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 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, 0x22, 0x31, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 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, 0x66, 0x71, 0x62, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x27, 0x0a, 0x0d, 0x48, - 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, - 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x6e, - 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, - 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, - 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x18, 0x0a, 0x07, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x88, 0x01, 0x0a, 0x1a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 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, 0x22, 0x31, 0x0a, + 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 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, + 0x66, 0x71, 0x62, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, + 0x22, 0x27, 0x0a, 0x0d, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, + 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, + 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/rpc/cc/arduino/cli/commands/v1/common.proto b/rpc/cc/arduino/cli/commands/v1/common.proto index e9472f23557..3cb0425872f 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.proto +++ b/rpc/cc/arduino/cli/commands/v1/common.proto @@ -102,6 +102,12 @@ message Platform { // A URL provided by the author of the platform's package, intended to point // to their online help service. HelpResources help = 12; + // If true the platform is indexed + bool indexed = 13; + // This field is true when the platform is installed with the Arduino IDE 1.8. + // If the platform is also not indexed it may fail to work correctly in some + // circumstances, and it may need to be re-installed. + bool missing_metadata = 14; } message InstalledPlatformReference { diff --git a/rpc/cc/arduino/cli/commands/v1/core.pb.go b/rpc/cc/arduino/cli/commands/v1/core.pb.go index ebc1e61d09b..933f18aaa06 100644 --- a/rpc/cc/arduino/cli/commands/v1/core.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/core.pb.go @@ -586,6 +586,8 @@ type PlatformUpgradeResponse struct { Progress *DownloadProgress `protobuf:"bytes,1,opt,name=progress,proto3" json:"progress,omitempty"` // Description of the current stage of the upgrade. TaskProgress *TaskProgress `protobuf:"bytes,2,opt,name=task_progress,json=taskProgress,proto3" json:"task_progress,omitempty"` + // The upgraded platform. + Platform *Platform `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"` } func (x *PlatformUpgradeResponse) Reset() { @@ -634,6 +636,13 @@ func (x *PlatformUpgradeResponse) GetTaskProgress() *TaskProgress { return nil } +func (x *PlatformUpgradeResponse) GetPlatform() *Platform { + if x != nil { + return x.Platform + } + return nil +} + type PlatformSearchRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -957,7 +966,7 @@ var file_cc_arduino_cli_commands_v1_core_proto_rawDesc = []byte{ 0x28, 0x09, 0x52, 0x0c, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x69, 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, 0xb2, 0x01, 0x0a, + 0x70, 0x50, 0x6f, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x22, 0xf4, 0x01, 0x0a, 0x17, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x63, 0x2e, @@ -969,44 +978,48 @@ var file_cc_arduino_cli_commands_v1_core_proto_rawDesc = []byte{ 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, - 0x73, 0x22, 0x9d, 0x01, 0x0a, 0x15, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x08, 0x69, - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 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, 0x63, 0x0a, 0x16, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0d, 0x73, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x73, 0x12, 0x40, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x22, 0x9d, 0x01, 0x0a, 0x15, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, + 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 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, 0x63, 0x0a, 0x16, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, + 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x50, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x40, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, - 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 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, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x22, 0x6d, 0x0a, 0x14, 0x50, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, + 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, - 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 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, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x22, 0x6d, 0x0a, 0x14, 0x50, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x55, 0x0a, 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, - 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, - 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, + 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, + 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, + 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1053,15 +1066,16 @@ var file_cc_arduino_cli_commands_v1_core_proto_depIdxs = []int32{ 14, // 7: cc.arduino.cli.commands.v1.PlatformUpgradeRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance 15, // 8: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress 16, // 9: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 14, // 10: cc.arduino.cli.commands.v1.PlatformSearchRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 17, // 11: cc.arduino.cli.commands.v1.PlatformSearchResponse.search_output:type_name -> cc.arduino.cli.commands.v1.Platform - 14, // 12: cc.arduino.cli.commands.v1.PlatformListRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 17, // 13: cc.arduino.cli.commands.v1.PlatformListResponse.installed_platforms:type_name -> cc.arduino.cli.commands.v1.Platform - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 17, // 10: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.platform:type_name -> cc.arduino.cli.commands.v1.Platform + 14, // 11: cc.arduino.cli.commands.v1.PlatformSearchRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 17, // 12: cc.arduino.cli.commands.v1.PlatformSearchResponse.search_output:type_name -> cc.arduino.cli.commands.v1.Platform + 14, // 13: cc.arduino.cli.commands.v1.PlatformListRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 17, // 14: cc.arduino.cli.commands.v1.PlatformListResponse.installed_platforms:type_name -> cc.arduino.cli.commands.v1.Platform + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_cc_arduino_cli_commands_v1_core_proto_init() } diff --git a/rpc/cc/arduino/cli/commands/v1/core.proto b/rpc/cc/arduino/cli/commands/v1/core.proto index f6187ed669a..d52251f470a 100644 --- a/rpc/cc/arduino/cli/commands/v1/core.proto +++ b/rpc/cc/arduino/cli/commands/v1/core.proto @@ -97,6 +97,8 @@ message PlatformUpgradeResponse { DownloadProgress progress = 1; // Description of the current stage of the upgrade. TaskProgress task_progress = 2; + // The upgraded platform. + Platform platform = 3; } message PlatformSearchRequest {