ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/lib/Cargo.toml
Martin von Zweigbergk 0fd1969e8f lib: make git support optional via crate feature
I've wanted to make the Git support optional for a long time. However,
since everyone uses the Git backend (and we want to support it even in
the custom binary at Google), there hasn't been much practical reason
to make Git support optional.

Since we now use jj-lib on the server at Google, it does make sense to
have the server not include Git support. In addition to making the
server binary smaller, it would make it easier for us (jj team at
Googlle) to prove that our server is not affected by some libgit2 or
Gitoxide vulnerability. But to be honest, neither of those problems
have come up, so it's more of an excuse to make the Git support
optional at this point.

It turned out to be much simpler than I expected to make Git support
in the lib crate optional. We have done a pretty good job of keeping
Git-related logic separated there.

If we make Git support optional in the lib crate, it's going to make
it a bit harder to move logic from the CLI crate into the lib crate
(as we have planned to do). Maybe that's good, though, since it helps
remind us to keep Git-related logic separated.
2024-06-11 22:03:20 +09:00

99 lines
2.5 KiB
TOML

[package]
name = "jj-lib"
description = "Library for Jujutsu - an experimental version control system"
autotests = false
version = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
documentation = { workspace = true }
readme = { workspace = true }
include = [
"/LICENSE",
"/benches/",
"/src/",
"/tests/",
"!*.pending-snap",
"!*.snap*",
]
[[test]]
name = "runner"
[[bench]]
name = "diff_bench"
harness = false
[build-dependencies]
version_check = { workspace = true }
[dependencies]
async-trait = { workspace = true }
backoff = { workspace = true }
blake2 = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true }
config = { workspace = true }
digest = { workspace = true }
either = { workspace = true }
futures = { workspace = true }
git2 = { workspace = true, optional = true }
gix = { workspace = true, optional = true }
glob = { workspace = true }
hex = { workspace = true }
ignore = { workspace = true }
itertools = { workspace = true }
jj-lib-proc-macros = { workspace = true }
maplit = { workspace = true }
once_cell = { workspace = true }
pest = { workspace = true }
pest_derive = { workspace = true }
pollster = { workspace = true }
prost = { workspace = true }
rand = { workspace = true }
rand_chacha = { workspace = true }
rayon = { workspace = true }
ref-cast = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
smallvec = { workspace = true }
strsim = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, optional = true }
tracing = { workspace = true }
watchman_client = { workspace = true, optional = true }
whoami = { workspace = true }
zstd = { workspace = true }
[target.'cfg(unix)'.dependencies]
rustix = { workspace = true }
[target.'cfg(windows)'.dependencies]
winreg = { workspace = true }
[dev-dependencies]
assert_matches = { workspace = true }
criterion = { workspace = true }
esl01-renderdag = { workspace = true }
indoc = { workspace = true }
insta = { workspace = true }
num_cpus = { workspace = true }
pretty_assertions = { workspace = true }
test-case = { workspace = true }
testutils = { workspace = true }
tokio = { workspace = true, features = ["full"] }
[features]
default = ["git"]
git = ["dep:git2", "dep:gix"]
vendored-openssl = ["git2/vendored-openssl"]
watchman = ["dep:tokio", "dep:watchman_client"]
testing = []