From a0b6fad637319544aec5ee2e5b113b1481fb8315 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 13 Mar 2025 10:09:29 +0100 Subject: [PATCH] fix(tvix): add clap group id for each struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cl/13156 did move the castore-specific URLs into their own struct, having the store one include the castore-specific struct (flattened). However, both structs had the same name, so using these structs causes clap to panic at runtime, as two groups with the same id were present. Fix this, by adding names to (all) structs. Reported-By: Domen Kožar Change-Id: I34064f7fb2fbbc19d836e1486ad84b52548d2ee1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/13247 Tested-by: BuildkiteCI Reviewed-by: Domen Kožar Reviewed-by: Marijan Petričević Autosubmit: flokli --- tvix/castore/src/utils.rs | 3 +++ tvix/store/src/utils.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/tvix/castore/src/utils.rs b/tvix/castore/src/utils.rs index 381f72cbe..4fc605e84 100644 --- a/tvix/castore/src/utils.rs +++ b/tvix/castore/src/utils.rs @@ -23,6 +23,7 @@ pub struct CompositionConfigs { /// This particular variant has defaults tailored for usecases accessing data /// directly locally, like the `tvix-store daemon` command. #[derive(clap::Parser, Clone)] +#[group(id = "CastoreServiceUrls")] pub struct ServiceUrls { #[arg( long, @@ -51,6 +52,7 @@ pub struct ServiceUrls { /// This particular variant has defaults tailored for usecases accessing data /// from another running tvix daemon, via gRPC. #[derive(clap::Parser, Clone)] +#[group(id = "CastoreServiceUrlsGrpc")] pub struct ServiceUrlsGrpc { #[arg(long, env, default_value = "grpc+http://[::1]:8000")] blob_service_addr: String, @@ -71,6 +73,7 @@ pub struct ServiceUrlsGrpc { /// there yet, and using something else here might make some perf output harder /// to interpret. #[derive(clap::Parser, Clone)] +#[group(id = "CastoreServiceUrlsMemory")] pub struct ServiceUrlsMemory { #[arg(long, env, default_value = "memory://")] blob_service_addr: String, diff --git a/tvix/store/src/utils.rs b/tvix/store/src/utils.rs index 22ec48068..6992da253 100644 --- a/tvix/store/src/utils.rs +++ b/tvix/store/src/utils.rs @@ -36,6 +36,7 @@ pub struct CompositionConfigs { /// This particular variant has defaults tailored for usecases accessing data /// directly locally, like the `tvix-store daemon` command. #[derive(clap::Parser, Clone)] +#[group(id = "StoreServiceUrls")] pub struct ServiceUrls { #[clap(flatten)] castore_service_addrs: castore_utils::ServiceUrls, @@ -56,6 +57,7 @@ pub struct ServiceUrls { /// This particular variant has defaults tailored for usecases accessing data /// from another running tvix daemon, via gRPC. #[derive(clap::Parser, Clone)] +#[group(id = "StoreServiceUrlsGrpc")] pub struct ServiceUrlsGrpc { #[clap(flatten)] castore_service_addrs: castore_utils::ServiceUrlsGrpc, @@ -76,6 +78,7 @@ pub struct ServiceUrlsGrpc { /// there yet, and using something else here might make some perf output harder /// to interpret. #[derive(clap::Parser, Clone)] +#[group(id = "StoreServiceUrlsMemory")] pub struct ServiceUrlsMemory { #[clap(flatten)] castore_service_addrs: castore_utils::ServiceUrlsMemory,