Skip to content

Commit 9dce729

Browse files
authored
Ensure sqlite and rusqlite are optional in consensus/types (#7182)
Even though the `consensus/types` crate has a feature named `sqlite`, it unconditionally depends on the `rusqlite` crate, which then depends on the `sqlite` crate — even when the feature is disabled. When the feature is disabled, the code that imports from `rusqlite` is disabled, so this dependency is not needed when the feature is disabled. This is not a problem for Lighthouse itself, but I’m interested in using the types defined here in a different Rust project, which depends on a conflicting version of the `sqlite` crate. Ensure that the dependency on `rusqlite` is only present when the `sqlite` feature is enabled.
1 parent 3f6c11d commit 9dce729

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

consensus/types/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ rand_xorshift = "0.3.0"
3838
rayon = { workspace = true }
3939
regex = { workspace = true }
4040
rpds = { workspace = true }
41-
rusqlite = { workspace = true }
41+
rusqlite = { workspace = true, optional = true }
4242
safe_arith = { workspace = true }
4343
serde = { workspace = true, features = ["rc"] }
4444
serde_json = { workspace = true }
@@ -64,7 +64,7 @@ tokio = { workspace = true }
6464
default = ["sqlite", "legacy-arith"]
6565
# Allow saturating arithmetic on slots and epochs. Enabled by default, but deprecated.
6666
legacy-arith = []
67-
sqlite = []
67+
sqlite = ["dep:rusqlite"]
6868
# The `arbitrary-fuzz` feature is a no-op provided for backwards compatibility.
6969
# For simplicity `Arbitrary` is now derived regardless of the feature's presence.
7070
arbitrary-fuzz = []

0 commit comments

Comments
 (0)