ok/jj
1
0
Fork 0
forked from mirrors/jj

cargo: unify dependency versions through workspace deps

Summary: This moves all dependencies across the jj-lib and jj-cli crates into
the top-level Cargo file; with that, we can change each crate instead to just
inherit the workspace version, with the toggled features enabled, by setting
a dependency such as:

    dep.workspace = true

in the relevant Cargo.toml file.

This doesn't actually change any of the build semantics (from what I can tell)
nor the lockfile, and seems to respond normally. There are more cleanups that
can follow.

Two notes:

- Dependabot seems to work fine, based on what I've seen in other repos.
- `cargo add` doesn't seem to know how to add packages to a top-level
  `workspace.dependencies` field; instead you can `cargo add -p jj-cli`
  and move the entries, at least.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Change-Id: I307827e5f15c0d8ea8e2a80ec793d3c7
This commit is contained in:
Austin Seipp 2023-08-05 11:14:11 -05:00
parent c8f7a5f73f
commit 13fff3be70
5 changed files with 162 additions and 92 deletions

View file

@ -4,6 +4,83 @@ cargo-features = []
resolver = "2" resolver = "2"
members = ["cli", "lib", "lib/testutils", "lib/gen-protos"] members = ["cli", "lib", "lib/testutils", "lib/gen-protos"]
[workspace.dependencies]
anyhow = "1.0.72"
assert_cmd = "2.0.8"
assert_matches = "1.5.0"
backoff = "0.4.0"
blake2 = "0.10.6"
byteorder = "1.4.3"
bytes = "1.4.0"
cargo_metadata = "0.17.0"
clap = { version = "4.3.19", features = ["derive", "deprecated"] }
clap_complete = "4.3.2"
clap_mangen = "0.2.10"
chrono = { version = "0.4.26", default-features = false, features = [
"std",
"clock",
] }
config = { version = "0.13.2", default-features = false, features = ["toml"] }
criterion = "0.5.1"
crossterm = { version = "0.26", default-features = false }
digest = "0.10.7"
dirs = "5.0.1"
esl01-renderdag = "0.3.0"
glob = "0.3.1"
git2 = "0.17.2"
hex = "0.4.3"
itertools = "0.11.0"
indexmap = "2.0.0"
libc = { version = "0.2.147" }
insta = { version = "1.31.0", features = ["filters"] }
maplit = "1.0.2"
num_cpus = "1.16.0"
once_cell = "1.18.0"
pest = "2.7.2"
pest_derive = "2.7.2"
prost = "0.11.9"
prost-build = "0.11.9"
rand = "0.8.5"
rand_chacha = "0.3.1"
rayon = "1.7.0"
regex = "1.9.1"
rpassword = "7.2.0"
rustix = { version = "0.38.6", features = ["fs"] }
smallvec = { version = "1.11.0", features = [
"const_generics",
"const_new",
"union",
] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.104"
slab = "0.4.8"
strsim = "0.10.0"
tempfile = "3.7.0"
test-case = "3.1.0"
textwrap = "0.16.0"
thiserror = "1.0.44"
timeago = { version = "0.4.1", default-features = false }
toml_edit = { version = "0.19.14", features = ["serde"] }
tracing = "0.1.37"
tracing-chrome = "0.7.1"
tracing-subscriber = { version = "0.3.17", default-features = false, features = [
"std",
"ansi",
"env-filter",
"fmt",
] }
tokio = { version = "1.29.1" }
watchman_client = { version = "0.8.0" }
whoami = "1.4.1"
version_check = "0.9.4"
zstd = "0.12.4"
# put all inter-workspace libraries, i.e. those that use 'path = ...' here in
# their own (alphabetically sorted) block
jj-lib = { path = "lib" }
testutils = { path = "lib/testutils" }
[profile.release] [profile.release]
strip = "debuginfo" strip = "debuginfo"
codegen-units = 1 codegen-units = 1

View file

@ -3,7 +3,7 @@ name = "jj-cli"
version = "0.8.0" version = "0.8.0"
authors = ["Martin von Zweigbergk <martinvonz@google.com>"] authors = ["Martin von Zweigbergk <martinvonz@google.com>"]
edition = "2021" edition = "2021"
rust-version = "1.71" # Remember to update CI, and contributing.md rust-version = "1.71" # Remember to update CI, and contributing.md
license = "Apache-2.0" license = "Apache-2.0"
description = "Jujutsu (an experimental VCS)" description = "Jujutsu (an experimental VCS)"
homepage = "https://github.com/martinvonz/jj" homepage = "https://github.com/martinvonz/jj"
@ -27,51 +27,51 @@ name = "fake-diff-editor"
path = "testing/fake-diff-editor.rs" path = "testing/fake-diff-editor.rs"
[build-dependencies] [build-dependencies]
cargo_metadata = "0.17.0" cargo_metadata.workspace = true
[dependencies] [dependencies]
chrono = { version = "0.4.26", default-features = false, features = ["std", "clock"] } chrono.workspace = true
clap = { version = "4.3.19", features = ["derive", "deprecated"] } clap.workspace = true
clap_complete = "4.3.2" clap_complete.workspace = true
clap_mangen = "0.2.10" clap_mangen.workspace = true
config = { version = "0.13.3", default-features = false, features = ["toml"] } config.workspace = true
criterion = {version = "0.5.1", optional = true } criterion = { workspace = true, optional = true }
crossterm = { version = "0.26", default-features = false } crossterm.workspace = true
dirs = "5.0.1" dirs.workspace = true
esl01-renderdag = "0.3.0" esl01-renderdag.workspace = true
git2 = "0.17.2" git2.workspace = true
glob = "0.3.1" glob.workspace = true
hex = "0.4.3" hex.workspace = true
indexmap = "2.0.0" indexmap.workspace = true
itertools = "0.11.0" itertools.workspace = true
jj-lib = { version = "=0.8.0", path = "../lib", default-features = false } jj-lib.workspace = true
maplit = "1.0.2" maplit.workspace = true
once_cell = "1.18.0" once_cell.workspace = true
pest = "2.7.2" pest.workspace = true
pest_derive = "2.7.2" pest_derive.workspace = true
regex = "1.9.1" regex.workspace = true
rpassword = "7.2.0" rpassword.workspace = true
serde = { version = "1.0", features = ["derive"] } serde.workspace = true
slab = "0.4.8" slab.workspace = true
tempfile = "3.7.0" tempfile.workspace = true
textwrap = "0.16.0" textwrap.workspace = true
thiserror = "1.0.44" thiserror.workspace = true
timeago = { version = "0.4.1", default-features = false } timeago.workspace = true
toml_edit = { version = "0.19.14", features = ["serde"] } toml_edit.workspace = true
tracing = "0.1.37" tracing.workspace = true
tracing-chrome = "0.7.1" tracing-chrome.workspace = true
tracing-subscriber = { version = "0.3.17", default-features = false, features = ["std", "ansi", "env-filter", "fmt"] } tracing-subscriber.workspace = true
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
libc = { version = "0.2.147" } libc.workspace = true
[dev-dependencies] [dev-dependencies]
anyhow = "1.0.72" anyhow.workspace = true
assert_cmd = "2.0.8" assert_cmd.workspace = true
assert_matches = "1.5.0" assert_matches.workspace = true
insta = { version = "1.31.0", features = ["filters"] } insta.workspace = true
test-case = "3.1.0" test-case.workspace = true
testutils = { path = "../lib/testutils" } testutils.workspace = true
[features] [features]
default = [] default = []

View file

@ -18,57 +18,50 @@ name = "diff_bench"
harness = false harness = false
[build-dependencies] [build-dependencies]
version_check = "0.9.4" version_check.workspace = true
[dependencies] [dependencies]
backoff = "0.4.0" backoff.workspace = true
blake2 = "0.10.6" blake2.workspace = true
byteorder = "1.4.3" byteorder.workspace = true
bytes = "1.4.0" bytes.workspace = true
chrono = { version = "0.4.26", default-features = false, features = [ chrono.workspace = true
"std", config.workspace = true
"clock", digest.workspace = true
] } git2.workspace = true
config = { version = "0.13.3", default-features = false, features = ["toml"] } hex.workspace = true
digest = "0.10.7" itertools.workspace = true
git2 = "0.17.2" maplit.workspace = true
hex = "0.4.3" once_cell.workspace = true
itertools = "0.11.0" pest.workspace = true
maplit = "1.0.2" pest_derive.workspace = true
once_cell = "1.18.0" prost.workspace = true
pest = "2.7.2" rand.workspace = true
pest_derive = "2.7.2" rand_chacha.workspace = true
prost = "0.11.9" rayon.workspace = true
rand = "0.8.5" regex.workspace = true
rand_chacha = "0.3.1" serde_json.workspace = true
rayon = "1.7.0" smallvec.workspace = true
regex = "1.9.1" strsim.workspace = true
serde_json = "1.0.104" tempfile.workspace = true
smallvec = { version = "1.11.0", features = [ thiserror.workspace = true
"const_generics", tokio = { workspace = true, optional = true }
"const_new", tracing.workspace = true
"union", watchman_client = { workspace = true, optional = true }
] } whoami.workspace = true
strsim = "0.10.0" zstd.workspace = true
tempfile = "3.7.0"
thiserror = "1.0.44"
tokio = { version = "1.29.1", optional = true }
tracing = "0.1.37"
watchman_client = { version = "0.8.0", optional = true }
whoami = "1.4.1"
zstd = "0.12.4"
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
rustix = { version = "0.38.6", features = ["fs"] } rustix.workspace = true
[dev-dependencies] [dev-dependencies]
assert_matches = "1.5.0" assert_matches.workspace = true
criterion = "0.5.1" criterion.workspace = true
esl01-renderdag = "0.3.0" esl01-renderdag.workspace = true
insta = "1.31.0" insta.workspace = true
num_cpus = "1.16.0" num_cpus.workspace = true
test-case = "3.1.0" test-case.workspace = true
testutils = { path = "testutils" } testutils.workspace = true
[features] [features]
default = [] default = []

View file

@ -6,4 +6,4 @@ license = "Apache-2.0"
publish = false publish = false
[dependencies] [dependencies]
prost-build = "0.11.9" prost-build.workspace = true

View file

@ -15,9 +15,9 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
config = { version = "0.13.2", default-features = false, features = ["toml"] } config.workspace = true
git2 = "0.17.2" git2.workspace = true
itertools = "0.11.0" itertools.workspace = true
jj-lib = { path = ".." } jj-lib.workspace = true
rand = "0.8.5" rand.workspace = true
tempfile = "3.7.0" tempfile.workspace = true