From 003542c0fa6da55d5fd4a5d76ad8d6a8c235f48c Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 13 Jun 2025 12:57:54 +0200 Subject: [PATCH] Add `build` feature to `dora-core` to make `git2` dependency optional We don't want to include it for e.g. the `dora-node-api-c`. --- binaries/daemon/Cargo.toml | 2 +- libraries/core/Cargo.toml | 7 +++++-- libraries/core/src/lib.rs | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/binaries/daemon/Cargo.toml b/binaries/daemon/Cargo.toml index 04043b2f..423dba86 100644 --- a/binaries/daemon/Cargo.toml +++ b/binaries/daemon/Cargo.toml @@ -24,7 +24,7 @@ tracing = "0.1.36" tracing-opentelemetry = { version = "0.18.0", optional = true } futures-concurrency = "7.1.0" serde_json = "1.0.86" -dora-core = { workspace = true } +dora-core = { workspace = true, features = ["build"] } flume = "0.10.14" dora-download = { workspace = true } dora-tracing = { workspace = true, optional = true } diff --git a/libraries/core/Cargo.toml b/libraries/core/Cargo.toml index d50765ef..11450c29 100644 --- a/libraries/core/Cargo.toml +++ b/libraries/core/Cargo.toml @@ -9,6 +9,9 @@ repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[features] +build = ["dep:git2", "dep:url"] + [dependencies] dora-message = { workspace = true } eyre = "0.6.8" @@ -24,6 +27,6 @@ schemars = "0.8.19" serde_json = "1.0.117" log = { version = "0.4.21", features = ["serde"] } dunce = "1.0.5" -url = "2.5.4" -git2 = { workspace = true } itertools = "0.14" +url = { version = "2.5.4", optional = true } +git2 = { workspace = true, optional = true } diff --git a/libraries/core/src/lib.rs b/libraries/core/src/lib.rs index 90f2c564..c45ec613 100644 --- a/libraries/core/src/lib.rs +++ b/libraries/core/src/lib.rs @@ -7,6 +7,7 @@ use std::{ pub use dora_message::{config, uhlc}; +#[cfg(feature = "build")] pub mod build; pub mod descriptor; pub mod metadata;