diff --git a/arduino/errors.go b/arduino/errors.go index fd126d414b4..823c2ed99bf 100644 --- a/arduino/errors.go +++ b/arduino/errors.go @@ -21,6 +21,7 @@ import ( "github.com/arduino/arduino-cli/i18n" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" + "github.com/arduino/go-paths-helper" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -810,3 +811,26 @@ func (e *MultiplePlatformsError) Error() string { func (e *MultiplePlatformsError) ToRPCStatus() *status.Status { return status.New(codes.InvalidArgument, e.Error()) } + +// MultipleLibraryInstallDetected is returned when the user request an +// operation on a library but multiple libraries with the same name +// (in library.properties) are detected. +type MultipleLibraryInstallDetected struct { + LibName string + LibsDir paths.PathList + Message string +} + +func (e *MultipleLibraryInstallDetected) Error() string { + res := tr("The library %s has multiple installations:", e.LibName) + "\n" + for _, lib := range e.LibsDir { + res += fmt.Sprintf("- %s\n", lib) + } + res += e.Message + return res +} + +// ToRPCStatus converts the error into a *status.Status +func (e *MultipleLibraryInstallDetected) ToRPCStatus() *status.Status { + return status.New(codes.InvalidArgument, e.Error()) +} diff --git a/arduino/libraries/libraries.go b/arduino/libraries/libraries.go index 52f17b992ea..ab0d2a380f7 100644 --- a/arduino/libraries/libraries.go +++ b/arduino/libraries/libraries.go @@ -63,12 +63,12 @@ type Library struct { Types []string `json:"types,omitempty"` InstallDir *paths.Path + CanonicalName string SourceDir *paths.Path UtilityDir *paths.Path Location LibraryLocation ContainerPlatform *cores.PlatformRelease `json:""` Layout LibraryLayout - RealName string DotALinkage bool Precompiled bool PrecompiledWithSources bool @@ -132,7 +132,7 @@ func (library *Library) ToRPCLibrary() (*rpc.Library, error) { Location: library.Location.ToRPCLibraryLocation(), ContainerPlatform: platformOrEmpty(library.ContainerPlatform), Layout: library.Layout.ToRPCLibraryLayout(), - RealName: library.RealName, + RealName: library.Name, DotALinkage: library.DotALinkage, Precompiled: library.Precompiled, LdFlags: library.LDflags, diff --git a/arduino/libraries/librariesindex/index.go b/arduino/libraries/librariesindex/index.go index 6a12af30232..01c5c20d10b 100644 --- a/arduino/libraries/librariesindex/index.go +++ b/arduino/libraries/librariesindex/index.go @@ -125,7 +125,7 @@ func (idx *Index) FindRelease(ref *Reference) *Release { // FindIndexedLibrary search an indexed library that matches the provided // installed library or nil if not found func (idx *Index) FindIndexedLibrary(lib *libraries.Library) *Library { - return idx.Libraries[lib.RealName] + return idx.Libraries[lib.Name] } // FindLibraryUpdate check if an installed library may be updated using diff --git a/arduino/libraries/librariesindex/index_test.go b/arduino/libraries/librariesindex/index_test.go index 5cebd219eae..59b245b4978 100644 --- a/arduino/libraries/librariesindex/index_test.go +++ b/arduino/libraries/librariesindex/index_test.go @@ -72,22 +72,22 @@ func TestIndexer(t *testing.T) { }) require.Nil(t, rtcInexistent) - rtc := index.FindIndexedLibrary(&libraries.Library{RealName: "RTCZero"}) + rtc := index.FindIndexedLibrary(&libraries.Library{Name: "RTCZero"}) require.NotNil(t, rtc) require.Equal(t, "RTCZero", rtc.Name) - rtcUpdate := index.FindLibraryUpdate(&libraries.Library{RealName: "RTCZero", Version: semver.MustParse("1.0.0")}) + rtcUpdate := index.FindLibraryUpdate(&libraries.Library{Name: "RTCZero", Version: semver.MustParse("1.0.0")}) require.NotNil(t, rtcUpdate) require.Equal(t, "RTCZero@1.6.0", rtcUpdate.String()) - rtcUpdateNoVersion := index.FindLibraryUpdate(&libraries.Library{RealName: "RTCZero", Version: nil}) + rtcUpdateNoVersion := index.FindLibraryUpdate(&libraries.Library{Name: "RTCZero", Version: nil}) require.NotNil(t, rtcUpdateNoVersion) require.Equal(t, "RTCZero@1.6.0", rtcUpdateNoVersion.String()) - rtcNoUpdate := index.FindLibraryUpdate(&libraries.Library{RealName: "RTCZero", Version: semver.MustParse("3.0.0")}) + rtcNoUpdate := index.FindLibraryUpdate(&libraries.Library{Name: "RTCZero", Version: semver.MustParse("3.0.0")}) require.Nil(t, rtcNoUpdate) - rtcInexistent2 := index.FindLibraryUpdate(&libraries.Library{RealName: "RTCZero-blah", Version: semver.MustParse("1.0.0")}) + rtcInexistent2 := index.FindLibraryUpdate(&libraries.Library{Name: "RTCZero-blah", Version: semver.MustParse("1.0.0")}) require.Nil(t, rtcInexistent2) resolve1 := index.ResolveDependencies(alp.Releases["1.2.1"]) diff --git a/arduino/libraries/librarieslist.go b/arduino/libraries/librarieslist.go index f1644b84a29..9008bf2229b 100644 --- a/arduino/libraries/librarieslist.go +++ b/arduino/libraries/librarieslist.go @@ -17,6 +17,8 @@ package libraries import ( "sort" + + semver "go.bug.st/relaxed-semver" ) // List is a list of Libraries @@ -39,6 +41,16 @@ func (list *List) Add(libs ...*Library) { } } +// Remove removes the library from the list +func (list *List) Remove(library *Library) { + for i, lib := range *list { + if lib == library { + *list = append((*list)[:i], (*list)[i+1:]...) + return + } + } +} + // FindByName returns the first library in the list that match // the specified name or nil if not found func (list *List) FindByName(name string) *Library { @@ -50,6 +62,22 @@ func (list *List) FindByName(name string) *Library { return nil } +// FilterByVersionAndInstallLocation returns the libraries matching the provided version and install location. If version +// is nil all version are matched. +func (list *List) FilterByVersionAndInstallLocation(version *semver.Version, installLocation LibraryLocation) List { + var found List + for _, lib := range *list { + if lib.Location != installLocation { + continue + } + if version != nil && !lib.Version.Equal(version) { + continue + } + found.Add(lib) + } + return found +} + // SortByName sorts the libraries by name func (list *List) SortByName() { sort.Slice(*list, func(i, j int) bool { diff --git a/arduino/libraries/librariesmanager/install.go b/arduino/libraries/librariesmanager/install.go index 8363e000362..5baa17e3d94 100644 --- a/arduino/libraries/librariesmanager/install.go +++ b/arduino/libraries/librariesmanager/install.go @@ -22,6 +22,7 @@ import ( "os" "strings" + "github.com/arduino/arduino-cli/arduino" "github.com/arduino/arduino-cli/arduino/globals" "github.com/arduino/arduino-cli/arduino/libraries" "github.com/arduino/arduino-cli/arduino/libraries/librariesindex" @@ -49,32 +50,42 @@ var ( // install path, where the library should be installed and the possible library that is already // installed on the same folder and it's going to be replaced by the new one. func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release, installLocation libraries.LibraryLocation) (*paths.Path, *libraries.Library, error) { - saneName := utils.SanitizeName(indexLibrary.Library.Name) + installDir := lm.getLibrariesDir(installLocation) + if installDir == nil { + if installLocation == libraries.User { + return nil, nil, fmt.Errorf(tr("User directory not set")) + } + return nil, nil, fmt.Errorf(tr("Builtin libraries directory not set")) + } - var replaced *libraries.Library - if installedLibs, have := lm.Libraries[saneName]; have { - for _, installedLib := range installedLibs.Alternatives { - if installedLib.Location != installLocation { - continue - } - if installedLib.Version != nil && installedLib.Version.Equal(indexLibrary.Version) { - return installedLib.InstallDir, nil, ErrAlreadyInstalled - } - replaced = installedLib + name := indexLibrary.Library.Name + libs := lm.FindByReference(&librariesindex.Reference{Name: name}, installLocation) + for _, lib := range libs { + if lib.Version != nil && lib.Version.Equal(indexLibrary.Version) { + return lib.InstallDir, nil, ErrAlreadyInstalled } } - libsDir := lm.getLibrariesDir(installLocation) - if libsDir == nil { - if installLocation == libraries.User { - return nil, nil, fmt.Errorf(tr("User directory not set")) + if len(libs) > 1 { + libsDir := paths.NewPathList() + for _, lib := range libs { + libsDir.Add(lib.InstallDir) + } + return nil, nil, &arduino.MultipleLibraryInstallDetected{ + LibName: name, + LibsDir: libsDir, + Message: tr("Automatic library install can't be performed in this case, please manually remove all duplicates and retry."), } - return nil, nil, fmt.Errorf(tr("Builtin libraries directory not set")) } - libPath := libsDir.Join(saneName) - if replaced != nil && replaced.InstallDir.EquivalentTo(libPath) { + var replaced *libraries.Library + if len(libs) == 1 { + replaced = libs[0] + } + libPath := installDir.Join(utils.SanitizeName(indexLibrary.Library.Name)) + if replaced != nil && replaced.InstallDir.EquivalentTo(libPath) { + return libPath, replaced, nil } else if libPath.IsDir() { return nil, nil, fmt.Errorf(tr("destination dir %s already exists, cannot install"), libPath) } @@ -82,12 +93,8 @@ func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesinde } // Install installs a library on the specified path. -func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path, installLocation libraries.LibraryLocation) error { - libsDir := lm.getLibrariesDir(installLocation) - if libsDir == nil { - return fmt.Errorf(tr("User directory not set")) - } - return indexLibrary.Resource.Install(lm.DownloadsDir, libsDir, libPath) +func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path) error { + return indexLibrary.Resource.Install(lm.DownloadsDir, libPath.Parent(), libPath) } // Uninstall removes a Library @@ -99,7 +106,9 @@ func (lm *LibrariesManager) Uninstall(lib *libraries.Library) error { return fmt.Errorf(tr("removing lib directory: %s"), err) } - lm.Libraries[lib.Name].Remove(lib) + alternatives := lm.Libraries[lib.Name] + alternatives.Remove(lib) + lm.Libraries[lib.Name] = alternatives return nil } @@ -189,8 +198,8 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin // InstallGitLib installs a library hosted on a git repository on the specified path. func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error { - libsDir := lm.getLibrariesDir(libraries.User) - if libsDir == nil { + installDir := lm.getLibrariesDir(libraries.User) + if installDir == nil { return fmt.Errorf(tr("User directory not set")) } @@ -202,10 +211,9 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error { return err } - installPath := libsDir.Join(libraryName) - // Deletes libraries folder if already installed - if _, ok := lm.Libraries[libraryName]; ok { + installPath := installDir.Join(libraryName) + if installPath.IsDir() { if !overwrite { return fmt.Errorf(tr("library %s already installed"), libraryName) } @@ -215,6 +223,9 @@ func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error { Trace("Deleting library") installPath.RemoveAll() } + if installPath.Exist() { + return fmt.Errorf(tr("could not create directory %s: a file with the same name exists!", installPath)) + } logrus. WithField("library name", libraryName). diff --git a/arduino/libraries/librariesmanager/librariesmanager.go b/arduino/libraries/librariesmanager/librariesmanager.go index fdb98fe3473..9291db64117 100644 --- a/arduino/libraries/librariesmanager/librariesmanager.go +++ b/arduino/libraries/librariesmanager/librariesmanager.go @@ -22,12 +22,10 @@ import ( "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/libraries" "github.com/arduino/arduino-cli/arduino/libraries/librariesindex" - "github.com/arduino/arduino-cli/arduino/utils" "github.com/arduino/arduino-cli/i18n" paths "github.com/arduino/go-paths-helper" "github.com/pmylund/sortutil" "github.com/sirupsen/logrus" - semver "go.bug.st/relaxed-semver" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -36,7 +34,7 @@ import ( // (the list of libraries, revisions, installed paths, etc.) type LibrariesManager struct { LibrariesDir []*LibrariesDir - Libraries map[string]*LibraryAlternatives `json:"libraries"` + Libraries map[string]libraries.List `json:"libraries"` Index *librariesindex.Index IndexFile *paths.Path @@ -51,42 +49,8 @@ type LibrariesDir struct { PlatformRelease *cores.PlatformRelease } -// LibraryAlternatives is a list of different versions of the same library -// installed in the system -type LibraryAlternatives struct { - Alternatives libraries.List -} - var tr = i18n.Tr -// Add adds a library to the alternatives -func (alts *LibraryAlternatives) Add(library *libraries.Library) { - if len(alts.Alternatives) > 0 && alts.Alternatives[0].Name != library.Name { - panic(fmt.Sprintf("the library name is different from the set (%[1]s != %[2]s)", alts.Alternatives[0].Name, library.Name)) - } - alts.Alternatives = append(alts.Alternatives, library) -} - -// Remove removes the library from the alternatives -func (alts *LibraryAlternatives) Remove(library *libraries.Library) { - for i, lib := range alts.Alternatives { - if lib == library { - alts.Alternatives = append(alts.Alternatives[:i], alts.Alternatives[i+1:]...) - return - } - } -} - -// FindVersion returns the library mathching the provided version or nil if not found -func (alts *LibraryAlternatives) FindVersion(version *semver.Version, installLocation libraries.LibraryLocation) *libraries.Library { - for _, lib := range alts.Alternatives { - if lib.Version.Equal(version) && lib.Location == installLocation { - return lib - } - } - return nil -} - // Names returns an array with all the names of the installed libraries. func (lm LibrariesManager) Names() []string { res := make([]string, len(lm.Libraries)) @@ -107,7 +71,7 @@ func NewLibraryManager(indexDir *paths.Path, downloadsDir *paths.Path) *Librarie indexFileSignature = indexDir.Join("library_index.json.sig") } return &LibrariesManager{ - Libraries: map[string]*LibraryAlternatives{}, + Libraries: map[string]libraries.List{}, IndexFile: indexFile, IndexFileSignature: indexFileSignature, DownloadsDir: downloadsDir, @@ -208,12 +172,9 @@ func (lm *LibrariesManager) LoadLibrariesFromDir(librariesDir *LibrariesDir) []* continue } library.ContainerPlatform = librariesDir.PlatformRelease - alternatives, ok := lm.Libraries[library.Name] - if !ok { - alternatives = &LibraryAlternatives{} - lm.Libraries[library.Name] = alternatives - } + alternatives := lm.Libraries[library.Name] alternatives.Add(library) + lm.Libraries[library.Name] = alternatives } return statuses @@ -232,33 +193,19 @@ func (lm *LibrariesManager) LoadLibraryFromDir(libRootDir *paths.Path, location return fmt.Errorf(tr("loading library from %[1]s: %[2]s"), libRootDir, err) } - alternatives, ok := lm.Libraries[library.Name] - if !ok { - alternatives = &LibraryAlternatives{} - lm.Libraries[library.Name] = alternatives - } + alternatives := lm.Libraries[library.Name] alternatives.Add(library) - + lm.Libraries[library.Name] = alternatives return nil } -// FindByReference return the installed library matching the Reference -// name and version or, if the version is nil, the library installed -// in the User folder. -func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference, installLocation libraries.LibraryLocation) *libraries.Library { - saneName := utils.SanitizeName(libRef.Name) - alternatives, have := lm.Libraries[saneName] - if !have { - return nil - } - // TODO: Move "search into user" into another method... - if libRef.Version == nil { - for _, candidate := range alternatives.Alternatives { - if candidate.Location == installLocation { - return candidate - } - } +// FindByReference return the installed libraries matching the Reference +// name and version or, if the version is nil, the libraries installed +// in the installLocation. +func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference, installLocation libraries.LibraryLocation) libraries.List { + alternatives := lm.Libraries[libRef.Name] + if alternatives == nil { return nil } - return alternatives.FindVersion(libRef.Version, installLocation) + return alternatives.FilterByVersionAndInstallLocation(libRef.Version, installLocation) } diff --git a/arduino/libraries/librariesresolver/cpp.go b/arduino/libraries/librariesresolver/cpp.go index 05335d7da16..0078fdcca78 100644 --- a/arduino/libraries/librariesresolver/cpp.go +++ b/arduino/libraries/librariesresolver/cpp.go @@ -47,7 +47,7 @@ func NewCppResolver() *Cpp { // and cache all C++ headers for later retrieval func (resolver *Cpp) ScanFromLibrariesManager(lm *librariesmanager.LibrariesManager) error { for _, libAlternatives := range lm.Libraries { - for _, lib := range libAlternatives.Alternatives { + for _, lib := range libAlternatives { resolver.ScanLibrary(lib) } } @@ -58,7 +58,7 @@ func (resolver *Cpp) ScanFromLibrariesManager(lm *librariesmanager.LibrariesMana // and cache all C++ headers for later retrieval. func (resolver *Cpp) ScanIDEBuiltinLibraries(lm *librariesmanager.LibrariesManager) error { for _, libAlternatives := range lm.Libraries { - for _, lib := range libAlternatives.Alternatives { + for _, lib := range libAlternatives { if lib.Location == libraries.IDEBuiltIn { resolver.ScanLibrary(lib) } @@ -71,7 +71,7 @@ func (resolver *Cpp) ScanIDEBuiltinLibraries(lm *librariesmanager.LibrariesManag // and cache all C++ headers for later retrieval. func (resolver *Cpp) ScanUserAndUnmanagedLibraries(lm *librariesmanager.LibrariesManager) error { for _, libAlternatives := range lm.Libraries { - for _, lib := range libAlternatives.Alternatives { + for _, lib := range libAlternatives { if lib.Location == libraries.User || lib.Location == libraries.Unmanaged { resolver.ScanLibrary(lib) } @@ -84,7 +84,7 @@ func (resolver *Cpp) ScanUserAndUnmanagedLibraries(lm *librariesmanager.Librarie // to find and cache all C++ headers for later retrieval. func (resolver *Cpp) ScanPlatformLibraries(lm *librariesmanager.LibrariesManager, platform *cores.PlatformRelease) error { for _, libAlternatives := range lm.Libraries { - for _, lib := range libAlternatives.Alternatives { + for _, lib := range libAlternatives { if lib.Location != libraries.PlatformBuiltIn && lib.Location != libraries.ReferencedPlatformBuiltIn { continue } @@ -168,7 +168,7 @@ func computePriority(lib *libraries.Library, header, arch string) int { header = strings.TrimSuffix(header, filepath.Ext(header)) header = simplify(header) name := simplify(lib.Name) - realName := simplify(lib.RealName) + canonicalName := simplify(lib.CanonicalName) priority := 0 @@ -185,17 +185,17 @@ func computePriority(lib *libraries.Library, header, arch string) int { priority += 0 } - if realName == header && name == header { + if name == header && canonicalName == header { priority += 600 - } else if realName == header || name == header { + } else if name == header || canonicalName == header { priority += 500 - } else if realName == header+"-master" || name == header+"-master" { + } else if name == header+"-master" || canonicalName == header+"-master" { priority += 400 - } else if strings.HasPrefix(realName, header) || strings.HasPrefix(name, header) { + } else if strings.HasPrefix(name, header) || strings.HasPrefix(canonicalName, header) { priority += 300 - } else if strings.HasSuffix(realName, header) || strings.HasSuffix(name, header) { + } else if strings.HasSuffix(name, header) || strings.HasSuffix(canonicalName, header) { priority += 200 - } else if strings.Contains(realName, header) || strings.Contains(name, header) { + } else if strings.Contains(name, header) || strings.Contains(canonicalName, header) { priority += 100 } diff --git a/arduino/libraries/librariesresolver/cpp_test.go b/arduino/libraries/librariesresolver/cpp_test.go index b9acb54b503..6f8b195be61 100644 --- a/arduino/libraries/librariesresolver/cpp_test.go +++ b/arduino/libraries/librariesresolver/cpp_test.go @@ -147,14 +147,14 @@ func TestCppHeaderResolver(t *testing.T) { func TestCppHeaderResolverWithLibrariesInStrangeDirectoryNames(t *testing.T) { resolver := NewCppResolver() librarylist := libraries.List{} - librarylist.Add(&libraries.Library{Name: "onewire_2_3_4", RealName: "OneWire", Architectures: []string{"*"}}) - librarylist.Add(&libraries.Library{Name: "onewireng_2_3_4", RealName: "OneWireNg", Architectures: []string{"avr"}}) + librarylist.Add(&libraries.Library{CanonicalName: "onewire_2_3_4", Name: "OneWire", Architectures: []string{"*"}}) + librarylist.Add(&libraries.Library{CanonicalName: "onewireng_2_3_4", Name: "OneWireNg", Architectures: []string{"avr"}}) resolver.headers["OneWire.h"] = librarylist - require.Equal(t, "onewire_2_3_4", resolver.ResolveFor("OneWire.h", "avr").Name) + require.Equal(t, "onewire_2_3_4", resolver.ResolveFor("OneWire.h", "avr").CanonicalName) librarylist2 := libraries.List{} - librarylist2.Add(&libraries.Library{Name: "OneWire", RealName: "OneWire", Architectures: []string{"*"}}) - librarylist2.Add(&libraries.Library{Name: "onewire_2_3_4", RealName: "OneWire", Architectures: []string{"avr"}}) + librarylist2.Add(&libraries.Library{CanonicalName: "OneWire", Name: "OneWire", Architectures: []string{"*"}}) + librarylist2.Add(&libraries.Library{CanonicalName: "onewire_2_3_4", Name: "OneWire", Architectures: []string{"avr"}}) resolver.headers["OneWire.h"] = librarylist2 - require.Equal(t, "OneWire", resolver.ResolveFor("OneWire.h", "avr").Name) + require.Equal(t, "OneWire", resolver.ResolveFor("OneWire.h", "avr").CanonicalName) } diff --git a/arduino/libraries/loader.go b/arduino/libraries/loader.go index 5a26efc9dab..f6cd0b679bb 100644 --- a/arduino/libraries/loader.go +++ b/arduino/libraries/loader.go @@ -108,8 +108,8 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library, if err := addExamples(library); err != nil { return nil, errors.Errorf(tr("scanning examples: %s"), err) } - library.Name = libraryDir.Base() - library.RealName = strings.TrimSpace(libProperties.Get("name")) + library.CanonicalName = libraryDir.Base() + library.Name = strings.TrimSpace(libProperties.Get("name")) library.Author = strings.TrimSpace(libProperties.Get("author")) library.Maintainer = strings.TrimSpace(libProperties.Get("maintainer")) library.Sentence = strings.TrimSpace(libProperties.Get("sentence")) @@ -132,6 +132,7 @@ func makeLegacyLibrary(path *paths.Path, location LibraryLocation) (*Library, er SourceDir: path, Layout: FlatLayout, Name: path.Base(), + CanonicalName: path.Base(), Architectures: []string{"*"}, IsLegacy: true, Version: semver.MustParse(""), diff --git a/commands/lib/install.go b/commands/lib/install.go index ca5eabb6257..0a82c9d074d 100644 --- a/commands/lib/install.go +++ b/commands/lib/install.go @@ -141,10 +141,14 @@ func installLibrary(lm *librariesmanager.LibrariesManager, libRelease *libraries taskCB(&rpc.TaskProgress{Message: tr("Replacing %[1]s with %[2]s", libReplaced, libRelease)}) } - if err := lm.Install(libRelease, libPath, installLocation); err != nil { + if err := lm.Install(libRelease, libPath); err != nil { return &arduino.FailedLibraryInstallError{Cause: err} } - + if libReplaced != nil && !libReplaced.InstallDir.EquivalentTo(libPath) { + if err := lm.Uninstall(libReplaced); err != nil { + return fmt.Errorf("%s: %s", tr("could not remove old library"), err) + } + } taskCB(&rpc.TaskProgress{Message: tr("Installed %s", libRelease), Completed: true}) return nil } diff --git a/commands/lib/list.go b/commands/lib/list.go index e22a4c191d9..bb529755871 100644 --- a/commands/lib/list.go +++ b/commands/lib/list.go @@ -48,8 +48,7 @@ func LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.Library nameFilter := strings.ToLower(req.GetName()) - installedLibs := []*rpc.InstalledLibrary{} - res := listLibraries(lm, req.GetUpdatable(), req.GetAll()) + allLibs := listLibraries(lm, req.GetUpdatable(), req.GetAll()) if f := req.GetFqbn(); f != "" { fqbn, err := cores.ParseFQBN(req.GetFqbn()) if err != nil { @@ -61,7 +60,7 @@ func LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.Library } filteredRes := map[string]*installedLib{} - for _, lib := range res { + for _, lib := range allLibs { if cp := lib.Library.ContainerPlatform; cp != nil { if cp != boardPlatform && cp != refBoardPlatform { // Filter all libraries from extraneous platforms @@ -70,6 +69,7 @@ func LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.Library } if latest, has := filteredRes[lib.Library.Name]; has { if latest.Library.LocationPriorityFor(boardPlatform, refBoardPlatform) >= lib.Library.LocationPriorityFor(boardPlatform, refBoardPlatform) { + // Pick library with the best priority continue } } @@ -89,13 +89,14 @@ func LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.Library filteredRes[lib.Library.Name] = lib } - res = []*installedLib{} + allLibs = []*installedLib{} for _, lib := range filteredRes { - res = append(res, lib) + allLibs = append(allLibs, lib) } } - for _, lib := range res { + installedLibs := []*rpc.InstalledLibrary{} + for _, lib := range allLibs { if nameFilter != "" && strings.ToLower(lib.Library.Name) != nameFilter { continue } @@ -121,7 +122,7 @@ func LibraryList(ctx context.Context, req *rpc.LibraryListRequest) (*rpc.Library func listLibraries(lm *librariesmanager.LibrariesManager, updatable bool, all bool) []*installedLib { res := []*installedLib{} for _, libAlternatives := range lm.Libraries { - for _, lib := range libAlternatives.Alternatives { + for _, lib := range libAlternatives { if !all { if lib.Location != libraries.User { continue diff --git a/commands/lib/uninstall.go b/commands/lib/uninstall.go index f265940b47c..61cd18a1362 100644 --- a/commands/lib/uninstall.go +++ b/commands/lib/uninstall.go @@ -22,6 +22,7 @@ import ( "github.com/arduino/arduino-cli/arduino/libraries" "github.com/arduino/arduino-cli/commands" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" + "github.com/arduino/go-paths-helper" ) // LibraryUninstall FIXMEDOC @@ -32,15 +33,27 @@ func LibraryUninstall(ctx context.Context, req *rpc.LibraryUninstallRequest, tas return &arduino.InvalidLibraryError{Cause: err} } - lib := lm.FindByReference(ref, libraries.User) + libs := lm.FindByReference(ref, libraries.User) - if lib == nil { + if len(libs) == 0 { taskCB(&rpc.TaskProgress{Message: tr("Library %s is not installed", req.Name), Completed: true}) - } else { - taskCB(&rpc.TaskProgress{Name: tr("Uninstalling %s", lib)}) - lm.Uninstall(lib) + return nil + } + + if len(libs) == 1 { + taskCB(&rpc.TaskProgress{Name: tr("Uninstalling %s", libs)}) + lm.Uninstall(libs[0]) taskCB(&rpc.TaskProgress{Completed: true}) + return nil } - return nil + libsDir := paths.NewPathList() + for _, lib := range libs { + libsDir.Add(lib.InstallDir) + } + return &arduino.MultipleLibraryInstallDetected{ + LibName: libs[0].Name, + LibsDir: libsDir, + Message: tr("Automatic library uninstall can't be performed in this case, please manually remove them."), + } } diff --git a/commands/lib/upgrade.go b/commands/lib/upgrade.go index 6a8b810e2a1..a156553ee6a 100644 --- a/commands/lib/upgrade.go +++ b/commands/lib/upgrade.go @@ -86,7 +86,7 @@ func upgrade(lm *librariesmanager.LibrariesManager, libs []*installedLib, downlo func filterByName(libs []*installedLib, name string) *installedLib { for _, lib := range libs { - if lib.Library.RealName == name { + if lib.Library.Name == name { return lib } } diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 775cbc8f684..0cd1eb0d272 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -4,6 +4,58 @@ Here you can find a list of migration guides to handle breaking changes between ## 0.28.0 +### Breaking changes in libraries name handling + +In the structure `github.com/arduino/arduino-cli/arduino/libraries.Library` the field: + +- `RealName` has been renamed to `Name` +- `Name` has been renamed to `CanonicalName` + +Now `Name` is the name of the library as it appears in the `library.properties` file and `CanonicalName` it's the name +of the directory containing the library. The `CanonicalName` is usually the name of the library with non-alphanumeric +characters converted to underscore, but it could be actually anything since the directory where the library is installed +can be freely renamed. + +This change improves the overall code base naming coherence since all the structures involving libraries have the `Name` +field that refers to the library name as it appears in the `library.properties` file. + +### `github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibrariesManager.Install` removed parameter `installLocation` + +The method: + +```go +func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path, installLocation libraries.LibraryLocation) error { ... } +``` + +no more needs the `installLocation` parameter: + +```go +func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path) error { ... } +``` + +The install location is determined from the libPath. + +### `github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibrariesManager.FindByReference` now returns a list of libraries. + +The method: + +```go +func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference, installLocation libraries.LibraryLocation) *libraries.Library { ... } +``` + +has been changed to: + +```go +func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference, installLocation libraries.LibraryLocation) libraries.List { ... } +``` + +the method now returns all the libraries matching the criteria and not just the first one. + +### `github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.LibraryAlternatives` removed + +The structure `librariesmanager.LibraryAlternatives` has been removed. The `libraries.List` object can be used as a +replacement. + ### Breaking changes in UpdateIndex API (both gRPC and go-lang) The gRPC message `cc.arduino.cli.commands.v1.UpdateIndexResponse` has been changed from: diff --git a/internal/integrationtest/lib/lib_test.go b/internal/integrationtest/lib/lib_test.go index 08afa128841..661e3d8b5eb 100644 --- a/internal/integrationtest/lib/lib_test.go +++ b/internal/integrationtest/lib/lib_test.go @@ -64,3 +64,75 @@ func TestLibUpgradeCommand(t *testing.T) { require.NoError(t, err) requirejson.Query(t, stdOut, `.[].library | select(.name=="Servo") | .version`, servoVersion) } + +func TestLibCommandsUsingNameInsteadOfCanonicalName(t *testing.T) { + env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) + defer env.CleanUp() + + _, _, err := cli.Run("lib", "install", "Robot Motor") + require.NoError(t, err) + + jsonOut, _, err := cli.Run("lib", "examples", "Robot Motor", "--format", "json") + require.NoError(t, err) + requirejson.Len(t, jsonOut, 1, "Library 'Robot Motor' not matched in lib examples command.") + + jsonOut, _, err = cli.Run("lib", "list", "Robot Motor", "--format", "json") + require.NoError(t, err) + requirejson.Len(t, jsonOut, 1, "Library 'Robot Motor' not matched in lib list command.") +} + +func TestLibInstallMultipleSameLibrary(t *testing.T) { + env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) + defer env.CleanUp() + cliEnv := cli.GetDefaultEnv() + cliEnv["ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL"] = "true" + + // Check that 'lib install' didn't create a double install + // https://github.com/arduino/arduino-cli/issues/1870 + _, _, err := cli.RunWithCustomEnv(cliEnv, "lib", "install", "--git-url", "https://github.com/arduino-libraries/SigFox#1.0.3") + require.NoError(t, err) + _, _, err = cli.Run("lib", "install", "Arduino SigFox for MKRFox1200") + require.NoError(t, err) + jsonOut, _, err := cli.Run("lib", "list", "--format", "json") + require.NoError(t, err) + requirejson.Len(t, jsonOut, 1, "A duplicate library install has been detected") + + // Check that 'lib upgrade' didn't create a double install + // https://github.com/arduino/arduino-cli/issues/1870 + _, _, err = cli.Run("lib", "uninstall", "Arduino SigFox for MKRFox1200") + require.NoError(t, err) + _, _, err = cli.RunWithCustomEnv(cliEnv, "lib", "install", "--git-url", "https://github.com/arduino-libraries/SigFox#1.0.3") + require.NoError(t, err) + _, _, err = cli.Run("lib", "upgrade", "Arduino SigFox for MKRFox1200") + require.NoError(t, err) + jsonOut, _, err = cli.Run("lib", "list", "--format", "json") + require.NoError(t, err) + requirejson.Len(t, jsonOut, 1, "A duplicate library install has been detected") +} + +func TestDuplicateLibInstallDetection(t *testing.T) { + env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t) + defer env.CleanUp() + cliEnv := cli.GetDefaultEnv() + cliEnv["ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL"] = "true" + + // Make a double install in the sketchbook/user directory + _, _, err := cli.Run("lib", "install", "ArduinoOTA@1.0.0") + require.NoError(t, err) + otaLibPath := cli.SketchbookDir().Join("libraries", "ArduinoOTA") + err = otaLibPath.CopyDirTo(otaLibPath.Parent().Join("CopyOfArduinoOTA")) + require.NoError(t, err) + jsonOut, _, err := cli.Run("lib", "list", "--format", "json") + require.NoError(t, err) + requirejson.Len(t, jsonOut, 2, "Duplicate library install is not detected by the CLI") + + _, stdErr, err := cli.Run("lib", "install", "ArduinoOTA") + require.Error(t, err) + require.Contains(t, string(stdErr), "The library ArduinoOTA has multiple installations") + _, stdErr, err = cli.Run("lib", "upgrade", "ArduinoOTA") + require.Error(t, err) + require.Contains(t, string(stdErr), "The library ArduinoOTA has multiple installations") + _, stdErr, err = cli.Run("lib", "uninstall", "ArduinoOTA") + require.Error(t, err) + require.Contains(t, string(stdErr), "The library ArduinoOTA has multiple installations") +} diff --git a/legacy/builder/create_cmake_rule.go b/legacy/builder/create_cmake_rule.go index 7e689c6f943..0bb5d9e691c 100644 --- a/legacy/builder/create_cmake_rule.go +++ b/legacy/builder/create_cmake_rule.go @@ -73,7 +73,7 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error { dynamicLibsFromPkgConfig := map[string]bool{} for _, library := range ctx.ImportedLibraries { // Copy used libraries in the correct folder - libDir := libBaseFolder.Join(library.Name) + libDir := libBaseFolder.Join(library.CanonicalName) mcu := ctx.BuildProperties.Get(constants.BUILD_PROPERTIES_BUILD_MCU) utils.CopyDir(library.InstallDir.String(), libDir.String(), validExportExtensions) diff --git a/legacy/builder/phases/libraries_builder.go b/legacy/builder/phases/libraries_builder.go index 2a01ff60f3b..ae1a09db11a 100644 --- a/legacy/builder/phases/libraries_builder.go +++ b/legacy/builder/phases/libraries_builder.go @@ -131,7 +131,7 @@ func compileLibrary(ctx *types.Context, library *libraries.Library, buildPath *p if ctx.Verbose { ctx.Info(tr(`Compiling library "%[1]s"`, library.Name)) } - libraryBuildPath := buildPath.Join(library.Name) + libraryBuildPath := buildPath.Join(library.CanonicalName) if err := libraryBuildPath.MkdirAll(); err != nil { return nil, errors.WithStack(err) @@ -189,7 +189,7 @@ func compileLibrary(ctx *types.Context, library *libraries.Library, buildPath *p return nil, errors.WithStack(err) } if library.DotALinkage { - archiveFile, err := builder_utils.ArchiveCompiledFiles(ctx, libraryBuildPath, paths.New(library.Name+".a"), libObjectFiles, buildProperties) + archiveFile, err := builder_utils.ArchiveCompiledFiles(ctx, libraryBuildPath, paths.New(library.CanonicalName+".a"), libObjectFiles, buildProperties) if err != nil { return nil, errors.WithStack(err) } diff --git a/legacy/builder/test/libraries_loader_test.go b/legacy/builder/test/libraries_loader_test.go index 125e404cbcb..4e1ca1a28f7 100644 --- a/legacy/builder/test/libraries_loader_test.go +++ b/legacy/builder/test/libraries_loader_test.go @@ -31,12 +31,13 @@ import ( func extractLibraries(ctx *types.Context) []*libraries.Library { res := []*libraries.Library{} for _, lib := range ctx.LibrariesManager.Libraries { - for _, libAlternative := range lib.Alternatives { + for _, libAlternative := range lib { res = append(res, libAlternative) } } return res } + func TestLoadLibrariesAVR(t *testing.T) { DownloadCoresAndToolsAndLibraries(t) @@ -75,7 +76,7 @@ func TestLoadLibrariesAVR(t *testing.T) { require.Equal(t, "ANewLibrary-master", libs[idx].Name) idx++ - require.Equal(t, "Adafruit_PN532", libs[idx].Name) + require.Equal(t, "Adafruit PN532", libs[idx].Name) require.True(t, Abs(t, paths.New("downloaded_libraries/Adafruit_PN532")).EquivalentTo(libs[idx].InstallDir)) require.True(t, Abs(t, paths.New("downloaded_libraries/Adafruit_PN532")).EquivalentTo(libs[idx].SourceDir)) require.Equal(t, 1, len(libs[idx].Architectures)) @@ -114,7 +115,7 @@ func TestLoadLibrariesAVR(t *testing.T) { idx++ require.Equal(t, "IRremote", libs[idx].Name) idx++ - require.Equal(t, "Robot_IR_Remote", libs[idx].Name) + require.Equal(t, "Robot IR Remote", libs[idx].Name) idx++ require.Equal(t, "SPI", libs[idx].Name) idx++ @@ -140,7 +141,7 @@ func TestLoadLibrariesAVR(t *testing.T) { libs = ctx.LibrariesResolver.AlternativesFor("Adafruit_PN532.h") require.Len(t, libs, 1) - require.Equal(t, "Adafruit_PN532", libs[0].Name) + require.Equal(t, "Adafruit PN532", libs[0].Name) libs = ctx.LibrariesResolver.AlternativesFor("IRremote.h") require.Len(t, libs, 1) @@ -183,7 +184,7 @@ func TestLoadLibrariesSAM(t *testing.T) { idx := 0 require.Equal(t, "ANewLibrary-master", libraries[idx].Name) idx++ - require.Equal(t, "Adafruit_PN532", libraries[idx].Name) + require.Equal(t, "Adafruit PN532", libraries[idx].Name) idx++ require.Equal(t, "Audio", libraries[idx].Name) idx++ @@ -203,7 +204,7 @@ func TestLoadLibrariesSAM(t *testing.T) { idx++ require.Equal(t, "IRremote", libraries[idx].Name) idx++ - require.Equal(t, "Robot_IR_Remote", libraries[idx].Name) + require.Equal(t, "Robot IR Remote", libraries[idx].Name) idx++ require.Equal(t, "SPI", libraries[idx].Name) idx++ diff --git a/legacy/builder/types/types.go b/legacy/builder/types/types.go index 70ee1c34608..ff12a63eafd 100644 --- a/legacy/builder/types/types.go +++ b/legacy/builder/types/types.go @@ -53,7 +53,7 @@ func buildRoot(ctx *Context, origin interface{}) *paths.Path { case *sketch.Sketch: return ctx.SketchBuildPath case *libraries.Library: - return ctx.LibrariesBuildPath.Join(o.Name) + return ctx.LibrariesBuildPath.Join(o.CanonicalName) default: panic("Unexpected origin for SourceFile: " + fmt.Sprint(origin)) } diff --git a/rpc/cc/arduino/cli/commands/v1/lib.pb.go b/rpc/cc/arduino/cli/commands/v1/lib.pb.go index 8b228350fc4..8753f33b7aa 100644 --- a/rpc/cc/arduino/cli/commands/v1/lib.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/lib.pb.go @@ -1744,6 +1744,8 @@ type Library struct { // (e.g., `arduino:avr@1.8.2`). ContainerPlatform string `protobuf:"bytes,14,opt,name=container_platform,json=containerPlatform,proto3" json:"container_platform,omitempty"` // Value of the `name` field in library.properties. + // + // Deprecated: Do not use. RealName string `protobuf:"bytes,16,opt,name=real_name,json=realName,proto3" json:"real_name,omitempty"` // Value of the `dot_a_linkage` field in library.properties. DotALinkage bool `protobuf:"varint,17,opt,name=dot_a_linkage,json=dotALinkage,proto3" json:"dot_a_linkage,omitempty"` @@ -1896,6 +1898,7 @@ func (x *Library) GetContainerPlatform() string { return "" } +// Deprecated: Do not use. func (x *Library) GetRealName() string { if x != nil { return x.RealName @@ -2461,7 +2464,7 @@ var file_cc_arduino_cli_commands_v1_lib_proto_rawDesc = []byte{ 0x32, 0x2a, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, 0x72, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0xee, 0x08, 0x0a, 0x07, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0xf2, 0x08, 0x0a, 0x07, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x1e, 0x0a, @@ -2486,118 +2489,119 @@ var file_cc_arduino_cli_commands_v1_lib_proto_rawDesc = []byte{ 0x75, 0x74, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x69, 0x72, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, - 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, - 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x6f, 0x74, 0x5f, 0x61, 0x5f, - 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, - 0x6f, 0x74, 0x41, 0x4c, 0x69, 0x6e, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, - 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0b, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, - 0x6c, 0x64, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6c, 0x64, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x47, 0x0a, - 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x2b, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, + 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1f, 0x0a, 0x09, 0x72, 0x65, 0x61, + 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, + 0x52, 0x08, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x6f, + 0x74, 0x5f, 0x61, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0b, 0x64, 0x6f, 0x74, 0x41, 0x4c, 0x69, 0x6e, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x12, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, + 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x64, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x13, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6c, 0x64, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, + 0x73, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x69, 0x73, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x16, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0a, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x33, 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, 0x4c, 0x69, + 0x62, 0x72, 0x61, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, + 0x73, 0x12, 0x47, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x18, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2b, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x06, 0x6c, 0x61, + 0x79, 0x6f, 0x75, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0e, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, + 0x61, 0x79, 0x6f, 0x75, 0x74, 0x52, 0x06, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x18, 0x1b, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x73, 0x49, 0x6e, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x12, 0x60, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, + 0x69, 0x62, 0x6c, 0x65, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x18, 0x1c, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x37, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x06, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, - 0x18, 0x19, 0x20, 0x01, 0x28, 0x0e, 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, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x61, 0x79, 0x6f, 0x75, - 0x74, 0x52, 0x06, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x73, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x73, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x73, 0x12, 0x60, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, - 0x5f, 0x77, 0x69, 0x74, 0x68, 0x18, 0x1c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x63, - 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, - 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, - 0x57, 0x69, 0x74, 0x68, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, - 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8e, 0x01, 0x0a, 0x18, 0x5a, 0x69, 0x70, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 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, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x76, 0x65, - 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6f, 0x76, - 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x22, 0x6a, 0x0a, 0x19, 0x5a, 0x69, 0x70, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x63, - 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x18, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 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, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x22, 0x6a, 0x0a, 0x19, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4d, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, + 0x72, 0x61, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x57, + 0x69, 0x74, 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, + 0x69, 0x62, 0x6c, 0x65, 0x57, 0x69, 0x74, 0x68, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x61, + 0x74, 0x69, 0x62, 0x6c, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8e, 0x01, 0x0a, 0x18, 0x5a, + 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 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, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1c, 0x0a, + 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x22, 0x6a, 0x0a, 0x19, 0x5a, + 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, + 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, + 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x50, + 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x18, 0x47, 0x69, 0x74, 0x4c, + 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 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, 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, 0x2a, 0x61, - 0x0a, 0x16, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x1d, 0x4c, 0x49, 0x42, 0x52, - 0x41, 0x52, 0x59, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x5f, 0x4c, 0x4f, 0x43, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x00, 0x12, 0x24, 0x0a, 0x20, 0x4c, - 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x5f, 0x4c, - 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x54, 0x49, 0x4e, 0x10, - 0x01, 0x2a, 0x5a, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x1c, 0x4c, 0x49, 0x42, 0x52, - 0x41, 0x52, 0x59, 0x5f, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, - 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x4c, 0x49, - 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x2a, 0x46, 0x0a, - 0x0d, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x17, - 0x0a, 0x13, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, - 0x5f, 0x46, 0x4c, 0x41, 0x54, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x4c, 0x49, 0x42, 0x52, 0x41, - 0x52, 0x59, 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, 0x5f, 0x52, 0x45, 0x43, 0x55, 0x52, 0x53, - 0x49, 0x56, 0x45, 0x10, 0x01, 0x2a, 0xc3, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x18, 0x4c, 0x49, 0x42, - 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x55, - 0x49, 0x4c, 0x54, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x4c, 0x49, 0x42, 0x52, 0x41, - 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x52, - 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x4f, - 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, - 0x42, 0x55, 0x49, 0x4c, 0x54, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x30, 0x0a, 0x2c, 0x4c, 0x49, 0x42, - 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, - 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x44, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, - 0x4d, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x54, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x4c, + 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6f, 0x76, 0x65, + 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x22, 0x6a, 0x0a, 0x19, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x63, 0x2e, + 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x0c, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x2a, 0x61, 0x0a, 0x16, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x1d, + 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x5f, + 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x00, 0x12, + 0x24, 0x0a, 0x20, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, + 0x4c, 0x4c, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x49, 0x4c, + 0x54, 0x49, 0x4e, 0x10, 0x01, 0x2a, 0x5a, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x1c, + 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, + 0x0a, 0x1d, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, + 0x01, 0x2a, 0x46, 0x0a, 0x0d, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x61, 0x79, 0x6f, + 0x75, 0x74, 0x12, 0x17, 0x0a, 0x13, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x41, + 0x59, 0x4f, 0x55, 0x54, 0x5f, 0x46, 0x4c, 0x41, 0x54, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x4c, + 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x41, 0x59, 0x4f, 0x55, 0x54, 0x5f, 0x52, 0x45, + 0x43, 0x55, 0x52, 0x53, 0x49, 0x56, 0x45, 0x10, 0x01, 0x2a, 0xc3, 0x01, 0x0a, 0x0f, 0x4c, 0x69, + 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, + 0x18, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x54, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x55, 0x4e, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x44, 0x10, 0x04, 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, + 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, + 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, + 0x4f, 0x52, 0x4d, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x54, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x30, 0x0a, + 0x2c, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x44, 0x5f, 0x50, 0x4c, 0x41, + 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x42, 0x55, 0x49, 0x4c, 0x54, 0x49, 0x4e, 0x10, 0x03, 0x12, + 0x1e, 0x0a, 0x1a, 0x4c, 0x49, 0x42, 0x52, 0x41, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4d, 0x41, 0x4e, 0x41, 0x47, 0x45, 0x44, 0x10, 0x04, 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/lib.proto b/rpc/cc/arduino/cli/commands/v1/lib.proto index c8c6f626b4c..f92bd99349c 100644 --- a/rpc/cc/arduino/cli/commands/v1/lib.proto +++ b/rpc/cc/arduino/cli/commands/v1/lib.proto @@ -280,7 +280,7 @@ message Library { // (e.g., `arduino:avr@1.8.2`). string container_platform = 14; // Value of the `name` field in library.properties. - string real_name = 16; + string real_name = 16 [ deprecated = true ]; // Value of the `dot_a_linkage` field in library.properties. bool dot_a_linkage = 17; // Value of the `precompiled` field in library.properties.