Skip to content

Commit

Permalink
chore: fix minimal-versions correctness (tokio-rs#2246)
Browse files Browse the repository at this point in the history
## Motivation

Fix minimal-versions failure.

## Solution

Upgrade all the dependencies to their most recent semver-compatible
version, adjusting back down as necessary for MSRV.

Essentially a cherry-pick of tokio-rs#2231, but redone by hand.

## Tests

- `cargo minimal-versions msrv verify -- cargo check --all-features`
- `cargo minimal-versions msrv verify -- cargo check --no-default-features`

## Methodology

- `cargo update && cargo upgrade --to-lockfile`
  - Identify [a bug](killercup/cargo-edit#750) and manually resolve it
- loop; upgrade transitive deps
  - `cargo minimal-versions check --all-features`
  - Identify failing dep
  - `cargo minimal-versions tree -i dep --all-features`
  - Find the closest dependency leading to pulling in `dep`
  - `cargo add fixdep --optional` to force a more recent more-minimal-versions-correct version
- loop; downgrade to msrv
  - `cargo minimal-versions msrv verify -- cargo check --all-features`
  - Identify failing dep
  - `cargo minimal-versions tree -i dep --all-features`
  - Find the version that supports MSRV from lib.rs
  - `cargo upgrade dep@msrv`
  • Loading branch information
CAD97 authored and kaffarell committed May 22, 2024
1 parent f02819f commit 7253241
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tracing-log = { path = "../tracing-log", version = "0.2", features = ["env_logge
tracing-serde = { path = "../tracing-serde" }
tracing-appender = { path = "../tracing-appender" }
tracing-journald = { path = "../tracing-journald" }
tracing-appender = { path = "../tracing-appender", version = "0.2" }
tracing-appender = { path = "../tracing-appender", version = "0.2.0" }

# serde example
serde_json = "1.0.82"
Expand Down
2 changes: 1 addition & 1 deletion tracing-appender/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ thiserror = "1.0.31"

[dependencies.tracing-subscriber]
path = "../tracing-subscriber"
version = "0.3"
version = "0.3.0"
default-features = false
features = ["fmt", "std"]

Expand Down
4 changes: 2 additions & 2 deletions tracing-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ maintenance = { status = "actively-developed" }
once_cell = { version = "1.13.0", optional = true }

[target.'cfg(tracing_unstable)'.dependencies]
valuable = { version = "0.1.0", optional = true, default_features = false }
valuable = { version = "0.1.0", optional = true, default-features = false }

[package.metadata.docs.rs]
all-features = true
# enable unstable features in the documentation
rustdoc-args = ["--cfg", "docsrs", "--cfg", "tracing_unstable"]
# it's necessary to _also_ pass `--cfg tracing_unstable` to rustc, or else
# dependencies will not be enabled, and the docs build will fail.
rustc-args = ["--cfg", "tracing_unstable"]
rustc-args = ["--cfg", "tracing_unstable"]
20 changes: 12 additions & 8 deletions tracing-opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,21 @@ rust-version = "1.46.0"
default = ["tracing-log"]

[dependencies]
opentelemetry = { version = "0.17", default-features = false, features = ["trace"] }
tracing = { path = "../tracing", version = "0.1", default-features = false, features = ["std"] }
tracing-core = { path = "../tracing-core", version = "0.1" }
tracing-subscriber = { path = "../tracing-subscriber", version = "0.3", default-features = false, features = ["registry", "std"] }
tracing-log = { path = "../tracing-log", version = "0.1", default-features = false, optional = true }
opentelemetry = { version = "0.17.0", default-features = false, features = ["trace"] }
tracing = { path = "../tracing", version = "0.1.35", default-features = false, features = ["std"] }
tracing-core = { path = "../tracing-core", version = "0.1.28" }
tracing-subscriber = { path = "../tracing-subscriber", version = "0.3.0", default-features = false, features = ["registry", "std"] }
tracing-log = { path = "../tracing-log", version = "0.1.3", default-features = false, optional = true }
once_cell = "1"

# Fix minimal-versions
async-trait = { version = "0.1.56", optional = true }
thiserror = { version = "1.0.31", optional = true }

[dev-dependencies]
async-trait = "0.1"
criterion = { version = "0.3", default_features = false }
opentelemetry-jaeger = "0.16"
async-trait = "0.1.56"
criterion = { version = "0.3.6", default-features = false }
opentelemetry-jaeger = "0.16.0"

[lib]
bench = false
Expand Down
4 changes: 2 additions & 2 deletions tracing-serde/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ tracing-core = { path = "../tracing-core", version = "0.2", default-features = f
serde_json = "1.0.82"

[target.'cfg(tracing_unstable)'.dependencies]
valuable_crate = { package = "valuable", version = "0.1.0", optional = true, default_features = false }
valuable-serde = { version = "0.1.0", optional = true, default_features = false }
valuable_crate = { package = "valuable", version = "0.1.0", optional = true, default-features = false }
valuable-serde = { version = "0.1.0", optional = true, default-features = false }

[badges]
maintenance = { status = "experimental" }
4 changes: 2 additions & 2 deletions tracing-subscriber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ sharded-slab = { version = "0.1.4", optional = true }
thread_local = { version = "1.1.4", optional = true }

[target.'cfg(tracing_unstable)'.dependencies]
valuable_crate = { package = "valuable", version = "0.1.0", optional = true, default_features = false }
valuable-serde = { version = "0.1.0", optional = true, default_features = false }
valuable_crate = { package = "valuable", version = "0.1.0", optional = true, default-features = false }
valuable-serde = { version = "0.1.0", optional = true, default-features = false }

[dev-dependencies]
tracing = { path = "../tracing", version = "0.2" }
Expand Down
2 changes: 1 addition & 1 deletion tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs", "--cfg", "tracing_unstable"]
# it's necessary to _also_ pass `--cfg tracing_unstable` to rustc, or else
# dependencies will not be enabled, and the docs build will fail.
rustc-args = ["--cfg", "tracing_unstable"]
rustc-args = ["--cfg", "tracing_unstable"]
2 changes: 1 addition & 1 deletion tracing/test-log-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ edition = "2018"
[dependencies]
tracing-core = { path= "../../tracing-core"}
tracing = { path = "..", features = ["log", "log-always"] }
log = { version = "0.4", features = ["std"] }
log = { version = "0.4.0", features = ["std"] }

0 comments on commit 7253241

Please sign in to comment.