From fd5dc838672cf5370aeb9c5f0c90419617a2a07f Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 26 Jul 2022 16:50:29 +0200 Subject: [PATCH 01/13] Removed IDE-bundle autodetection --- arduino/cores/packagemanager/loader.go | 2 +- cli/config/validate.go | 2 + commands/compile/compile.go | 27 ++----------- commands/instances.go | 6 ++- configuration/configuration.go | 56 -------------------------- configuration/defaults.go | 2 + configuration/directories.go | 41 +++++-------------- 7 files changed, 21 insertions(+), 115 deletions(-) diff --git a/arduino/cores/packagemanager/loader.go b/arduino/cores/packagemanager/loader.go index 8d12a5f6377..f3f8d692a2b 100644 --- a/arduino/cores/packagemanager/loader.go +++ b/arduino/cores/packagemanager/loader.go @@ -38,7 +38,7 @@ func (pm *Builder) LoadHardware() []error { hardwareDirs := configuration.HardwareDirectories(configuration.Settings) merr := pm.LoadHardwareFromDirectories(hardwareDirs) - bundleToolDirs := configuration.BundleToolsDirectories(configuration.Settings) + bundleToolDirs := configuration.BuiltinToolsDirectories(configuration.Settings) merr = append(merr, pm.LoadToolsFromBundleDirectories(bundleToolDirs)...) return merr diff --git a/cli/config/validate.go b/cli/config/validate.go index 38df07145c3..6d04b4bada4 100644 --- a/cli/config/validate.go +++ b/cli/config/validate.go @@ -30,6 +30,8 @@ var validMap = map[string]reflect.Kind{ "directories.data": reflect.String, "directories.downloads": reflect.String, "directories.user": reflect.String, + "directories.builtin.tools": reflect.String, + "directories.builtin.libraries": reflect.String, "library.enable_unsafe_install": reflect.Bool, "logging.file": reflect.String, "logging.format": reflect.String, diff --git a/commands/compile/compile.go b/commands/compile/compile.go index 6a2af24b7f4..75278662f52 100644 --- a/commands/compile/compile.go +++ b/commands/compile/compile.go @@ -19,8 +19,6 @@ import ( "context" "fmt" "io" - "path/filepath" - "sort" "strings" "github.com/arduino/arduino-cli/arduino" @@ -35,7 +33,6 @@ import ( "github.com/arduino/arduino-cli/legacy/builder/types" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" paths "github.com/arduino/go-paths-helper" - properties "github.com/arduino/go-properties-orderedmap" "github.com/sirupsen/logrus" ) @@ -123,7 +120,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream // FIXME: This will be redundant when arduino-builder will be part of the cli builderCtx.HardwareDirs = configuration.HardwareDirectories(configuration.Settings) - builderCtx.BuiltInToolsDirs = configuration.BundleToolsDirectories(configuration.Settings) + builderCtx.BuiltInToolsDirs = configuration.BuiltinToolsDirectories(configuration.Settings) // FIXME: This will be redundant when arduino-builder will be part of the cli builderCtx.OtherLibrariesDirs = paths.NewPathList(req.GetLibraries()...) @@ -164,29 +161,11 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream } } + builderCtx.BuiltInLibrariesDirs = configuration.IDEBuiltinLibrariesDir(configuration.Settings) + // Will be deprecated. builderCtx.ArduinoAPIVersion = "10607" - // Check if Arduino IDE is installed and get it's libraries location. - // TODO: Remove? - dataDir := paths.New(configuration.Settings.GetString("directories.Data")) - preferencesTxt := dataDir.Join("preferences.txt") - ideProperties, err := properties.LoadFromPath(preferencesTxt) - if err == nil { - lastIdeSubProperties := ideProperties.SubTree("last").SubTree("ide") - // Preferences can contain records from previous IDE versions. Find the latest one. - var pathVariants []string - for k := range lastIdeSubProperties.AsMap() { - if strings.HasSuffix(k, ".hardwarepath") { - pathVariants = append(pathVariants, k) - } - } - sort.Strings(pathVariants) - ideHardwarePath := lastIdeSubProperties.Get(pathVariants[len(pathVariants)-1]) - ideLibrariesPath := filepath.Join(filepath.Dir(ideHardwarePath), "libraries") - builderCtx.BuiltInLibrariesDirs = paths.NewPathList(ideLibrariesPath) - } - builderCtx.Stdout = outStream builderCtx.Stderr = errStream builderCtx.Clean = req.GetClean() diff --git a/commands/instances.go b/commands/instances.go index bf4580059ad..8c663e60c3c 100644 --- a/commands/instances.go +++ b/commands/instances.go @@ -389,8 +389,10 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro if profile == nil { // Add directories of libraries bundled with IDE - if bundledLibsDir := configuration.IDEBundledLibrariesDir(configuration.Settings); bundledLibsDir != nil { - lm.AddLibrariesDir(bundledLibsDir, libraries.IDEBuiltIn) + if bundledLibsDir := configuration.IDEBuiltinLibrariesDir(configuration.Settings); bundledLibsDir != nil { + for _, d := range bundledLibsDir { + lm.AddLibrariesDir(d, libraries.IDEBuiltIn) + } } // Add libraries directory from config file diff --git a/configuration/configuration.go b/configuration/configuration.go index 58f9807f744..f781955b8ba 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -25,7 +25,6 @@ import ( "github.com/arduino/arduino-cli/i18n" paths "github.com/arduino/go-paths-helper" "github.com/arduino/go-win32-utils" - "github.com/sirupsen/logrus" "github.com/spf13/cobra" jww "github.com/spf13/jwalterweatherman" "github.com/spf13/viper" @@ -132,61 +131,6 @@ func getDefaultUserDir() string { } } -// IsBundledInDesktopIDE returns true if the CLI is bundled with the Arduino IDE. -func IsBundledInDesktopIDE(settings *viper.Viper) bool { - // value is cached the first time we run the check - if settings.IsSet("IDE.Bundled") { - return settings.GetBool("IDE.Bundled") - } - - settings.Set("IDE.Bundled", false) - settings.Set("IDE.Portable", false) - - logrus.Info("Checking if CLI is Bundled into the IDE") - executable, err := os.Executable() - if err != nil { - feedback.Errorf(tr("Cannot get executable path: %v"), err) - return false - } - - executablePath, err := filepath.EvalSymlinks(executable) - if err != nil { - feedback.Errorf(tr("Cannot get executable path: %v"), err) - return false - } - - ideDir := paths.New(executablePath).Parent() - logrus.WithField("dir", ideDir).Trace("Candidate IDE directory") - - // To determine if the CLI is bundled with an IDE, We check an arbitrary - // number of folders that are part of the IDE install tree - tests := []string{ - "tools-builder", - "examples/01.Basics/Blink", - } - - for _, test := range tests { - if !ideDir.Join(test).Exist() { - // the test folder doesn't exist or is not accessible - return false - } - } - - logrus.Info("The CLI is bundled in the Arduino IDE") - - // Persist IDE-related config settings - settings.Set("IDE.Bundled", true) - settings.Set("IDE.Directory", ideDir) - - // Check whether this is a portable install - if ideDir.Join("portable").Exist() { - logrus.Info("The IDE installation is 'portable'") - settings.Set("IDE.Portable", true) - } - - return true -} - // FindConfigFileInArgsOrWorkingDirectory returns the config file path using the // argument '--config-file' (if specified) or looking in the current working dir func FindConfigFileInArgsOrWorkingDirectory(args []string) string { diff --git a/configuration/defaults.go b/configuration/defaults.go index 323eb65203b..779bd654d05 100644 --- a/configuration/defaults.go +++ b/configuration/defaults.go @@ -65,5 +65,7 @@ func SetDefaults(settings *viper.Viper) { settings.BindEnv("directories.User", "ARDUINO_SKETCHBOOK_DIR") settings.BindEnv("directories.Downloads", "ARDUINO_DOWNLOADS_DIR") settings.BindEnv("directories.Data", "ARDUINO_DATA_DIR") + settings.BindEnv("directories.builtin.tools", "ARDUINO_BUILTIN_TOOLS_DIR") + settings.BindEnv("directories.builtin.libraires", "ARDUINO_BUILTIN_LIBRARIES_DIR") settings.BindEnv("sketch.always_export_binaries", "ARDUINO_SKETCH_ALWAYS_EXPORT_BINARIES") } diff --git a/configuration/directories.go b/configuration/directories.go index 408136a4619..9fd259ed8c3 100644 --- a/configuration/directories.go +++ b/configuration/directories.go @@ -24,12 +24,8 @@ import ( func HardwareDirectories(settings *viper.Viper) paths.PathList { res := paths.PathList{} - if IsBundledInDesktopIDE(settings) { - ideDir := paths.New(settings.GetString("IDE.Directory")) - bundledHardwareDir := ideDir.Join("hardware") - if bundledHardwareDir.IsDir() { - res.Add(bundledHardwareDir) - } + for _, bundledHardwareDir := range BuiltinToolsDirectories(Settings) { + res.Add(bundledHardwareDir) } if settings.IsSet("directories.Data") { @@ -50,34 +46,15 @@ func HardwareDirectories(settings *viper.Viper) paths.PathList { return res } -// BundleToolsDirectories returns all paths that may contains bundled-tools. -func BundleToolsDirectories(settings *viper.Viper) paths.PathList { - res := paths.PathList{} - - if IsBundledInDesktopIDE(settings) { - ideDir := paths.New(settings.GetString("IDE.Directory")) - bundledToolsDir := ideDir.Join("hardware", "tools") - if bundledToolsDir.IsDir() { - res = append(res, bundledToolsDir) - } - } - - return res +// BuiltinToolsDirectories returns all paths that may contains bundled-tools. +func BuiltinToolsDirectories(settings *viper.Viper) paths.PathList { + return paths.NewPathList(settings.GetStringSlice("directories.builtin.Tools")...) } -// IDEBundledLibrariesDir returns the libraries directory bundled in -// the Arduino IDE. If there is no Arduino IDE or the directory doesn't -// exists then nil is returned -func IDEBundledLibrariesDir(settings *viper.Viper) *paths.Path { - if IsBundledInDesktopIDE(settings) { - ideDir := paths.New(Settings.GetString("IDE.Directory")) - libDir := ideDir.Join("libraries") - if libDir.IsDir() { - return libDir - } - } - - return nil +// IDEBuiltinLibrariesDir returns the IDE-bundled libraries paths. Usually +// one of these directories is present in the Arduino IDE. +func IDEBuiltinLibrariesDir(settings *viper.Viper) paths.PathList { + return paths.NewPathList(Settings.GetStringSlice("directories.builtin.Libraries")...) } // LibrariesDir returns the full path to the user directory containing From 006f7109a8e145030d767f00ef1959f43766ec6a Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 1 Aug 2022 15:04:12 +0200 Subject: [PATCH 02/13] Do not return bundled tools folder with HardwarePaths --- configuration/directories.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/configuration/directories.go b/configuration/directories.go index 9fd259ed8c3..2a0f3d5dccf 100644 --- a/configuration/directories.go +++ b/configuration/directories.go @@ -24,10 +24,6 @@ import ( func HardwareDirectories(settings *viper.Viper) paths.PathList { res := paths.PathList{} - for _, bundledHardwareDir := range BuiltinToolsDirectories(Settings) { - res.Add(bundledHardwareDir) - } - if settings.IsSet("directories.Data") { packagesDir := PackagesDir(Settings) if packagesDir.IsDir() { From deda8e7268540a5a77fc1527d88d685da5e22d59 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 25 Aug 2022 16:13:18 +0200 Subject: [PATCH 03/13] Created configuration functions to obtain data dir and downloads dir --- .../cores/packagemanager/package_manager_test.go | 2 +- cli/cache/clean.go | 4 ++-- cli/cli.go | 2 +- cli/core/search.go | 3 +-- cli/instance/instance.go | 2 +- commands/instances.go | 6 +++--- configuration/directories.go | 14 ++++++++++++-- 7 files changed, 21 insertions(+), 12 deletions(-) diff --git a/arduino/cores/packagemanager/package_manager_test.go b/arduino/cores/packagemanager/package_manager_test.go index 9dd746d5b12..05a18e5ce72 100644 --- a/arduino/cores/packagemanager/package_manager_test.go +++ b/arduino/cores/packagemanager/package_manager_test.go @@ -224,7 +224,7 @@ func TestFindToolsRequiredForBoard(t *testing.T) { pmb := packagemanager.NewBuilder( dataDir1, configuration.PackagesDir(configuration.Settings), - paths.New(configuration.Settings.GetString("directories.Downloads")), + configuration.DownloadsDir(configuration.Settings), dataDir1, "test", ) diff --git a/cli/cache/clean.go b/cli/cache/clean.go index 9633737591c..cd0648f668f 100644 --- a/cli/cache/clean.go +++ b/cli/cache/clean.go @@ -40,8 +40,8 @@ func initCleanCommand() *cobra.Command { func runCleanCommand(cmd *cobra.Command, args []string) { logrus.Info("Executing `arduino-cli cache clean`") - cachePath := configuration.Settings.GetString("directories.Downloads") - err := os.RemoveAll(cachePath) + cachePath := configuration.DownloadsDir(configuration.Settings) + err := cachePath.RemoveAll() if err != nil { feedback.Errorf(tr("Error cleaning caches: %v"), err) os.Exit(errorcodes.ErrGeneric) diff --git a/cli/cli.go b/cli/cli.go index 72556e2d88a..a1e93998897 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -158,7 +158,7 @@ func preRun(cmd *cobra.Command, args []string) { configFile := configuration.Settings.ConfigFileUsed() // initialize inventory - err := inventory.Init(configuration.Settings.GetString("directories.Data")) + err := inventory.Init(configuration.DataDir(configuration.Settings).String()) if err != nil { feedback.Errorf("Error: %v", err) os.Exit(errorcodes.ErrBadArgument) diff --git a/cli/core/search.go b/cli/core/search.go index 7493763c5fc..53d3f592e32 100644 --- a/cli/core/search.go +++ b/cli/core/search.go @@ -34,7 +34,6 @@ import ( "github.com/arduino/arduino-cli/configuration" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/arduino-cli/table" - "github.com/arduino/go-paths-helper" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -130,7 +129,7 @@ func (sr searchResults) String() string { // of 24 hours is used. // Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". func indexesNeedUpdating(duration string) bool { - indexpath := paths.New(configuration.Settings.GetString("directories.Data")) + indexpath := configuration.DataDir(configuration.Settings) now := time.Now() modTimeThreshold, err := time.ParseDuration(duration) diff --git a/cli/instance/instance.go b/cli/instance/instance.go index a04ff24bf66..c51d18d606b 100644 --- a/cli/instance/instance.go +++ b/cli/instance/instance.go @@ -125,7 +125,7 @@ func InitWithProfile(instance *rpc.Instance, profileName string, sketchPath *pat // This ideally is only executed the first time the CLI is run. func FirstUpdate(instance *rpc.Instance) error { // Gets the data directory to verify if library_index.json and package_index.json exist - dataDir := paths.New(configuration.Settings.GetString("directories.data")) + dataDir := configuration.DataDir(configuration.Settings) libraryIndex := dataDir.Join("library_index.json") packageIndex := dataDir.Join("package_index.json") diff --git a/commands/instances.go b/commands/instances.go index 8c663e60c3c..5dc77f2796e 100644 --- a/commands/instances.go +++ b/commands/instances.go @@ -149,7 +149,7 @@ func Create(req *rpc.CreateRequest, extraUserAgent ...string) (*rpc.CreateRespon instance := &CoreInstance{} // Setup downloads directory - downloadsDir := paths.New(configuration.Settings.GetString("directories.Downloads")) + downloadsDir := configuration.DownloadsDir(configuration.Settings) if downloadsDir.NotExist() { err := downloadsDir.MkdirAll() if err != nil { @@ -158,7 +158,7 @@ func Create(req *rpc.CreateRequest, extraUserAgent ...string) (*rpc.CreateRespon } // Setup data directory - dataDir := paths.New(configuration.Settings.GetString("directories.Data")) + dataDir := configuration.DataDir(configuration.Settings) packagesDir := configuration.PackagesDir(configuration.Settings) if packagesDir.NotExist() { err := packagesDir.MkdirAll() @@ -497,7 +497,7 @@ func UpdateIndex(ctx context.Context, req *rpc.UpdateIndexRequest, downloadCB rp return nil, &arduino.InvalidInstanceError{} } - indexpath := paths.New(configuration.Settings.GetString("directories.Data")) + indexpath := configuration.DataDir(configuration.Settings) urls := []string{globals.DefaultIndexURL} urls = append(urls, configuration.Settings.GetStringSlice("board_manager.additional_urls")...) diff --git a/configuration/directories.go b/configuration/directories.go index 2a0f3d5dccf..717bd873123 100644 --- a/configuration/directories.go +++ b/configuration/directories.go @@ -61,12 +61,22 @@ func LibrariesDir(settings *viper.Viper) *paths.Path { // PackagesDir returns the full path to the packages folder func PackagesDir(settings *viper.Viper) *paths.Path { - return paths.New(settings.GetString("directories.Data")).Join("packages") + return DataDir(settings).Join("packages") } // ProfilesCacheDir returns the full path to the profiles cache directory // (it contains all the platforms and libraries used to compile a sketch // using profiles) func ProfilesCacheDir(settings *viper.Viper) *paths.Path { - return paths.New(settings.GetString("directories.Data")).Join("internal") + return DataDir(settings).Join("internal") +} + +// DataDir returns the full path to the data directory +func DataDir(settings *viper.Viper) *paths.Path { + return paths.New(settings.GetString("directories.Data")) +} + +// DownloadsDir returns the full path to the download cache directory +func DownloadsDir(settings *viper.Viper) *paths.Path { + return paths.New(settings.GetString("directories.Downloads")) } From 49d4dbabc9ffb065e47913f91b908e438eba2104 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 26 Aug 2022 01:17:35 +0200 Subject: [PATCH 04/13] Bundled libraries configuration is now considere a single directory --- commands/instances.go | 4 +- configuration/directories.go | 8 ++-- legacy/builder/libraries_loader.go | 4 +- legacy/builder/test/builder_test.go | 2 +- legacy/builder/test/ctags_runner_test.go | 10 ++--- .../test/includes_to_include_folders_test.go | 16 +++---- legacy/builder/test/libraries_loader_test.go | 8 ++-- .../test/merge_sketch_with_bootloader_test.go | 8 ++-- legacy/builder/test/prototypes_adder_test.go | 42 +++++++++---------- .../test/store_build_options_map_test.go | 2 +- .../try_build_of_problematic_sketch_test.go | 2 +- legacy/builder/types/context.go | 6 +-- 12 files changed, 54 insertions(+), 58 deletions(-) diff --git a/commands/instances.go b/commands/instances.go index 5dc77f2796e..b812267d481 100644 --- a/commands/instances.go +++ b/commands/instances.go @@ -390,9 +390,7 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro if profile == nil { // Add directories of libraries bundled with IDE if bundledLibsDir := configuration.IDEBuiltinLibrariesDir(configuration.Settings); bundledLibsDir != nil { - for _, d := range bundledLibsDir { - lm.AddLibrariesDir(d, libraries.IDEBuiltIn) - } + lm.AddLibrariesDir(bundledLibsDir, libraries.IDEBuiltIn) } // Add libraries directory from config file diff --git a/configuration/directories.go b/configuration/directories.go index 717bd873123..9a69548ceef 100644 --- a/configuration/directories.go +++ b/configuration/directories.go @@ -47,10 +47,10 @@ func BuiltinToolsDirectories(settings *viper.Viper) paths.PathList { return paths.NewPathList(settings.GetStringSlice("directories.builtin.Tools")...) } -// IDEBuiltinLibrariesDir returns the IDE-bundled libraries paths. Usually -// one of these directories is present in the Arduino IDE. -func IDEBuiltinLibrariesDir(settings *viper.Viper) paths.PathList { - return paths.NewPathList(Settings.GetStringSlice("directories.builtin.Libraries")...) +// IDEBuiltinLibrariesDir returns the IDE-bundled libraries path. Usually +// this directory is present in the Arduino IDE. +func IDEBuiltinLibrariesDir(settings *viper.Viper) *paths.Path { + return paths.New(Settings.GetString("directories.builtin.Libraries")) } // LibrariesDir returns the full path to the user directory containing diff --git a/legacy/builder/libraries_loader.go b/legacy/builder/libraries_loader.go index 93ab7c461a3..8ca114a8a2a 100644 --- a/legacy/builder/libraries_loader.go +++ b/legacy/builder/libraries_loader.go @@ -39,9 +39,7 @@ func (s *LibrariesLoader) Run(ctx *types.Context) error { if err := builtInLibrariesFolders.ToAbs(); err != nil { return errors.WithStack(err) } - for _, folder := range builtInLibrariesFolders { - lm.AddLibrariesDir(folder, libraries.IDEBuiltIn) - } + lm.AddLibrariesDir(builtInLibrariesFolders, libraries.IDEBuiltIn) if ctx.ActualPlatform != ctx.TargetPlatform { lm.AddPlatformReleaseLibrariesDir(ctx.ActualPlatform, libraries.ReferencedPlatformBuiltIn) diff --git a/legacy/builder/test/builder_test.go b/legacy/builder/test/builder_test.go index 8fd13f9509b..21107425fd5 100644 --- a/legacy/builder/test/builder_test.go +++ b/legacy/builder/test/builder_test.go @@ -37,7 +37,7 @@ func prepareBuilderTestContext(t *testing.T, sketchPath *paths.Path, fqbn string FQBN: parseFQBN(t, fqbn), HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), ArduinoAPIVersion: "10600", Verbose: false, diff --git a/legacy/builder/test/ctags_runner_test.go b/legacy/builder/test/ctags_runner_test.go index 0f4e8d92ee1..7aa70a58478 100644 --- a/legacy/builder/test/ctags_runner_test.go +++ b/legacy/builder/test/ctags_runner_test.go @@ -34,7 +34,7 @@ func TestCTagsRunner(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -84,7 +84,7 @@ func TestCTagsRunnerSketchWithClass(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -132,7 +132,7 @@ func TestCTagsRunnerSketchWithTypename(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -179,7 +179,7 @@ func TestCTagsRunnerSketchWithNamespace(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -225,7 +225,7 @@ func TestCTagsRunnerSketchWithTemplates(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), diff --git a/legacy/builder/test/includes_to_include_folders_test.go b/legacy/builder/test/includes_to_include_folders_test.go index 86836bd5c49..7049a06ef03 100644 --- a/legacy/builder/test/includes_to_include_folders_test.go +++ b/legacy/builder/test/includes_to_include_folders_test.go @@ -32,7 +32,7 @@ func TestIncludesToIncludeFolders(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -68,7 +68,7 @@ func TestIncludesToIncludeFoldersSketchWithIfDef(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("SketchWithIfDef", "SketchWithIfDef.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -103,7 +103,7 @@ func TestIncludesToIncludeFoldersIRremoteLibrary(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch9", "sketch9.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -141,7 +141,7 @@ func TestIncludesToIncludeFoldersANewLibrary(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch10", "sketch10.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -176,7 +176,7 @@ func TestIncludesToIncludeFoldersDuplicateLibs(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), SketchLocation: paths.New("user_hardware", "my_avr_platform", "avr", "libraries", "SPI", "examples", "BarometricPressureSensor", "BarometricPressureSensor.ino"), FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), ArduinoAPIVersion: "10600", @@ -213,7 +213,7 @@ func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatfo ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("user_hardware", "my_avr_platform", "avr", "libraries", "SPI", "examples", "BarometricPressureSensor", "BarometricPressureSensor.ino"), FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), @@ -251,7 +251,7 @@ func TestIncludesToIncludeFoldersDuplicateLibs2(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "downloaded_board_manager_stuff"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch_usbhost", "sketch_usbhost.ino"), FQBN: parseFQBN(t, "arduino:samd:arduino_zero_native"), @@ -289,7 +289,7 @@ func TestIncludesToIncludeFoldersSubfolders(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch_with_subfolders", "sketch_with_subfolders.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), diff --git a/legacy/builder/test/libraries_loader_test.go b/legacy/builder/test/libraries_loader_test.go index 9bed71806a5..125e404cbcb 100644 --- a/legacy/builder/test/libraries_loader_test.go +++ b/legacy/builder/test/libraries_loader_test.go @@ -42,7 +42,7 @@ func TestLoadLibrariesAVR(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), } @@ -152,7 +152,7 @@ func TestLoadLibrariesSAM(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), FQBN: parseFQBN(t, "arduino:sam:arduino_due_x_dbg"), } @@ -235,7 +235,7 @@ func TestLoadLibrariesAVRNoDuplicateLibrariesFolders(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries", filepath.Join("downloaded_hardware", "arduino", "avr", "libraries")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), } @@ -264,7 +264,7 @@ func TestLoadLibrariesMyAVRPlatform(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "user_hardware", "downloaded_hardware"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries", filepath.Join("downloaded_hardware", "arduino", "avr", "libraries")), FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), } diff --git a/legacy/builder/test/merge_sketch_with_bootloader_test.go b/legacy/builder/test/merge_sketch_with_bootloader_test.go index 89f08131461..cea8964c31b 100644 --- a/legacy/builder/test/merge_sketch_with_bootloader_test.go +++ b/legacy/builder/test/merge_sketch_with_bootloader_test.go @@ -34,7 +34,7 @@ func TestMergeSketchWithBootloader(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch1", "sketch1.ino"), FQBN: parseFQBN(t, "arduino:avr:uno"), @@ -104,7 +104,7 @@ func TestMergeSketchWithBootloaderSketchInBuildPath(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch1", "sketch1.ino"), FQBN: parseFQBN(t, "arduino:avr:uno"), @@ -175,7 +175,7 @@ func TestMergeSketchWithBootloaderWhenNoBootloaderAvailable(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch1", "sketch1.ino"), FQBN: parseFQBN(t, "arduino:avr:uno"), @@ -213,7 +213,7 @@ func TestMergeSketchWithBootloaderPathIsParameterized(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch1", "sketch1.ino"), FQBN: parseFQBN(t, "my_avr_platform:avr:mymega:cpu=atmega2560"), diff --git a/legacy/builder/test/prototypes_adder_test.go b/legacy/builder/test/prototypes_adder_test.go index 5025f199d82..9e94f4dd4b5 100644 --- a/legacy/builder/test/prototypes_adder_test.go +++ b/legacy/builder/test/prototypes_adder_test.go @@ -37,7 +37,7 @@ func TestPrototypesAdderBridgeExample(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -77,7 +77,7 @@ func TestPrototypesAdderSketchWithIfDef(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("SketchWithIfDef", "SketchWithIfDef.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -117,7 +117,7 @@ func TestPrototypesAdderBaladuino(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("Baladuino", "Baladuino.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -157,7 +157,7 @@ func TestPrototypesAdderCharWithEscapedDoubleQuote(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("CharWithEscapedDoubleQuote", "CharWithEscapedDoubleQuote.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -197,7 +197,7 @@ func TestPrototypesAdderIncludeBetweenMultilineComment(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("IncludeBetweenMultilineComment", "IncludeBetweenMultilineComment.ino"), FQBN: parseFQBN(t, "arduino:sam:arduino_due_x_dbg"), @@ -237,7 +237,7 @@ func TestPrototypesAdderLineContinuations(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("LineContinuations", "LineContinuations.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -277,7 +277,7 @@ func TestPrototypesAdderStringWithComment(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("StringWithComment", "StringWithComment.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -317,7 +317,7 @@ func TestPrototypesAdderSketchWithStruct(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("SketchWithStruct", "SketchWithStruct.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -365,7 +365,7 @@ func TestPrototypesAdderSketchWithConfig(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -411,7 +411,7 @@ func TestPrototypesAdderSketchNoFunctionsTwoFiles(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch_no_functions_two_files", "sketch_no_functions_two_files.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -451,7 +451,7 @@ func TestPrototypesAdderSketchNoFunctions(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketch_no_functions", "sketch_no_functions.ino"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -497,7 +497,7 @@ func TestPrototypesAdderSketchWithDefaultArgs(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -540,7 +540,7 @@ func TestPrototypesAdderSketchWithInlineFunction(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -594,7 +594,7 @@ func TestPrototypesAdderSketchWithFunctionSignatureInsideIFDEF(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -638,7 +638,7 @@ func TestPrototypesAdderSketchWithUSBCON(t *testing.T) { HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), OtherLibrariesDirs: paths.NewPathList("libraries"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), ArduinoAPIVersion: "10600", @@ -679,7 +679,7 @@ func TestPrototypesAdderSketchWithTypename(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), - BuiltInLibrariesDirs: paths.NewPathList("libraries", "downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("libraries", "downloaded_libraries"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:leonardo"), @@ -728,7 +728,7 @@ func TestPrototypesAdderSketchWithIfDef2(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:yun"), @@ -774,7 +774,7 @@ func TestPrototypesAdderSketchWithIfDef2SAM(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:sam:arduino_due_x_dbg"), @@ -820,7 +820,7 @@ func TestPrototypesAdderSketchWithConst(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:uno"), @@ -860,7 +860,7 @@ func TestPrototypesAdderSketchWithDosEol(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("eol_processing", "eol_processing.ino"), FQBN: parseFQBN(t, "arduino:avr:uno"), @@ -900,7 +900,7 @@ func TestPrototypesAdderSketchWithSubstringFunctionMember(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: sketchLocation, FQBN: parseFQBN(t, "arduino:avr:uno"), diff --git a/legacy/builder/test/store_build_options_map_test.go b/legacy/builder/test/store_build_options_map_test.go index 56c1913d7ee..9610d6f5a53 100644 --- a/legacy/builder/test/store_build_options_map_test.go +++ b/legacy/builder/test/store_build_options_map_test.go @@ -29,7 +29,7 @@ func TestStoreBuildOptionsMap(t *testing.T) { ctx := &types.Context{ HardwareDirs: paths.NewPathList("hardware"), BuiltInToolsDirs: paths.NewPathList("tools"), - BuiltInLibrariesDirs: paths.NewPathList("built-in libraries"), + BuiltInLibrariesDirs: paths.New("built-in libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), SketchLocation: paths.New("sketchLocation"), FQBN: parseFQBN(t, "my:nice:fqbn"), diff --git a/legacy/builder/test/try_build_of_problematic_sketch_test.go b/legacy/builder/test/try_build_of_problematic_sketch_test.go index 92c5afb1f3f..2e9fb66c007 100644 --- a/legacy/builder/test/try_build_of_problematic_sketch_test.go +++ b/legacy/builder/test/try_build_of_problematic_sketch_test.go @@ -210,7 +210,7 @@ func makeDefaultContext(t *testing.T) *types.Context { ctx := &types.Context{ HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "downloaded_board_manager_stuff"), BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), - BuiltInLibrariesDirs: paths.NewPathList("downloaded_libraries"), + BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), ArduinoAPIVersion: "10607", diff --git a/legacy/builder/types/context.go b/legacy/builder/types/context.go index 16b8d9c8acc..a0ad62115de 100644 --- a/legacy/builder/types/context.go +++ b/legacy/builder/types/context.go @@ -68,7 +68,7 @@ type Context struct { // Build options HardwareDirs paths.PathList BuiltInToolsDirs paths.PathList - BuiltInLibrariesDirs paths.PathList + BuiltInLibrariesDirs *paths.Path OtherLibrariesDirs paths.PathList LibraryDirs paths.PathList // List of paths pointing to individual library root folders SketchLocation *paths.Path // SketchLocation points to the main Sketch file @@ -208,7 +208,7 @@ func (ctx *Context) ExtractBuildOptions() *properties.Map { opts := properties.NewMap() opts.Set("hardwareFolders", strings.Join(ctx.HardwareDirs.AsStrings(), ",")) opts.Set("builtInToolsFolders", strings.Join(ctx.BuiltInToolsDirs.AsStrings(), ",")) - opts.Set("builtInLibrariesFolders", strings.Join(ctx.BuiltInLibrariesDirs.AsStrings(), ",")) + opts.Set("builtInLibrariesFolders", ctx.BuiltInLibrariesDirs.String()) opts.Set("otherLibrariesFolders", strings.Join(ctx.OtherLibrariesDirs.AsStrings(), ",")) opts.SetPath("sketchLocation", ctx.SketchLocation) var additionalFilesRelative []string @@ -233,7 +233,7 @@ func (ctx *Context) ExtractBuildOptions() *properties.Map { func (ctx *Context) InjectBuildOptions(opts *properties.Map) { ctx.HardwareDirs = paths.NewPathList(strings.Split(opts.Get("hardwareFolders"), ",")...) ctx.BuiltInToolsDirs = paths.NewPathList(strings.Split(opts.Get("builtInToolsFolders"), ",")...) - ctx.BuiltInLibrariesDirs = paths.NewPathList(strings.Split(opts.Get("builtInLibrariesFolders"), ",")...) + ctx.BuiltInLibrariesDirs = paths.New(opts.Get("builtInLibrariesFolders")) ctx.OtherLibrariesDirs = paths.NewPathList(strings.Split(opts.Get("otherLibrariesFolders"), ",")...) ctx.SketchLocation = opts.GetPath("sketchLocation") fqbn, err := cores.ParseFQBN(opts.Get("fqbn")) From a2132702ef7cc2b41879ece965b85a8c28d6667a Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 26 Aug 2022 11:32:52 +0200 Subject: [PATCH 05/13] Allow library installation on bundled libs dir via gRPC --- arduino/libraries/libraries_location.go | 16 +- arduino/libraries/librariesmanager/install.go | 23 +- .../librariesmanager/librariesmanager.go | 4 +- commands/lib/install.go | 13 +- commands/lib/upgrade.go | 3 +- rpc/cc/arduino/cli/commands/v1/lib.pb.go | 872 ++++++++++-------- rpc/cc/arduino/cli/commands/v1/lib.proto | 14 +- 7 files changed, 522 insertions(+), 423 deletions(-) diff --git a/arduino/libraries/libraries_location.go b/arduino/libraries/libraries_location.go index f93a6a01f40..709bca8b96f 100644 --- a/arduino/libraries/libraries_location.go +++ b/arduino/libraries/libraries_location.go @@ -93,7 +93,7 @@ func (d *LibraryLocation) UnmarshalJSON(b []byte) error { func (d *LibraryLocation) ToRPCLibraryLocation() rpc.LibraryLocation { switch *d { case IDEBuiltIn: - return rpc.LibraryLocation_LIBRARY_LOCATION_IDE_BUILTIN + return rpc.LibraryLocation_LIBRARY_LOCATION_BUILTIN case PlatformBuiltIn: return rpc.LibraryLocation_LIBRARY_LOCATION_PLATFORM_BUILTIN case ReferencedPlatformBuiltIn: @@ -110,7 +110,7 @@ func (d *LibraryLocation) ToRPCLibraryLocation() rpc.LibraryLocation { // FromRPCLibraryLocation converts a rpc.LibraryLocation to a LibraryLocation func FromRPCLibraryLocation(l rpc.LibraryLocation) LibraryLocation { switch l { - case rpc.LibraryLocation_LIBRARY_LOCATION_IDE_BUILTIN: + case rpc.LibraryLocation_LIBRARY_LOCATION_BUILTIN: return IDEBuiltIn case rpc.LibraryLocation_LIBRARY_LOCATION_PLATFORM_BUILTIN: return PlatformBuiltIn @@ -124,3 +124,15 @@ func FromRPCLibraryLocation(l rpc.LibraryLocation) LibraryLocation { panic(fmt.Sprintf("invalid rpc.LibraryLocation value %d", l)) } } + +// FromRPCLibraryInstallLocation converts a rpc.LibraryInstallLocation to a LibraryLocation +func FromRPCLibraryInstallLocation(l rpc.LibraryInstallLocation) LibraryLocation { + switch l { + case rpc.LibraryInstallLocation_LIBRARY_INSTALL_LOCATION_BUILTIN: + return IDEBuiltIn + case rpc.LibraryInstallLocation_LIBRARY_INSTALL_LOCATION_USER: + return User + default: + panic(fmt.Sprintf("invalid rpc.LibraryInstallLocation value %d", l)) + } +} diff --git a/arduino/libraries/librariesmanager/install.go b/arduino/libraries/librariesmanager/install.go index 734ad6f0230..8363e000362 100644 --- a/arduino/libraries/librariesmanager/install.go +++ b/arduino/libraries/librariesmanager/install.go @@ -48,13 +48,13 @@ var ( // InstallPrerequisiteCheck performs prequisite checks to install a library. It returns the // 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) (*paths.Path, *libraries.Library, error) { +func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release, installLocation libraries.LibraryLocation) (*paths.Path, *libraries.Library, error) { saneName := utils.SanitizeName(indexLibrary.Library.Name) var replaced *libraries.Library if installedLibs, have := lm.Libraries[saneName]; have { for _, installedLib := range installedLibs.Alternatives { - if installedLib.Location != libraries.User { + if installedLib.Location != installLocation { continue } if installedLib.Version != nil && installedLib.Version.Equal(indexLibrary.Version) { @@ -64,9 +64,12 @@ func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesinde } } - libsDir := lm.getUserLibrariesDir() + libsDir := lm.getLibrariesDir(installLocation) if libsDir == nil { - return nil, nil, fmt.Errorf(tr("User directory not set")) + 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")) } libPath := libsDir.Join(saneName) @@ -79,8 +82,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) error { - libsDir := lm.getUserLibrariesDir() +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")) } @@ -100,9 +103,9 @@ func (lm *LibrariesManager) Uninstall(lib *libraries.Library) error { return nil } -//InstallZipLib installs a Zip library on the specified path. +// InstallZipLib installs a Zip library on the specified path. func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath string, overwrite bool) error { - libsDir := lm.getUserLibrariesDir() + libsDir := lm.getLibrariesDir(libraries.User) if libsDir == nil { return fmt.Errorf(tr("User directory not set")) } @@ -184,9 +187,9 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath strin return nil } -//InstallGitLib installs a library hosted on a git repository on the specified path. +// InstallGitLib installs a library hosted on a git repository on the specified path. func (lm *LibrariesManager) InstallGitLib(gitURL string, overwrite bool) error { - libsDir := lm.getUserLibrariesDir() + libsDir := lm.getLibrariesDir(libraries.User) if libsDir == nil { return fmt.Errorf(tr("User directory not set")) } diff --git a/arduino/libraries/librariesmanager/librariesmanager.go b/arduino/libraries/librariesmanager/librariesmanager.go index 292d37a9fc4..6b201efe536 100644 --- a/arduino/libraries/librariesmanager/librariesmanager.go +++ b/arduino/libraries/librariesmanager/librariesmanager.go @@ -175,9 +175,9 @@ func (lm *LibrariesManager) RescanLibraries() []*status.Status { return statuses } -func (lm *LibrariesManager) getUserLibrariesDir() *paths.Path { +func (lm *LibrariesManager) getLibrariesDir(installLocation libraries.LibraryLocation) *paths.Path { for _, dir := range lm.LibrariesDir { - if dir.Location == libraries.User { + if dir.Location == installLocation { return dir.Path } } diff --git a/commands/lib/install.go b/commands/lib/install.go index 880fb6f2e9b..ca5eabb6257 100644 --- a/commands/lib/install.go +++ b/commands/lib/install.go @@ -21,6 +21,7 @@ import ( "fmt" "github.com/arduino/arduino-cli/arduino" + "github.com/arduino/arduino-cli/arduino/libraries" "github.com/arduino/arduino-cli/arduino/libraries/librariesindex" "github.com/arduino/arduino-cli/arduino/libraries/librariesmanager" "github.com/arduino/arduino-cli/commands" @@ -30,13 +31,13 @@ import ( // LibraryInstall FIXMEDOC func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) error { - lm := commands.GetLibraryManager(req) if lm == nil { return &arduino.InvalidInstanceError{} } toInstall := map[string]*rpc.LibraryDependencyStatus{} + installLocation := libraries.FromRPCLibraryInstallLocation(req.GetInstallLocation()) if req.NoDeps { toInstall[req.Name] = &rpc.LibraryDependencyStatus{ Name: req.Name, @@ -81,7 +82,7 @@ func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, downloa // Check if any of the libraries to install is already installed and remove it from the list j := 0 for i, libRelease := range libReleasesToInstall { - _, libReplaced, err := lm.InstallPrerequisiteCheck(libRelease) + _, libReplaced, err := lm.InstallPrerequisiteCheck(libRelease, installLocation) if errors.Is(err, librariesmanager.ErrAlreadyInstalled) { taskCB(&rpc.TaskProgress{Message: tr("Already installed %s", libRelease), Completed: true}) } else if err != nil { @@ -104,7 +105,7 @@ func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, downloa return err } - if err := installLibrary(lm, libRelease, taskCB); err != nil { + if err := installLibrary(lm, libRelease, installLocation, taskCB); err != nil { if errors.Is(err, librariesmanager.ErrAlreadyInstalled) { continue } else { @@ -123,10 +124,10 @@ func LibraryInstall(ctx context.Context, req *rpc.LibraryInstallRequest, downloa return nil } -func installLibrary(lm *librariesmanager.LibrariesManager, libRelease *librariesindex.Release, taskCB rpc.TaskProgressCB) error { +func installLibrary(lm *librariesmanager.LibrariesManager, libRelease *librariesindex.Release, installLocation libraries.LibraryLocation, taskCB rpc.TaskProgressCB) error { taskCB(&rpc.TaskProgress{Name: tr("Installing %s", libRelease)}) logrus.WithField("library", libRelease).Info("Installing library") - libPath, libReplaced, err := lm.InstallPrerequisiteCheck(libRelease) + libPath, libReplaced, err := lm.InstallPrerequisiteCheck(libRelease, installLocation) if errors.Is(err, librariesmanager.ErrAlreadyInstalled) { taskCB(&rpc.TaskProgress{Message: tr("Already installed %s", libRelease), Completed: true}) return err @@ -140,7 +141,7 @@ 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); err != nil { + if err := lm.Install(libRelease, libPath, installLocation); err != nil { return &arduino.FailedLibraryInstallError{Cause: err} } diff --git a/commands/lib/upgrade.go b/commands/lib/upgrade.go index eeb911c46a0..b2b676fcb2f 100644 --- a/commands/lib/upgrade.go +++ b/commands/lib/upgrade.go @@ -20,6 +20,7 @@ import ( "errors" "github.com/arduino/arduino-cli/arduino" + "github.com/arduino/arduino-cli/arduino/libraries" "github.com/arduino/arduino-cli/arduino/libraries/librariesmanager" "github.com/arduino/arduino-cli/commands" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" @@ -64,7 +65,7 @@ func upgrade(lm *librariesmanager.LibrariesManager, libs []*installedLib, downlo // Go through the list and install them for _, lib := range libs { - if err := installLibrary(lm, lib.Available, taskCB); err != nil { + if err := installLibrary(lm, lib.Available, libraries.User, taskCB); err != nil { if !errors.Is(err, librariesmanager.ErrAlreadyInstalled) { return err } diff --git a/rpc/cc/arduino/cli/commands/v1/lib.pb.go b/rpc/cc/arduino/cli/commands/v1/lib.pb.go index 1b5bfe67f69..8b228350fc4 100644 --- a/rpc/cc/arduino/cli/commands/v1/lib.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/lib.pb.go @@ -35,6 +35,55 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type LibraryInstallLocation int32 + +const ( + // In the `libraries` subdirectory of the user directory (sketchbook). This is + // the default if not specified. + LibraryInstallLocation_LIBRARY_INSTALL_LOCATION_USER LibraryInstallLocation = 0 + // In the configured 'builtin.libraries' directory. + LibraryInstallLocation_LIBRARY_INSTALL_LOCATION_BUILTIN LibraryInstallLocation = 1 +) + +// Enum value maps for LibraryInstallLocation. +var ( + LibraryInstallLocation_name = map[int32]string{ + 0: "LIBRARY_INSTALL_LOCATION_USER", + 1: "LIBRARY_INSTALL_LOCATION_BUILTIN", + } + LibraryInstallLocation_value = map[string]int32{ + "LIBRARY_INSTALL_LOCATION_USER": 0, + "LIBRARY_INSTALL_LOCATION_BUILTIN": 1, + } +) + +func (x LibraryInstallLocation) Enum() *LibraryInstallLocation { + p := new(LibraryInstallLocation) + *p = x + return p +} + +func (x LibraryInstallLocation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LibraryInstallLocation) Descriptor() protoreflect.EnumDescriptor { + return file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[0].Descriptor() +} + +func (LibraryInstallLocation) Type() protoreflect.EnumType { + return &file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[0] +} + +func (x LibraryInstallLocation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LibraryInstallLocation.Descriptor instead. +func (LibraryInstallLocation) EnumDescriptor() ([]byte, []int) { + return file_cc_arduino_cli_commands_v1_lib_proto_rawDescGZIP(), []int{0} +} + type LibrarySearchStatus int32 const ( @@ -67,11 +116,11 @@ func (x LibrarySearchStatus) String() string { } func (LibrarySearchStatus) Descriptor() protoreflect.EnumDescriptor { - return file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[0].Descriptor() + return file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[1].Descriptor() } func (LibrarySearchStatus) Type() protoreflect.EnumType { - return &file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[0] + return &file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[1] } func (x LibrarySearchStatus) Number() protoreflect.EnumNumber { @@ -80,7 +129,7 @@ func (x LibrarySearchStatus) Number() protoreflect.EnumNumber { // Deprecated: Use LibrarySearchStatus.Descriptor instead. func (LibrarySearchStatus) EnumDescriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_lib_proto_rawDescGZIP(), []int{0} + return file_cc_arduino_cli_commands_v1_lib_proto_rawDescGZIP(), []int{1} } type LibraryLayout int32 @@ -115,11 +164,11 @@ func (x LibraryLayout) String() string { } func (LibraryLayout) Descriptor() protoreflect.EnumDescriptor { - return file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[1].Descriptor() + return file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[2].Descriptor() } func (LibraryLayout) Type() protoreflect.EnumType { - return &file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[1] + return &file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[2] } func (x LibraryLayout) Number() protoreflect.EnumNumber { @@ -128,14 +177,14 @@ func (x LibraryLayout) Number() protoreflect.EnumNumber { // Deprecated: Use LibraryLayout.Descriptor instead. func (LibraryLayout) EnumDescriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_lib_proto_rawDescGZIP(), []int{1} + return file_cc_arduino_cli_commands_v1_lib_proto_rawDescGZIP(), []int{2} } type LibraryLocation int32 const ( - // In the `libraries` subdirectory of the Arduino IDE installation. - LibraryLocation_LIBRARY_LOCATION_IDE_BUILTIN LibraryLocation = 0 + // In the configured 'builtin.libraries' directory. + LibraryLocation_LIBRARY_LOCATION_BUILTIN LibraryLocation = 0 // In the `libraries` subdirectory of the user directory (sketchbook). LibraryLocation_LIBRARY_LOCATION_USER LibraryLocation = 1 // In the `libraries` subdirectory of a platform. @@ -151,14 +200,14 @@ const ( // Enum value maps for LibraryLocation. var ( LibraryLocation_name = map[int32]string{ - 0: "LIBRARY_LOCATION_IDE_BUILTIN", + 0: "LIBRARY_LOCATION_BUILTIN", 1: "LIBRARY_LOCATION_USER", 2: "LIBRARY_LOCATION_PLATFORM_BUILTIN", 3: "LIBRARY_LOCATION_REFERENCED_PLATFORM_BUILTIN", 4: "LIBRARY_LOCATION_UNMANAGED", } LibraryLocation_value = map[string]int32{ - "LIBRARY_LOCATION_IDE_BUILTIN": 0, + "LIBRARY_LOCATION_BUILTIN": 0, "LIBRARY_LOCATION_USER": 1, "LIBRARY_LOCATION_PLATFORM_BUILTIN": 2, "LIBRARY_LOCATION_REFERENCED_PLATFORM_BUILTIN": 3, @@ -177,11 +226,11 @@ func (x LibraryLocation) String() string { } func (LibraryLocation) Descriptor() protoreflect.EnumDescriptor { - return file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[2].Descriptor() + return file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[3].Descriptor() } func (LibraryLocation) Type() protoreflect.EnumType { - return &file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[2] + return &file_cc_arduino_cli_commands_v1_lib_proto_enumTypes[3] } func (x LibraryLocation) Number() protoreflect.EnumNumber { @@ -190,7 +239,7 @@ func (x LibraryLocation) Number() protoreflect.EnumNumber { // Deprecated: Use LibraryLocation.Descriptor instead. func (LibraryLocation) EnumDescriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_lib_proto_rawDescGZIP(), []int{2} + return file_cc_arduino_cli_commands_v1_lib_proto_rawDescGZIP(), []int{3} } type LibraryDownloadRequest struct { @@ -324,6 +373,8 @@ type LibraryInstallRequest struct { // Set to true to skip installation if a different version of the library or // one of its dependencies is already installed, defaults to false. NoOverwrite bool `protobuf:"varint,5,opt,name=no_overwrite,json=noOverwrite,proto3" json:"no_overwrite,omitempty"` + // Install the library and dependencies in the specified location + InstallLocation LibraryInstallLocation `protobuf:"varint,6,opt,name=install_location,json=installLocation,proto3,enum=cc.arduino.cli.commands.v1.LibraryInstallLocation" json:"install_location,omitempty"` } func (x *LibraryInstallRequest) Reset() { @@ -393,6 +444,13 @@ func (x *LibraryInstallRequest) GetNoOverwrite() bool { return false } +func (x *LibraryInstallRequest) GetInstallLocation() LibraryInstallLocation { + if x != nil { + return x.InstallLocation + } + return LibraryInstallLocation_LIBRARY_INSTALL_LOCATION_USER +} + type LibraryInstallResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1898,7 +1956,7 @@ func (x *Library) GetLocation() LibraryLocation { if x != nil { return x.Location } - return LibraryLocation_LIBRARY_LOCATION_IDE_BUILTIN + return LibraryLocation_LIBRARY_LOCATION_BUILTIN } func (x *Library) GetLayout() LibraryLayout { @@ -2183,7 +2241,7 @@ var file_cc_arduino_cli_commands_v1_lib_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x2c, 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, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, - 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0xc3, 0x01, 0x0a, 0x15, + 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa2, 0x02, 0x0a, 0x15, 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, @@ -2196,338 +2254,350 @@ var file_cc_arduino_cli_commands_v1_lib_proto_rawDesc = []byte{ 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6e, 0x6f, 0x44, 0x65, 0x70, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6e, 0x6f, 0x4f, 0x76, 0x65, 0x72, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x22, 0xb1, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 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, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, - 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4d, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, - 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 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, 0x86, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 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, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6e, 0x6f, 0x44, 0x65, 0x70, 0x73, 0x22, 0xb1, - 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 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, + 0x65, 0x12, 0x5d, 0x0a, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x6c, 0x6f, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 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, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, - 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x12, 0x4d, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 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, 0x89, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0xb1, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 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, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, + 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, + 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4d, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, + 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 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, 0x86, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 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, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x69, - 0x0a, 0x18, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, 0x69, 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, 0x5c, 0x0a, 0x18, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 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, 0x22, 0xb4, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, 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, 0x61, 0x72, 0x64, - 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x4d, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x02, 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, 0x93, - 0x01, 0x0a, 0x21, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, - 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x5f, 0x64, 0x65, 0x70, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6e, 0x6f, 0x44, 0x65, 0x70, 0x73, 0x22, 0xb1, 0x01, + 0x0a, 0x16, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 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, + 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x4d, 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 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, 0x89, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, 0x69, + 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, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x69, 0x0a, + 0x18, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, 0x69, 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, 0x5c, 0x0a, 0x18, 0x4c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 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, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x7d, 0x0a, 0x22, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0c, 0x64, 0x65, - 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01, 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, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x69, 0x65, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, - 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x2b, - 0x0a, 0x11, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0x6e, 0x0a, 0x14, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xb4, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x62, 0x72, 0x61, + 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, 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, 0x61, 0x72, 0x64, 0x75, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x4d, + 0x0a, 0x0d, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x02, 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, 0x93, 0x01, + 0x0a, 0x21, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, + 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 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, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xab, 0x01, 0x0a, 0x15, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x09, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 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, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x64, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x09, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x47, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x2f, 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, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa9, 0x02, 0x0a, 0x0f, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x65, 0x64, 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, 0x55, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x39, 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, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, - 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, - 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x22, 0x7d, 0x0a, 0x22, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0c, 0x64, 0x65, 0x70, + 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01, 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, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, + 0x65, 0x73, 0x22, 0x85, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x65, + 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, + 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x2b, 0x0a, + 0x11, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0x6e, 0x0a, 0x14, 0x4c, 0x69, + 0x62, 0x72, 0x61, 0x72, 0x79, 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, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0xab, 0x01, 0x0a, 0x15, 0x4c, + 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x09, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 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, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x64, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x52, 0x09, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, + 0x47, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2f, 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, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xa9, 0x02, 0x0a, 0x0f, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x65, 0x64, 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, 0x55, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x39, 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, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2e, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 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, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x67, 0x0a, 0x0d, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 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, 0x40, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 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, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0xf4, 0x03, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 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, 0x1e, 0x0a, 0x0a, 0x6d, 0x61, 0x69, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, + 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, + 0x74, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6e, + 0x74, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x67, 0x72, 0x61, + 0x70, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x61, 0x67, 0x72, + 0x61, 0x70, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x72, 0x63, + 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 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, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x67, 0x0a, 0x0d, - 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 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, - 0x40, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, + 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x73, + 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 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, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xf4, 0x03, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 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, 0x1e, 0x0a, 0x0a, 0x6d, 0x61, - 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, - 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, - 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x67, 0x72, - 0x61, 0x70, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x61, 0x67, - 0x72, 0x61, 0x70, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x72, - 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x63, 0x2e, 0x61, + 0x61, 0x72, 0x79, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0x56, 0x0a, 0x11, 0x4c, + 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, + 0x69, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x10, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x72, + 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x46, 0x69, 0x6c, + 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x63, 0x68, 0x65, + 0x50, 0x61, 0x74, 0x68, 0x22, 0xae, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 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, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, + 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x74, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, 0x13, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 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, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x11, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x73, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x73, 0x12, 0x51, 0x0a, 0x0c, 0x64, 0x65, 0x70, - 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2d, 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, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, - 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0x56, 0x0a, 0x11, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x61, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x11, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, - 0x61, 0x69, 0x6e, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x10, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, - 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x61, - 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x46, 0x69, - 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x50, 0x61, 0x74, 0x68, 0x22, 0xae, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 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, 0x49, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, - 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x74, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, 0x0a, - 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 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, 0x6c, 0x6c, 0x65, - 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x22, 0x97, 0x01, 0x0a, - 0x10, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x12, 0x3d, 0x0a, 0x07, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x23, 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, 0x07, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, - 0x12, 0x44, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, + 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x10, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x12, 0x3d, 0x0a, 0x07, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 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, 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, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1a, - 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, - 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, - 0x61, 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, - 0x69, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, - 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x24, - 0x0a, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x09, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x74, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 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, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x07, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, + 0x44, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 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, 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, + 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, + 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, + 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1a, 0x0a, + 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, + 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, + 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, + 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x24, 0x0a, + 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, + 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x74, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 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, 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, + 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, 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, 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, - 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, + 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, + 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, 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, 0xc7, 0x01, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x1c, 0x4c, 0x49, 0x42, 0x52, 0x41, - 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x44, 0x45, 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, + 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, 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, + 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 ( @@ -2542,87 +2612,89 @@ func file_cc_arduino_cli_commands_v1_lib_proto_rawDescGZIP() []byte { return file_cc_arduino_cli_commands_v1_lib_proto_rawDescData } -var file_cc_arduino_cli_commands_v1_lib_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_cc_arduino_cli_commands_v1_lib_proto_enumTypes = make([]protoimpl.EnumInfo, 4) var file_cc_arduino_cli_commands_v1_lib_proto_msgTypes = make([]protoimpl.MessageInfo, 30) var file_cc_arduino_cli_commands_v1_lib_proto_goTypes = []interface{}{ - (LibrarySearchStatus)(0), // 0: cc.arduino.cli.commands.v1.LibrarySearchStatus - (LibraryLayout)(0), // 1: cc.arduino.cli.commands.v1.LibraryLayout - (LibraryLocation)(0), // 2: cc.arduino.cli.commands.v1.LibraryLocation - (*LibraryDownloadRequest)(nil), // 3: cc.arduino.cli.commands.v1.LibraryDownloadRequest - (*LibraryDownloadResponse)(nil), // 4: cc.arduino.cli.commands.v1.LibraryDownloadResponse - (*LibraryInstallRequest)(nil), // 5: cc.arduino.cli.commands.v1.LibraryInstallRequest - (*LibraryInstallResponse)(nil), // 6: cc.arduino.cli.commands.v1.LibraryInstallResponse - (*LibraryUpgradeRequest)(nil), // 7: cc.arduino.cli.commands.v1.LibraryUpgradeRequest - (*LibraryUpgradeResponse)(nil), // 8: cc.arduino.cli.commands.v1.LibraryUpgradeResponse - (*LibraryUninstallRequest)(nil), // 9: cc.arduino.cli.commands.v1.LibraryUninstallRequest - (*LibraryUninstallResponse)(nil), // 10: cc.arduino.cli.commands.v1.LibraryUninstallResponse - (*LibraryUpgradeAllRequest)(nil), // 11: cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest - (*LibraryUpgradeAllResponse)(nil), // 12: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse - (*LibraryResolveDependenciesRequest)(nil), // 13: cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest - (*LibraryResolveDependenciesResponse)(nil), // 14: cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse - (*LibraryDependencyStatus)(nil), // 15: cc.arduino.cli.commands.v1.LibraryDependencyStatus - (*LibrarySearchRequest)(nil), // 16: cc.arduino.cli.commands.v1.LibrarySearchRequest - (*LibrarySearchResponse)(nil), // 17: cc.arduino.cli.commands.v1.LibrarySearchResponse - (*SearchedLibrary)(nil), // 18: cc.arduino.cli.commands.v1.SearchedLibrary - (*LibraryRelease)(nil), // 19: cc.arduino.cli.commands.v1.LibraryRelease - (*LibraryDependency)(nil), // 20: cc.arduino.cli.commands.v1.LibraryDependency - (*DownloadResource)(nil), // 21: cc.arduino.cli.commands.v1.DownloadResource - (*LibraryListRequest)(nil), // 22: cc.arduino.cli.commands.v1.LibraryListRequest - (*LibraryListResponse)(nil), // 23: cc.arduino.cli.commands.v1.LibraryListResponse - (*InstalledLibrary)(nil), // 24: cc.arduino.cli.commands.v1.InstalledLibrary - (*Library)(nil), // 25: cc.arduino.cli.commands.v1.Library - (*ZipLibraryInstallRequest)(nil), // 26: cc.arduino.cli.commands.v1.ZipLibraryInstallRequest - (*ZipLibraryInstallResponse)(nil), // 27: cc.arduino.cli.commands.v1.ZipLibraryInstallResponse - (*GitLibraryInstallRequest)(nil), // 28: cc.arduino.cli.commands.v1.GitLibraryInstallRequest - (*GitLibraryInstallResponse)(nil), // 29: cc.arduino.cli.commands.v1.GitLibraryInstallResponse - nil, // 30: cc.arduino.cli.commands.v1.SearchedLibrary.ReleasesEntry - nil, // 31: cc.arduino.cli.commands.v1.Library.PropertiesEntry - nil, // 32: cc.arduino.cli.commands.v1.Library.CompatibleWithEntry - (*Instance)(nil), // 33: cc.arduino.cli.commands.v1.Instance - (*DownloadProgress)(nil), // 34: cc.arduino.cli.commands.v1.DownloadProgress - (*TaskProgress)(nil), // 35: cc.arduino.cli.commands.v1.TaskProgress + (LibraryInstallLocation)(0), // 0: cc.arduino.cli.commands.v1.LibraryInstallLocation + (LibrarySearchStatus)(0), // 1: cc.arduino.cli.commands.v1.LibrarySearchStatus + (LibraryLayout)(0), // 2: cc.arduino.cli.commands.v1.LibraryLayout + (LibraryLocation)(0), // 3: cc.arduino.cli.commands.v1.LibraryLocation + (*LibraryDownloadRequest)(nil), // 4: cc.arduino.cli.commands.v1.LibraryDownloadRequest + (*LibraryDownloadResponse)(nil), // 5: cc.arduino.cli.commands.v1.LibraryDownloadResponse + (*LibraryInstallRequest)(nil), // 6: cc.arduino.cli.commands.v1.LibraryInstallRequest + (*LibraryInstallResponse)(nil), // 7: cc.arduino.cli.commands.v1.LibraryInstallResponse + (*LibraryUpgradeRequest)(nil), // 8: cc.arduino.cli.commands.v1.LibraryUpgradeRequest + (*LibraryUpgradeResponse)(nil), // 9: cc.arduino.cli.commands.v1.LibraryUpgradeResponse + (*LibraryUninstallRequest)(nil), // 10: cc.arduino.cli.commands.v1.LibraryUninstallRequest + (*LibraryUninstallResponse)(nil), // 11: cc.arduino.cli.commands.v1.LibraryUninstallResponse + (*LibraryUpgradeAllRequest)(nil), // 12: cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest + (*LibraryUpgradeAllResponse)(nil), // 13: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse + (*LibraryResolveDependenciesRequest)(nil), // 14: cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest + (*LibraryResolveDependenciesResponse)(nil), // 15: cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse + (*LibraryDependencyStatus)(nil), // 16: cc.arduino.cli.commands.v1.LibraryDependencyStatus + (*LibrarySearchRequest)(nil), // 17: cc.arduino.cli.commands.v1.LibrarySearchRequest + (*LibrarySearchResponse)(nil), // 18: cc.arduino.cli.commands.v1.LibrarySearchResponse + (*SearchedLibrary)(nil), // 19: cc.arduino.cli.commands.v1.SearchedLibrary + (*LibraryRelease)(nil), // 20: cc.arduino.cli.commands.v1.LibraryRelease + (*LibraryDependency)(nil), // 21: cc.arduino.cli.commands.v1.LibraryDependency + (*DownloadResource)(nil), // 22: cc.arduino.cli.commands.v1.DownloadResource + (*LibraryListRequest)(nil), // 23: cc.arduino.cli.commands.v1.LibraryListRequest + (*LibraryListResponse)(nil), // 24: cc.arduino.cli.commands.v1.LibraryListResponse + (*InstalledLibrary)(nil), // 25: cc.arduino.cli.commands.v1.InstalledLibrary + (*Library)(nil), // 26: cc.arduino.cli.commands.v1.Library + (*ZipLibraryInstallRequest)(nil), // 27: cc.arduino.cli.commands.v1.ZipLibraryInstallRequest + (*ZipLibraryInstallResponse)(nil), // 28: cc.arduino.cli.commands.v1.ZipLibraryInstallResponse + (*GitLibraryInstallRequest)(nil), // 29: cc.arduino.cli.commands.v1.GitLibraryInstallRequest + (*GitLibraryInstallResponse)(nil), // 30: cc.arduino.cli.commands.v1.GitLibraryInstallResponse + nil, // 31: cc.arduino.cli.commands.v1.SearchedLibrary.ReleasesEntry + nil, // 32: cc.arduino.cli.commands.v1.Library.PropertiesEntry + nil, // 33: cc.arduino.cli.commands.v1.Library.CompatibleWithEntry + (*Instance)(nil), // 34: cc.arduino.cli.commands.v1.Instance + (*DownloadProgress)(nil), // 35: cc.arduino.cli.commands.v1.DownloadProgress + (*TaskProgress)(nil), // 36: cc.arduino.cli.commands.v1.TaskProgress } var file_cc_arduino_cli_commands_v1_lib_proto_depIdxs = []int32{ - 33, // 0: cc.arduino.cli.commands.v1.LibraryDownloadRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 34, // 1: cc.arduino.cli.commands.v1.LibraryDownloadResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 33, // 2: cc.arduino.cli.commands.v1.LibraryInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 34, // 3: cc.arduino.cli.commands.v1.LibraryInstallResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 35, // 4: cc.arduino.cli.commands.v1.LibraryInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 33, // 5: cc.arduino.cli.commands.v1.LibraryUpgradeRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 34, // 6: cc.arduino.cli.commands.v1.LibraryUpgradeResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 35, // 7: cc.arduino.cli.commands.v1.LibraryUpgradeResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 33, // 8: cc.arduino.cli.commands.v1.LibraryUninstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 35, // 9: cc.arduino.cli.commands.v1.LibraryUninstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 33, // 10: cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 34, // 11: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 35, // 12: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 33, // 13: cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 15, // 14: cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse.dependencies:type_name -> cc.arduino.cli.commands.v1.LibraryDependencyStatus - 33, // 15: cc.arduino.cli.commands.v1.LibrarySearchRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 18, // 16: cc.arduino.cli.commands.v1.LibrarySearchResponse.libraries:type_name -> cc.arduino.cli.commands.v1.SearchedLibrary - 0, // 17: cc.arduino.cli.commands.v1.LibrarySearchResponse.status:type_name -> cc.arduino.cli.commands.v1.LibrarySearchStatus - 30, // 18: cc.arduino.cli.commands.v1.SearchedLibrary.releases:type_name -> cc.arduino.cli.commands.v1.SearchedLibrary.ReleasesEntry - 19, // 19: cc.arduino.cli.commands.v1.SearchedLibrary.latest:type_name -> cc.arduino.cli.commands.v1.LibraryRelease - 21, // 20: cc.arduino.cli.commands.v1.LibraryRelease.resources:type_name -> cc.arduino.cli.commands.v1.DownloadResource - 20, // 21: cc.arduino.cli.commands.v1.LibraryRelease.dependencies:type_name -> cc.arduino.cli.commands.v1.LibraryDependency - 33, // 22: cc.arduino.cli.commands.v1.LibraryListRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 24, // 23: cc.arduino.cli.commands.v1.LibraryListResponse.installed_libraries:type_name -> cc.arduino.cli.commands.v1.InstalledLibrary - 25, // 24: cc.arduino.cli.commands.v1.InstalledLibrary.library:type_name -> cc.arduino.cli.commands.v1.Library - 19, // 25: cc.arduino.cli.commands.v1.InstalledLibrary.release:type_name -> cc.arduino.cli.commands.v1.LibraryRelease - 31, // 26: cc.arduino.cli.commands.v1.Library.properties:type_name -> cc.arduino.cli.commands.v1.Library.PropertiesEntry - 2, // 27: cc.arduino.cli.commands.v1.Library.location:type_name -> cc.arduino.cli.commands.v1.LibraryLocation - 1, // 28: cc.arduino.cli.commands.v1.Library.layout:type_name -> cc.arduino.cli.commands.v1.LibraryLayout - 32, // 29: cc.arduino.cli.commands.v1.Library.compatible_with:type_name -> cc.arduino.cli.commands.v1.Library.CompatibleWithEntry - 33, // 30: cc.arduino.cli.commands.v1.ZipLibraryInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 35, // 31: cc.arduino.cli.commands.v1.ZipLibraryInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 33, // 32: cc.arduino.cli.commands.v1.GitLibraryInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 35, // 33: cc.arduino.cli.commands.v1.GitLibraryInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 19, // 34: cc.arduino.cli.commands.v1.SearchedLibrary.ReleasesEntry.value:type_name -> cc.arduino.cli.commands.v1.LibraryRelease - 35, // [35:35] is the sub-list for method output_type - 35, // [35:35] is the sub-list for method input_type - 35, // [35:35] is the sub-list for extension type_name - 35, // [35:35] is the sub-list for extension extendee - 0, // [0:35] is the sub-list for field type_name + 34, // 0: cc.arduino.cli.commands.v1.LibraryDownloadRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 35, // 1: cc.arduino.cli.commands.v1.LibraryDownloadResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 34, // 2: cc.arduino.cli.commands.v1.LibraryInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 0, // 3: cc.arduino.cli.commands.v1.LibraryInstallRequest.install_location:type_name -> cc.arduino.cli.commands.v1.LibraryInstallLocation + 35, // 4: cc.arduino.cli.commands.v1.LibraryInstallResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 36, // 5: cc.arduino.cli.commands.v1.LibraryInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 34, // 6: cc.arduino.cli.commands.v1.LibraryUpgradeRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 35, // 7: cc.arduino.cli.commands.v1.LibraryUpgradeResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 36, // 8: cc.arduino.cli.commands.v1.LibraryUpgradeResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 34, // 9: cc.arduino.cli.commands.v1.LibraryUninstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 36, // 10: cc.arduino.cli.commands.v1.LibraryUninstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 34, // 11: cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 35, // 12: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 36, // 13: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 34, // 14: cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 16, // 15: cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse.dependencies:type_name -> cc.arduino.cli.commands.v1.LibraryDependencyStatus + 34, // 16: cc.arduino.cli.commands.v1.LibrarySearchRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 19, // 17: cc.arduino.cli.commands.v1.LibrarySearchResponse.libraries:type_name -> cc.arduino.cli.commands.v1.SearchedLibrary + 1, // 18: cc.arduino.cli.commands.v1.LibrarySearchResponse.status:type_name -> cc.arduino.cli.commands.v1.LibrarySearchStatus + 31, // 19: cc.arduino.cli.commands.v1.SearchedLibrary.releases:type_name -> cc.arduino.cli.commands.v1.SearchedLibrary.ReleasesEntry + 20, // 20: cc.arduino.cli.commands.v1.SearchedLibrary.latest:type_name -> cc.arduino.cli.commands.v1.LibraryRelease + 22, // 21: cc.arduino.cli.commands.v1.LibraryRelease.resources:type_name -> cc.arduino.cli.commands.v1.DownloadResource + 21, // 22: cc.arduino.cli.commands.v1.LibraryRelease.dependencies:type_name -> cc.arduino.cli.commands.v1.LibraryDependency + 34, // 23: cc.arduino.cli.commands.v1.LibraryListRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 25, // 24: cc.arduino.cli.commands.v1.LibraryListResponse.installed_libraries:type_name -> cc.arduino.cli.commands.v1.InstalledLibrary + 26, // 25: cc.arduino.cli.commands.v1.InstalledLibrary.library:type_name -> cc.arduino.cli.commands.v1.Library + 20, // 26: cc.arduino.cli.commands.v1.InstalledLibrary.release:type_name -> cc.arduino.cli.commands.v1.LibraryRelease + 32, // 27: cc.arduino.cli.commands.v1.Library.properties:type_name -> cc.arduino.cli.commands.v1.Library.PropertiesEntry + 3, // 28: cc.arduino.cli.commands.v1.Library.location:type_name -> cc.arduino.cli.commands.v1.LibraryLocation + 2, // 29: cc.arduino.cli.commands.v1.Library.layout:type_name -> cc.arduino.cli.commands.v1.LibraryLayout + 33, // 30: cc.arduino.cli.commands.v1.Library.compatible_with:type_name -> cc.arduino.cli.commands.v1.Library.CompatibleWithEntry + 34, // 31: cc.arduino.cli.commands.v1.ZipLibraryInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 36, // 32: cc.arduino.cli.commands.v1.ZipLibraryInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 34, // 33: cc.arduino.cli.commands.v1.GitLibraryInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 36, // 34: cc.arduino.cli.commands.v1.GitLibraryInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 20, // 35: cc.arduino.cli.commands.v1.SearchedLibrary.ReleasesEntry.value:type_name -> cc.arduino.cli.commands.v1.LibraryRelease + 36, // [36:36] is the sub-list for method output_type + 36, // [36:36] is the sub-list for method input_type + 36, // [36:36] is the sub-list for extension type_name + 36, // [36:36] is the sub-list for extension extendee + 0, // [0:36] is the sub-list for field type_name } func init() { file_cc_arduino_cli_commands_v1_lib_proto_init() } @@ -2962,7 +3034,7 @@ func file_cc_arduino_cli_commands_v1_lib_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cc_arduino_cli_commands_v1_lib_proto_rawDesc, - NumEnums: 3, + NumEnums: 4, NumMessages: 30, NumExtensions: 0, NumServices: 0, diff --git a/rpc/cc/arduino/cli/commands/v1/lib.proto b/rpc/cc/arduino/cli/commands/v1/lib.proto index cae03fcc6cf..c8c6f626b4c 100644 --- a/rpc/cc/arduino/cli/commands/v1/lib.proto +++ b/rpc/cc/arduino/cli/commands/v1/lib.proto @@ -48,6 +48,16 @@ message LibraryInstallRequest { // Set to true to skip installation if a different version of the library or // one of its dependencies is already installed, defaults to false. bool no_overwrite = 5; + // Install the library and dependencies in the specified location + LibraryInstallLocation install_location = 6; +} + +enum LibraryInstallLocation { + // In the `libraries` subdirectory of the user directory (sketchbook). This is + // the default if not specified. + LIBRARY_INSTALL_LOCATION_USER = 0; + // In the configured 'builtin.libraries' directory. + LIBRARY_INSTALL_LOCATION_BUILTIN = 1; } message LibraryInstallResponse { @@ -307,8 +317,8 @@ enum LibraryLayout { } enum LibraryLocation { - // In the `libraries` subdirectory of the Arduino IDE installation. - LIBRARY_LOCATION_IDE_BUILTIN = 0; + // In the configured 'builtin.libraries' directory. + LIBRARY_LOCATION_BUILTIN = 0; // In the `libraries` subdirectory of the user directory (sketchbook). LIBRARY_LOCATION_USER = 1; // In the `libraries` subdirectory of a platform. From bc9c8cbebf598f42ba08bb8d35004ed551ea09b6 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 26 Aug 2022 18:37:44 +0200 Subject: [PATCH 06/13] Added integration test for library install in bundled directory --- .../librariesmanager/librariesmanager.go | 1 + internal/integrationtest/arduino-cli.go | 74 ++++++++-- .../daemon/daemon_lib_install_test.go | 126 ++++++++++++++++++ 3 files changed, 189 insertions(+), 12 deletions(-) create mode 100644 internal/integrationtest/daemon/daemon_lib_install_test.go diff --git a/arduino/libraries/librariesmanager/librariesmanager.go b/arduino/libraries/librariesmanager/librariesmanager.go index 6b201efe536..cacb97a5d0b 100644 --- a/arduino/libraries/librariesmanager/librariesmanager.go +++ b/arduino/libraries/librariesmanager/librariesmanager.go @@ -118,6 +118,7 @@ func NewLibraryManager(indexDir *paths.Path, downloadsDir *paths.Path) *Librarie // LoadIndex reads a library_index.json from a file and returns // the corresponding Index structure. func (lm *LibrariesManager) LoadIndex() error { + logrus.WithField("index", lm.IndexFile).Info("Loading libraries index file") index, err := librariesindex.LoadIndex(lm.IndexFile) if err != nil { lm.Index = librariesindex.EmptyIndex diff --git a/internal/integrationtest/arduino-cli.go b/internal/integrationtest/arduino-cli.go index 157d2f25a49..abaac7e3376 100644 --- a/internal/integrationtest/arduino-cli.go +++ b/internal/integrationtest/arduino-cli.go @@ -18,6 +18,7 @@ package integrationtest import ( "bytes" "context" + "encoding/json" "fmt" "io" "os" @@ -28,6 +29,7 @@ import ( "github.com/arduino/arduino-cli/executils" "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" + "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/settings/v1" "github.com/arduino/go-paths-helper" "github.com/fatih/color" "github.com/stretchr/testify/require" @@ -61,17 +63,18 @@ func CreateArduinoCLIWithEnvironment(t *testing.T) (*testsuite.Environment, *Ard // ArduinoCLI is an Arduino CLI client. type ArduinoCLI struct { - path *paths.Path - t *require.Assertions - proc *executils.Process - cliEnvVars []string - cliConfigPath *paths.Path - stagingDir *paths.Path - dataDir *paths.Path - sketchbookDir *paths.Path - daemonAddr string - daemonConn *grpc.ClientConn - daemonClient commands.ArduinoCoreServiceClient + path *paths.Path + t *require.Assertions + proc *executils.Process + cliEnvVars []string + cliConfigPath *paths.Path + stagingDir *paths.Path + dataDir *paths.Path + sketchbookDir *paths.Path + daemonAddr string + daemonConn *grpc.ClientConn + daemonClient commands.ArduinoCoreServiceClient + daemonSettingsClient settings.SettingsServiceClient } // ArduinoCLIConfig is the configuration of the ArduinoCLI client @@ -196,7 +199,7 @@ func (cli *ArduinoCLI) StartDaemon(verbose bool) string { cli.t.NoError(err) cli.daemonConn = conn cli.daemonClient = commands.NewArduinoCoreServiceClient(conn) - + cli.daemonSettingsClient = settings.NewSettingsServiceClient(conn) return cli.daemonAddr } @@ -226,6 +229,17 @@ func (cli *ArduinoCLI) Create() *ArduinoCLIInstance { } } +// SetValue calls the "SetValue" gRPC method. +func (cli *ArduinoCLI) SetValue(key, jsonData string) error { + req := &settings.SetValueRequest{ + Key: key, + JsonData: jsonData, + } + logCallf(">>> SetValue(%+v)\n", req) + _, err := cli.daemonSettingsClient.SetValue(context.Background(), req) + return err +} + // Init calls the "Init" gRPC method. func (inst *ArduinoCLIInstance) Init(profile string, sketchPath string, respCB func(*commands.InitResponse)) error { initReq := &commands.InitRequest{ @@ -302,3 +316,39 @@ func (inst *ArduinoCLIInstance) Compile(ctx context.Context, fqbn, sketchPath st logCallf(">>> Compile(%v %v)\n", fqbn, sketchPath) return compileCl, err } + +// LibraryList calls the "LibraryList" gRPC method. +func (inst *ArduinoCLIInstance) LibraryList(ctx context.Context, name, fqbn string, all, updatable bool) (*commands.LibraryListResponse, error) { + req := &commands.LibraryListRequest{ + Instance: inst.instance, + Name: name, + Fqbn: fqbn, + All: all, + Updatable: updatable, + } + logCallf(">>> LibraryList(%v) -> ", req) + resp, err := inst.cli.daemonClient.LibraryList(ctx, req) + logCallf("err=%v\n", err) + r, _ := json.MarshalIndent(resp, " ", " ") + logCallf("<<< LibraryList resp: %s\n", string(r)) + return resp, err +} + +// LibraryInstall calls the "LibraryInstall" gRPC method. +func (inst *ArduinoCLIInstance) LibraryInstall(ctx context.Context, name, version string, noDeps, noOverwrite, installAsBundled bool) (commands.ArduinoCoreService_LibraryInstallClient, error) { + installLocation := commands.LibraryInstallLocation_LIBRARY_INSTALL_LOCATION_USER + if installAsBundled { + installLocation = commands.LibraryInstallLocation_LIBRARY_INSTALL_LOCATION_BUILTIN + } + req := &commands.LibraryInstallRequest{ + Instance: inst.instance, + Name: name, + Version: version, + NoDeps: noDeps, + NoOverwrite: noOverwrite, + InstallLocation: installLocation, + } + installCl, err := inst.cli.daemonClient.LibraryInstall(ctx, req) + logCallf(">>> LibraryInstall(%+v)\n", req) + return installCl, err +} diff --git a/internal/integrationtest/daemon/daemon_lib_install_test.go b/internal/integrationtest/daemon/daemon_lib_install_test.go new file mode 100644 index 00000000000..da406769096 --- /dev/null +++ b/internal/integrationtest/daemon/daemon_lib_install_test.go @@ -0,0 +1,126 @@ +// This file is part of arduino-cli. +// +// Copyright 2022 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package daemon_test + +import ( + "context" + "encoding/json" + "fmt" + "io" + "testing" + + "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" + "github.com/stretchr/testify/require" +) + +func TestDaemonBundleLibInstall(t *testing.T) { + env, cli := createEnvForDaemon(t) + defer env.CleanUp() + + grpcInst := cli.Create() + require.NoError(t, grpcInst.Init("", "", func(ir *commands.InitResponse) { + fmt.Printf("INIT> %v\n", ir.GetMessage()) + })) + + // Install libraries in bundled dir (should fail) + { + instCl, err := grpcInst.LibraryInstall(context.Background(), "Arduino_BuiltIn", "", false, false, true) + require.NoError(t, err) + for { + msg, err := instCl.Recv() + if err == io.EOF { + require.FailNow(t, "LibraryInstall is supposed to fail because builtin libraries directory is not set") + } + if err != nil { + fmt.Println("LIB INSTALL ERROR:", err) + break + } + fmt.Printf("LIB INSTALL> %+v\n", msg) + } + } + + // Set builtin libraries dir + builtinLibsDir := cli.DataDir().Join("libraries") + jsonBuiltinLibsDir, err := json.Marshal(builtinLibsDir) + require.NoError(t, err) + err = cli.SetValue("directories.builtin.libraries", string(jsonBuiltinLibsDir)) + require.NoError(t, err) + + // Re-init + require.NoError(t, grpcInst.Init("", "", func(ir *commands.InitResponse) { + fmt.Printf("INIT> %v\n", ir.GetMessage()) + })) + + // Install libraries in bundled dir + { + instCl, err := grpcInst.LibraryInstall(context.Background(), "Arduino_BuiltIn", "", false, false, true) + require.NoError(t, err) + for { + msg, err := instCl.Recv() + if err == io.EOF { + break + } + require.NoError(t, err) + fmt.Printf("LIB INSTALL> %+v\n", msg) + } + } + + // Check if libraries are installed as expected + { + resp, err := grpcInst.LibraryList(context.Background(), "", "", true, false) + require.NoError(t, err) + libsAndLocation := map[string]commands.LibraryLocation{} + for _, lib := range resp.GetInstalledLibraries() { + libsAndLocation[lib.Library.Name] = lib.Library.Location + } + require.Contains(t, libsAndLocation, "Ethernet") + require.Contains(t, libsAndLocation, "SD") + require.Contains(t, libsAndLocation, "Firmata") + require.Equal(t, libsAndLocation["Ethernet"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) + require.Equal(t, libsAndLocation["SD"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) + require.Equal(t, libsAndLocation["Firmata"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) + } + + // Install a library in sketchbook to override bundled + { + instCl, err := grpcInst.LibraryInstall(context.Background(), "Ethernet", "", false, false, false) + require.NoError(t, err) + for { + msg, err := instCl.Recv() + if err == io.EOF { + break + } + require.NoError(t, err) + fmt.Printf("LIB INSTALL> %+v\n", msg) + } + } + + // Check if libraries are installed as expected + { + resp, err := grpcInst.LibraryList(context.Background(), "", "", true, false) + require.NoError(t, err) + libsAndLocation := map[string]commands.LibraryLocation{} + for _, lib := range resp.GetInstalledLibraries() { + libsAndLocation[lib.Library.Name] = lib.Library.Location + } + require.Contains(t, libsAndLocation, "Ethernet") + require.Contains(t, libsAndLocation, "SD") + require.Contains(t, libsAndLocation, "Firmata") + require.Equal(t, libsAndLocation["Ethernet"], commands.LibraryLocation_LIBRARY_LOCATION_USER) + require.Equal(t, libsAndLocation["SD"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) + require.Equal(t, libsAndLocation["Firmata"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) + } +} From 1bcfd732a1f98b54c59c35edfc4939debf502a82 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Sat, 27 Aug 2022 13:17:15 +0200 Subject: [PATCH 07/13] Fixed nil pointer exception in build options extraction --- legacy/builder/libraries_loader.go | 8 ++- .../test/create_build_options_map_test.go | 1 - legacy/builder/types/context.go | 4 +- legacy/builder/types/context_test.go | 61 +++++++++++++++++++ 4 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 legacy/builder/types/context_test.go diff --git a/legacy/builder/libraries_loader.go b/legacy/builder/libraries_loader.go index 8ca114a8a2a..b7e7792adc5 100644 --- a/legacy/builder/libraries_loader.go +++ b/legacy/builder/libraries_loader.go @@ -36,10 +36,12 @@ func (s *LibrariesLoader) Run(ctx *types.Context) error { ctx.LibrariesManager = lm builtInLibrariesFolders := ctx.BuiltInLibrariesDirs - if err := builtInLibrariesFolders.ToAbs(); err != nil { - return errors.WithStack(err) + if builtInLibrariesFolders != nil { + if err := builtInLibrariesFolders.ToAbs(); err != nil { + return errors.WithStack(err) + } + lm.AddLibrariesDir(builtInLibrariesFolders, libraries.IDEBuiltIn) } - lm.AddLibrariesDir(builtInLibrariesFolders, libraries.IDEBuiltIn) if ctx.ActualPlatform != ctx.TargetPlatform { lm.AddPlatformReleaseLibrariesDir(ctx.ActualPlatform, libraries.ReferencedPlatformBuiltIn) diff --git a/legacy/builder/test/create_build_options_map_test.go b/legacy/builder/test/create_build_options_map_test.go index 9cc72379d14..966d86a7205 100644 --- a/legacy/builder/test/create_build_options_map_test.go +++ b/legacy/builder/test/create_build_options_map_test.go @@ -43,7 +43,6 @@ func TestCreateBuildOptionsMap(t *testing.T) { require.Equal(t, `{ "additionalFiles": "", - "builtInLibrariesFolders": "", "builtInToolsFolders": "tools", "compiler.optimization_flags": "-Os", "customBuildProperties": "", diff --git a/legacy/builder/types/context.go b/legacy/builder/types/context.go index a0ad62115de..980f1f410cc 100644 --- a/legacy/builder/types/context.go +++ b/legacy/builder/types/context.go @@ -208,7 +208,9 @@ func (ctx *Context) ExtractBuildOptions() *properties.Map { opts := properties.NewMap() opts.Set("hardwareFolders", strings.Join(ctx.HardwareDirs.AsStrings(), ",")) opts.Set("builtInToolsFolders", strings.Join(ctx.BuiltInToolsDirs.AsStrings(), ",")) - opts.Set("builtInLibrariesFolders", ctx.BuiltInLibrariesDirs.String()) + if ctx.BuiltInLibrariesDirs != nil { + opts.Set("builtInLibrariesFolders", ctx.BuiltInLibrariesDirs.String()) + } opts.Set("otherLibrariesFolders", strings.Join(ctx.OtherLibrariesDirs.AsStrings(), ",")) opts.SetPath("sketchLocation", ctx.SketchLocation) var additionalFilesRelative []string diff --git a/legacy/builder/types/context_test.go b/legacy/builder/types/context_test.go new file mode 100644 index 00000000000..c10ea71dc33 --- /dev/null +++ b/legacy/builder/types/context_test.go @@ -0,0 +1,61 @@ +// This file is part of arduino-cli. +// +// Copyright 2022 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package types + +import ( + "testing" + + "github.com/arduino/arduino-cli/arduino/cores" + paths "github.com/arduino/go-paths-helper" + "github.com/stretchr/testify/require" +) + +func TestInjectBuildOption(t *testing.T) { + fqbn, err := cores.ParseFQBN("aaa:bbb:ccc") + require.NoError(t, err) + + { + ctx := &Context{ + HardwareDirs: paths.NewPathList("aaa", "bbb"), + BuiltInToolsDirs: paths.NewPathList("ccc", "ddd"), + BuiltInLibrariesDirs: paths.New("eee"), + OtherLibrariesDirs: paths.NewPathList("fff", "ggg"), + SketchLocation: paths.New("hhh"), + FQBN: fqbn, + ArduinoAPIVersion: "iii", + CustomBuildProperties: []string{"jjj", "kkk"}, + OptimizationFlags: "lll", + } + newCtx := &Context{} + newCtx.InjectBuildOptions(ctx.ExtractBuildOptions()) + require.Equal(t, ctx, newCtx) + } + { + ctx := &Context{ + HardwareDirs: paths.NewPathList("aaa", "bbb"), + BuiltInToolsDirs: paths.NewPathList("ccc", "ddd"), + OtherLibrariesDirs: paths.NewPathList("fff", "ggg"), + SketchLocation: paths.New("hhh"), + FQBN: fqbn, + ArduinoAPIVersion: "iii", + CustomBuildProperties: []string{"jjj", "kkk"}, + OptimizationFlags: "lll", + } + newCtx := &Context{} + newCtx.InjectBuildOptions(ctx.ExtractBuildOptions()) + require.Equal(t, ctx, newCtx) + } +} From a4c87f470d655d44e56244e205e6ce5474f04224 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 27 Jul 2022 18:31:20 +0200 Subject: [PATCH 08/13] Updated docs --- docs/UPGRADING.md | 28 ++++++++++++++++++++++++++++ docs/configuration.md | 5 +++++ docs/sketch-build-process.md | 5 ++--- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 37eaddfa47d..1395139d3db 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -266,6 +266,34 @@ must be changed to: eventsChan, closeWatcher, err := board.Watch(req) ``` +### Removed detection of Arduino IDE bundling + +Arduino CLI does not check anymore if it's bundled with the Arduino IDE. Previously this check allowed the Arduino CLI +to automatically use the libraries and tools bundled in the Arduino IDE, now this is not supported anymore unless the +configuration keys `directories.builtin.libraries` and `directories.builtin.tools` are set. + +### gRPC enumeration renamed enum value in `cc.arduino.cli.commands.v1.LibraryLocation` + +`LIBRARY_LOCATION_IDE_BUILTIN` has been renamed to `LIBRARY_LOCATION_BUILTIN` + +### go-lang API change in `LibraryManager` + +```go +func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release) (*paths.Path, *libraries.Library, error) { ... } +func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path) error { ... ] +``` + +```go +func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release, installLocation libraries.LibraryLocation) (*paths.Path, *libraries.Library, error) { ... } +func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path, installLocation libraries.LibraryLocation) error { ... ] +``` + +### go-lang functions changes in `github.com/arduino/arduino-cli/configuration` + +- `github.com/arduino/arduino-cli/configuration.IsBundledInDesktopIDE` function has been removed. +- `github.com/arduino/arduino-cli/configuration.BundleToolsDirectories` has been renamed to `BuiltinToolsDirectories` +- `github.com/arduino/arduino-cli/configuration.IDEBundledLibrariesDir` has been renamed to `IDEBuiltinLibrariesDir` + ## 0.26.0 ### `github.com/arduino/arduino-cli/commands.DownloadToolRelease`, and `InstallToolRelease` functions have been removed diff --git a/docs/configuration.md b/docs/configuration.md index 9072035dde9..0762d84fb2d 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -9,6 +9,11 @@ - `downloads` - directory used to stage downloaded archives during Boards/Library Manager installations. - `user` - the equivalent of the Arduino IDE's ["sketchbook" directory][sketchbook directory]. Library Manager installations are made to the `libraries` subdirectory of the user directory. + - `builtin.libraries` - the libraries in this directory will be available to all platforms without the need for the + user to install them, but with the lowest priority over other installed libraries with the same name, it's the + equivalent of the Arduino IDE's bundled libraries directory. + - `builtin.tools` - it's a list of directories of tools that will be available to all platforms without the need for + the user to install them, it's the equivalent of the Arduino IDE's bundled tools directory. - `library` - configuration options relating to Arduino libraries. - `enable_unsafe_install` - set to `true` to enable the use of the `--git-url` and `--zip-file` flags with [`arduino-cli lib install`][arduino cli lib install]. These are considered "unsafe" installation methods because diff --git a/docs/sketch-build-process.md b/docs/sketch-build-process.md index ccf3cecbaef..a533f631fb5 100644 --- a/docs/sketch-build-process.md +++ b/docs/sketch-build-process.md @@ -130,9 +130,8 @@ The "location priority" is determined as follows (in order of highest to lowest ([`{runtime.platform.path}/libraries`](platform-specification.md#global-predefined-properties)) 1. The library is bundled with the [referenced](platform-specification.md#referencing-another-core-variant-or-tool) board platform/core -1. The library is bundled with the Arduino IDE - ([`{runtime.ide.path}/libraries`](platform-specification.md#global-predefined-properties)) - - This location is only used by Arduino CLI when it's located in the Arduino IDE installation folder +1. The library is bundled with the Arduino IDE (this location is determined by the Arduino CLI configuration setting + `directories.builtin.libraries`) #### Location priorities in Arduino Web Editor From 00f214a17d13bbd4a9fab52d1b446caf9ab76cf7 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 31 Aug 2022 14:07:43 +0200 Subject: [PATCH 09/13] Removed useless custom env bindings --- configuration/defaults.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/configuration/defaults.go b/configuration/defaults.go index 779bd654d05..323eb65203b 100644 --- a/configuration/defaults.go +++ b/configuration/defaults.go @@ -65,7 +65,5 @@ func SetDefaults(settings *viper.Viper) { settings.BindEnv("directories.User", "ARDUINO_SKETCHBOOK_DIR") settings.BindEnv("directories.Downloads", "ARDUINO_DOWNLOADS_DIR") settings.BindEnv("directories.Data", "ARDUINO_DATA_DIR") - settings.BindEnv("directories.builtin.tools", "ARDUINO_BUILTIN_TOOLS_DIR") - settings.BindEnv("directories.builtin.libraires", "ARDUINO_BUILTIN_LIBRARIES_DIR") settings.BindEnv("sketch.always_export_binaries", "ARDUINO_SKETCH_ALWAYS_EXPORT_BINARIES") } From aaea3be40cde1f51ca28bf451efc60c0ce9d94ab Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 31 Aug 2022 14:08:44 +0200 Subject: [PATCH 10/13] Applied code review changes Co-authored-by: per1234 --- docs/UPGRADING.md | 6 +++--- docs/configuration.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 1395139d3db..32aec06c2ac 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -268,9 +268,9 @@ must be changed to: ### Removed detection of Arduino IDE bundling -Arduino CLI does not check anymore if it's bundled with the Arduino IDE. Previously this check allowed the Arduino CLI -to automatically use the libraries and tools bundled in the Arduino IDE, now this is not supported anymore unless the -configuration keys `directories.builtin.libraries` and `directories.builtin.tools` are set. +Arduino CLI does not check anymore if it's bundled with the Arduino IDE 1.x. Previously this check allowed the Arduino +CLI to automatically use the libraries and tools bundled in the Arduino IDE, now this is not supported anymore unless +the configuration keys `directories.builtin.libraries` and `directories.builtin.tools` are set. ### gRPC enumeration renamed enum value in `cc.arduino.cli.commands.v1.LibraryLocation` diff --git a/docs/configuration.md b/docs/configuration.md index 0762d84fb2d..ec1c035218f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -13,7 +13,7 @@ user to install them, but with the lowest priority over other installed libraries with the same name, it's the equivalent of the Arduino IDE's bundled libraries directory. - `builtin.tools` - it's a list of directories of tools that will be available to all platforms without the need for - the user to install them, it's the equivalent of the Arduino IDE's bundled tools directory. + the user to install them, it's the equivalent of the Arduino IDE 1.x bundled tools directory. - `library` - configuration options relating to Arduino libraries. - `enable_unsafe_install` - set to `true` to enable the use of the `--git-url` and `--zip-file` flags with [`arduino-cli lib install`][arduino cli lib install]. These are considered "unsafe" installation methods because From 3c19b77c4fcca98d39e68ee85b9ce209ed089204 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 31 Aug 2022 14:37:49 +0200 Subject: [PATCH 11/13] Set builtin libraries dir by default when running as a daemon --- cli/daemon/daemon.go | 3 + configuration/configuration.go | 5 ++ .../daemon/daemon_lib_install_test.go | 56 +++++++++---------- 3 files changed, 34 insertions(+), 30 deletions(-) diff --git a/cli/daemon/daemon.go b/cli/daemon/daemon.go index f5ff279528e..26edfac21e9 100644 --- a/cli/daemon/daemon.go +++ b/cli/daemon/daemon.go @@ -72,6 +72,9 @@ func NewCommand() *cobra.Command { func runDaemonCommand(cmd *cobra.Command, args []string) { logrus.Info("Executing `arduino-cli daemon`") + // Bundled libraries support is enabled by default when running as a daemon + configuration.Settings.SetDefault("directories.builtin.Libraries", configuration.GetDefaultBuiltinLibrariesDir()) + port := configuration.Settings.GetString("daemon.port") gRPCOptions := []grpc.ServerOption{} if debugFile != "" { diff --git a/configuration/configuration.go b/configuration/configuration.go index f781955b8ba..3b22e0eb3c6 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -131,6 +131,11 @@ func getDefaultUserDir() string { } } +// GetDefaultBuiltinLibrariesDir returns the full path to the default builtin libraries dir +func GetDefaultBuiltinLibrariesDir() string { + return filepath.Join(getDefaultArduinoDataDir(), "libraries") +} + // FindConfigFileInArgsOrWorkingDirectory returns the config file path using the // argument '--config-file' (if specified) or looking in the current working dir func FindConfigFileInArgsOrWorkingDirectory(args []string) string { diff --git a/internal/integrationtest/daemon/daemon_lib_install_test.go b/internal/integrationtest/daemon/daemon_lib_install_test.go index da406769096..0cf4a4174f4 100644 --- a/internal/integrationtest/daemon/daemon_lib_install_test.go +++ b/internal/integrationtest/daemon/daemon_lib_install_test.go @@ -17,7 +17,6 @@ package daemon_test import ( "context" - "encoding/json" "fmt" "io" "testing" @@ -35,35 +34,6 @@ func TestDaemonBundleLibInstall(t *testing.T) { fmt.Printf("INIT> %v\n", ir.GetMessage()) })) - // Install libraries in bundled dir (should fail) - { - instCl, err := grpcInst.LibraryInstall(context.Background(), "Arduino_BuiltIn", "", false, false, true) - require.NoError(t, err) - for { - msg, err := instCl.Recv() - if err == io.EOF { - require.FailNow(t, "LibraryInstall is supposed to fail because builtin libraries directory is not set") - } - if err != nil { - fmt.Println("LIB INSTALL ERROR:", err) - break - } - fmt.Printf("LIB INSTALL> %+v\n", msg) - } - } - - // Set builtin libraries dir - builtinLibsDir := cli.DataDir().Join("libraries") - jsonBuiltinLibsDir, err := json.Marshal(builtinLibsDir) - require.NoError(t, err) - err = cli.SetValue("directories.builtin.libraries", string(jsonBuiltinLibsDir)) - require.NoError(t, err) - - // Re-init - require.NoError(t, grpcInst.Init("", "", func(ir *commands.InitResponse) { - fmt.Printf("INIT> %v\n", ir.GetMessage()) - })) - // Install libraries in bundled dir { instCl, err := grpcInst.LibraryInstall(context.Background(), "Arduino_BuiltIn", "", false, false, true) @@ -123,4 +93,30 @@ func TestDaemonBundleLibInstall(t *testing.T) { require.Equal(t, libsAndLocation["SD"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) require.Equal(t, libsAndLocation["Firmata"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) } + + // Un-Set builtin libraries dir + err := cli.SetValue("directories.builtin.libraries", `""`) + require.NoError(t, err) + + // Re-init + require.NoError(t, grpcInst.Init("", "", func(ir *commands.InitResponse) { + fmt.Printf("INIT> %v\n", ir.GetMessage()) + })) + + // Install libraries in bundled dir (should now fail) + { + instCl, err := grpcInst.LibraryInstall(context.Background(), "Arduino_BuiltIn", "", false, false, true) + require.NoError(t, err) + for { + msg, err := instCl.Recv() + if err == io.EOF { + require.FailNow(t, "LibraryInstall is supposed to fail because builtin libraries directory is not set") + } + if err != nil { + fmt.Println("LIB INSTALL ERROR:", err) + break + } + fmt.Printf("LIB INSTALL> %+v\n", msg) + } + } } From be777ad61b42a094382b09926345f18a21e79069 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 1 Sep 2022 17:33:08 +0200 Subject: [PATCH 12/13] Added test for regression See https://github.com/arduino/arduino-cli/pull/1817#pullrequestreview-1092021620 --- internal/integrationtest/arduino-cli.go | 12 +++++++ .../daemon/daemon_lib_install_test.go | 34 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/internal/integrationtest/arduino-cli.go b/internal/integrationtest/arduino-cli.go index abaac7e3376..396ae7157b4 100644 --- a/internal/integrationtest/arduino-cli.go +++ b/internal/integrationtest/arduino-cli.go @@ -352,3 +352,15 @@ func (inst *ArduinoCLIInstance) LibraryInstall(ctx context.Context, name, versio logCallf(">>> LibraryInstall(%+v)\n", req) return installCl, err } + +// LibraryUninstall calls the "LibraryUninstall" gRPC method. +func (inst *ArduinoCLIInstance) LibraryUninstall(ctx context.Context, name, version string) (commands.ArduinoCoreService_LibraryUninstallClient, error) { + req := &commands.LibraryUninstallRequest{ + Instance: inst.instance, + Name: name, + Version: version, + } + installCl, err := inst.cli.daemonClient.LibraryUninstall(ctx, req) + logCallf(">>> LibraryUninstall(%+v)\n", req) + return installCl, err +} diff --git a/internal/integrationtest/daemon/daemon_lib_install_test.go b/internal/integrationtest/daemon/daemon_lib_install_test.go index 0cf4a4174f4..b4ff76f2218 100644 --- a/internal/integrationtest/daemon/daemon_lib_install_test.go +++ b/internal/integrationtest/daemon/daemon_lib_install_test.go @@ -79,12 +79,16 @@ func TestDaemonBundleLibInstall(t *testing.T) { } // Check if libraries are installed as expected + installedEthernetVersion := "" { resp, err := grpcInst.LibraryList(context.Background(), "", "", true, false) require.NoError(t, err) libsAndLocation := map[string]commands.LibraryLocation{} for _, lib := range resp.GetInstalledLibraries() { libsAndLocation[lib.Library.Name] = lib.Library.Location + if lib.Library.Name == "Ethernet" { + installedEthernetVersion = lib.Library.Version + } } require.Contains(t, libsAndLocation, "Ethernet") require.Contains(t, libsAndLocation, "SD") @@ -94,6 +98,36 @@ func TestDaemonBundleLibInstall(t *testing.T) { require.Equal(t, libsAndLocation["Firmata"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) } + // Remove library from sketchbook + { + uninstCl, err := grpcInst.LibraryUninstall(context.Background(), "Ethernet", installedEthernetVersion) + require.NoError(t, err) + for { + msg, err := uninstCl.Recv() + if err == io.EOF { + break + } + require.NoError(t, err) + fmt.Printf("LIB INSTALL> %+v\n", msg) + } + } + + // Check if libraries are installed as expected + { + resp, err := grpcInst.LibraryList(context.Background(), "", "", true, false) + require.NoError(t, err) + libsAndLocation := map[string]commands.LibraryLocation{} + for _, lib := range resp.GetInstalledLibraries() { + libsAndLocation[lib.Library.Name] = lib.Library.Location + } + require.Contains(t, libsAndLocation, "Ethernet") + require.Contains(t, libsAndLocation, "SD") + require.Contains(t, libsAndLocation, "Firmata") + require.Equal(t, libsAndLocation["Ethernet"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) + require.Equal(t, libsAndLocation["SD"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) + require.Equal(t, libsAndLocation["Firmata"], commands.LibraryLocation_LIBRARY_LOCATION_BUILTIN) + } + // Un-Set builtin libraries dir err := cli.SetValue("directories.builtin.libraries", `""`) require.NoError(t, err) From ad98097a51dda1a196d8c25e483e0710ff58172b Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 1 Sep 2022 17:37:13 +0200 Subject: [PATCH 13/13] Fixed regression: 'lib uninstall' must operate only on user dir --- .../libraries/librariesmanager/librariesmanager.go | 10 +++++----- commands/lib/uninstall.go | 3 ++- docs/UPGRADING.md | 11 +++++++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/arduino/libraries/librariesmanager/librariesmanager.go b/arduino/libraries/librariesmanager/librariesmanager.go index cacb97a5d0b..fdb98fe3473 100644 --- a/arduino/libraries/librariesmanager/librariesmanager.go +++ b/arduino/libraries/librariesmanager/librariesmanager.go @@ -78,9 +78,9 @@ func (alts *LibraryAlternatives) Remove(library *libraries.Library) { } // FindVersion returns the library mathching the provided version or nil if not found -func (alts *LibraryAlternatives) FindVersion(version *semver.Version) *libraries.Library { +func (alts *LibraryAlternatives) FindVersion(version *semver.Version, installLocation libraries.LibraryLocation) *libraries.Library { for _, lib := range alts.Alternatives { - if lib.Version.Equal(version) { + if lib.Version.Equal(version) && lib.Location == installLocation { return lib } } @@ -245,7 +245,7 @@ func (lm *LibrariesManager) LoadLibraryFromDir(libRootDir *paths.Path, location // 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) *libraries.Library { +func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference, installLocation libraries.LibraryLocation) *libraries.Library { saneName := utils.SanitizeName(libRef.Name) alternatives, have := lm.Libraries[saneName] if !have { @@ -254,11 +254,11 @@ func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference) *l // TODO: Move "search into user" into another method... if libRef.Version == nil { for _, candidate := range alternatives.Alternatives { - if candidate.Location == libraries.User { + if candidate.Location == installLocation { return candidate } } return nil } - return alternatives.FindVersion(libRef.Version) + return alternatives.FindVersion(libRef.Version, installLocation) } diff --git a/commands/lib/uninstall.go b/commands/lib/uninstall.go index c92e1da62bd..f265940b47c 100644 --- a/commands/lib/uninstall.go +++ b/commands/lib/uninstall.go @@ -19,6 +19,7 @@ import ( "context" "github.com/arduino/arduino-cli/arduino" + "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" ) @@ -31,7 +32,7 @@ func LibraryUninstall(ctx context.Context, req *rpc.LibraryUninstallRequest, tas return &arduino.InvalidLibraryError{Cause: err} } - lib := lm.FindByReference(ref) + lib := lm.FindByReference(ref, libraries.User) if lib == nil { taskCB(&rpc.TaskProgress{Message: tr("Library %s is not installed", req.Name), Completed: true}) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 32aec06c2ac..5218d449303 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -278,16 +278,27 @@ the configuration keys `directories.builtin.libraries` and `directories.builtin. ### go-lang API change in `LibraryManager` +The following methods: + ```go func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release) (*paths.Path, *libraries.Library, error) { ... } func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path) error { ... ] +func (alts *LibraryAlternatives) FindVersion(version *semver.Version, installLocation libraries.LibraryLocation) *libraries.Library { ... } +func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference) *libraries.Library { ... } ``` +now requires a new parameter `LibraryLocation`: + ```go func (lm *LibrariesManager) InstallPrerequisiteCheck(indexLibrary *librariesindex.Release, installLocation libraries.LibraryLocation) (*paths.Path, *libraries.Library, error) { ... } func (lm *LibrariesManager) Install(indexLibrary *librariesindex.Release, libPath *paths.Path, installLocation libraries.LibraryLocation) error { ... ] +func (alts *LibraryAlternatives) FindVersion(version *semver.Version, installLocation libraries.LibraryLocation) *libraries.Library { ... } ++func (lm *LibrariesManager) FindByReference(libRef *librariesindex.Reference, installLocation libraries.LibraryLocation) *libraries.Library { ... } ``` +If you're not interested in specifying the `LibraryLocation` you can use `libraries.User` to refer to the user +directory. + ### go-lang functions changes in `github.com/arduino/arduino-cli/configuration` - `github.com/arduino/arduino-cli/configuration.IsBundledInDesktopIDE` function has been removed.