jj/lib/Cargo.toml
Ilya Grigoriev 7d81b9164a testutils: add git feature, make gix dependency optional
This makes it possible to use `testutils` without depending on all of
`gix`.

Users of testutils without the Git feature would currently either have
to use the LocalBackend or provide their own replacement to `TestRepo`.

`jj-lib`'s test still depend on Git. Both before and after this PR,
`cargo test --no-build -p jj-lib --no-default-features` fails to
compile. This seems like a difficult problem to address; this PR merely
tries to not make the situation worse.

**Motivation**: In at least one ERSC use-case, we'd like to use `testutils`, but
the gix dependency makes tests crash with the following error:

```
[test]     thread 'gitoxide.in_parallel.produce.0' panicked at code/...:
[test]     there is no reactor running, must be called from the context of a Tokio 1.x runtime
```

It's not clear to me why this happens (@davidbarsky claims to have an
idea), but this PR seems like a good workaround that also decreases the
amount of things we'd need to compile.
2025-10-28 10:55:35 -07:00

109 lines
2.9 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 }
blake2 = { workspace = true }
bstr = { workspace = true }
chrono = { workspace = true }
clru = { workspace = true }
digest = { workspace = true }
dunce = { workspace = true }
either = { workspace = true }
futures = { workspace = true }
gix = { workspace = true, optional = true }
globset = { workspace = true }
hashbrown = { workspace = true }
ignore = { workspace = true }
indexmap = { workspace = true }
interim = { 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 }
same-file = { workspace = true }
serde = { workspace = true }
smallvec = { workspace = true }
strsim = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
toml_edit = { workspace = true }
tracing = { workspace = true }
watchman_client = { workspace = true, optional = true }
[target.'cfg(unix)'.dependencies]
rustix = { workspace = true }
[target.'cfg(windows)'.dependencies]
winreg = { workspace = true }
[dev-dependencies]
assert_matches = { workspace = true }
criterion = { workspace = true }
indoc = { workspace = true }
insta = { workspace = true }
num_cpus = { workspace = true }
pretty_assertions = { workspace = true }
proptest = { workspace = true }
rustversion = { workspace = true }
sapling-renderdag = { workspace = true }
test-case = { workspace = true }
# `features = ["git"]` below has little effect currently
# Even with it, `cargo test --no-default-features jj-lib` fails to compile. It seems non-trivial to make jj-lib tests
# not depend on `git`.
# `cargo build --no-default-features` does compile with or without `features = ["git"]` below.
testutils = { workspace = true, features = ["git"] }
tokio = { workspace = true, features = ["full"] }
[target.'cfg(unix)'.dev-dependencies]
nix = { workspace = true, features = [ "fs" ] }
[features]
default = ["git"]
git = ["dep:gix"]
watchman = ["dep:watchman_client"]
testing = []
[lints]
workspace = true