aboutsummaryrefslogtreecommitdiff
path: root/src/garage
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-09-07 17:05:21 +0200
committerAlex Auvolat <alex@adnab.me>2022-09-07 17:05:21 +0200
commit28d86e76021bed674ca78684b9522cfb664a8ae2 (patch)
tree2e264c8e12c3ee85fcd290338dc39175bbda4b8f /src/garage
parentdb61f41030678c5756c844c8aa41a210c658769e (diff)
downloadgarage-28d86e76021bed674ca78684b9522cfb664a8ae2.tar.gz
garage-28d86e76021bed674ca78684b9522cfb664a8ae2.zip
Report build features in garage --help
Diffstat (limited to 'src/garage')
-rw-r--r--src/garage/admin.rs5
-rw-r--r--src/garage/main.rs36
2 files changed, 37 insertions, 4 deletions
diff --git a/src/garage/admin.rs b/src/garage/admin.rs
index f4c182fe..8854a58d 100644
--- a/src/garage/admin.rs
+++ b/src/garage/admin.rs
@@ -739,8 +739,11 @@ impl AdminRpcHandler {
let mut ret = String::new();
writeln!(
&mut ret,
- "\nGarage version: {}",
+ "\nGarage version: {} [features: {}]",
garage_model::version::garage_version(),
+ garage_model::version::garage_features()
+ .map(|list| list.join(", "))
+ .unwrap_or_else(|| "(unknown)".into()),
)
.unwrap();
writeln!(&mut ret, "\nDatabase engine: {}", self.garage.db.engine()).unwrap();
diff --git a/src/garage/main.rs b/src/garage/main.rs
index 94c9bf61..7d00811a 100644
--- a/src/garage/main.rs
+++ b/src/garage/main.rs
@@ -25,13 +25,15 @@ use garage_rpc::system::*;
use garage_rpc::*;
use garage_model::helper::error::Error as HelperError;
-use garage_model::version::garage_version;
use admin::*;
use cli::*;
#[derive(StructOpt, Debug)]
-#[structopt(name = "garage", version = garage_version(), about = "S3-compatible object store for self-hosted geo-distributed deployments")]
+#[structopt(
+ name = "garage",
+ about = "S3-compatible object store for self-hosted geo-distributed deployments"
+)]
struct Opt {
/// Host to connect to for admin operations, in the format:
/// <public-key>@<ip>:<port>
@@ -69,7 +71,35 @@ async fn main() {
std::process::abort();
}));
- let opt = Opt::from_args();
+ // Parse opt
+ let features = &[
+ #[cfg(feature = "k2v")]
+ "k2v",
+ #[cfg(feature = "sled")]
+ "sled",
+ #[cfg(feature = "lmdb")]
+ "lmdb",
+ #[cfg(feature = "sqlite")]
+ "sqlite",
+ #[cfg(feature = "kubernetes-discovery")]
+ "kubernetes-discovery",
+ #[cfg(feature = "metrics")]
+ "metrics",
+ #[cfg(feature = "telemetry-otlp")]
+ "telemetry-otlp",
+ #[cfg(feature = "bundled-libs")]
+ "bundled-libs",
+ #[cfg(feature = "system-libs")]
+ "system-libs",
+ ][..];
+ let version = format!(
+ "{} [features: {}]",
+ garage_model::version::garage_version(),
+ features.join(", ")
+ );
+ garage_model::version::init_features(features);
+ let opt = Opt::from_clap(&Opt::clap().version(version.as_str()).get_matches());
+
let res = match opt.cmd {
Command::Server => server::run_server(opt.config_file).await,
Command::OfflineRepair(repair_opt) => {