shuttle-hq / shuttle

Build & ship backends without writing any infrastructure files.
https://shuttle.rs
Apache License 2.0
6.04k stars 251 forks source link

[Improvement]: shuttle-common pulls by default axum 0.6, bump to 0.7 to meet current usage pattern #1532

Open nicolasauler opened 8 months ago

nicolasauler commented 8 months ago

Describe the improvement

Shuttle is now using Axum 0.7 by default and Axum 0.6 is supported by using a feature flags. However, shuttle-common still pulls Axum 0.6 as a dependency. That creates a "multiple crate versions" situation, which is best described in: https://rust-lang.github.io/rust-clippy/master/index.html#/multiple_crate_versions.

Fix would be to bump axum to 0.7 to a default in shuttle-common and propagate a feature flag, if necessary, to the dependents on shuttle-common.

Example of the Cargo.lock package declaration of shuttle-common 0.36.0.

[[package]]
name = "shuttle-common"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8e3ddec998dd953743ac0e47de7ae6d65fcb1ffc45e68a4ceecd2558f8cad1b"
dependencies = [
 "anyhow",
 "async-trait",
 "axum 0.6.20",
 "bytes",
 "chrono",
 "comfy-table",
 "crossterm 0.27.0",
 "headers",
 "http 0.2.11",
 "http-body 0.4.6",
 "hyper 0.14.28",
 "jsonwebtoken",
 "opentelemetry",
 "opentelemetry-appender-tracing",
 "opentelemetry-http",
 "opentelemetry-otlp",
 "opentelemetry_sdk",
 "pin-project",
 "rustrict",
 "semver",
 "serde",
 "serde_json",
 "strum 0.25.0",
 "thiserror",
 "tokio",
 "tonic 0.10.2",
 "tower",
 "tower-http 0.4.4",
 "tracing",
 "tracing-core",
 "tracing-opentelemetry",
 "tracing-subscriber",
 "ttl_cache",
 "url",
 "uuid",
 "zeroize",
]

Duplicate declaration

jonaro00 commented 8 months ago

Axum 0.6 will remain in the dependency tree in some way until the enitre tokio ecosystem (tonic etc) has updated to 0.7. We are waiting for that and then bumping everything at once.