diff --git a/.github/workflows/bvt.yml b/.github/workflows/bvt.yml index 946df530..0b5ab3b5 100644 --- a/.github/workflows/bvt.yml +++ b/.github/workflows/bvt.yml @@ -9,13 +9,13 @@ jobs: name: Minimum Supported Rust Version runs-on: ubuntu-latest env: - RUSTUP_TOOLCHAIN: "1.85.0" - CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback + RUSTUP_TOOLCHAIN: "1.80.0" steps: - name: Checkout uses: actions/checkout@v3 - name: Install Rust - run: rustup toolchain install 1.85.0 --profile minimal + run: | + rustup toolchain install 1.80.0 --profile minimal - name: Install Protoc run: ./install_protoc.sh shell: bash @@ -23,7 +23,9 @@ jobs: run: | cargo test --workspace --features async,sync,security_extension cargo test -p ttrpc --no-default-features --features sync,async,prost + cargo check -p ttrpc-example --examples cargo test --manifest-path ttrpc-codegen-prost/Cargo.toml + cargo check --manifest-path example-prost/Cargo.toml --examples check: name: Check diff --git a/Cargo.toml b/Cargo.toml index 7796afd4..37a0dc61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ resolver = "2" [workspace.package] edition = "2018" -rust-version = "1.85" +rust-version = "1.80" license = "Apache-2.0" readme = "README.md" repository = "https://github.com/containerd/ttrpc-rust" @@ -76,6 +76,10 @@ prost-build = { version = "0.13", optional = true } [dev-dependencies] ttrpc-codegen = { workspace = true } +# Newer tempfile selects getrandom 0.4, which Cargo 1.80 cannot parse. +tempfile = ">=3.0, <3.25" +# Newer indexmap releases require a newer Rust/Cargo toolchain. +indexmap = ">=2.0, <2.12" [features] default = ["sync","rustprotobuf"] diff --git a/README.md b/README.md index 8e208d6a..2169e3fe 100644 --- a/README.md +++ b/README.md @@ -258,7 +258,11 @@ ttrpc does not provide TLS. If you expose TCP beyond a trusted boundary, secure ## Compatibility -- Runtime and code generators minimum supported Rust version: **1.85** +- Runtime and code generators minimum supported Rust version: **1.80** +- With Rust 1.80–1.84, a fresh dependency resolution may select transitive + crates requiring a newer toolchain. If needed, constrain `tempfile` to + `<3.25` in your application's `Cargo.toml`. For `indexmap`, use `<2.12` on + Rust 1.80–1.81 or `<2.14` on Rust 1.82–1.84. - Repository development toolchain: see [`rust-toolchain.toml`](https://github.com/containerd/ttrpc-rust/blob/master/rust-toolchain.toml) - Default features: `sync`, `rustprotobuf` - Optional features: `async`, `prost`, `security_extension` (Unix only) diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 4d4867f0..64de359f 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -17,7 +17,8 @@ protobuf = { workspace = true } protobuf-codegen = { workspace = true } [dev-dependencies] -tempfile = "3.0" +# Newer tempfile selects getrandom 0.4, which Cargo 1.80 cannot parse. +tempfile = ">=3.0, <3.25" [[bin]] name = "ttrpc_rust_plugin" diff --git a/example-prost/Cargo.toml b/example-prost/Cargo.toml index 29a05d97..af80b57f 100644 --- a/example-prost/Cargo.toml +++ b/example-prost/Cargo.toml @@ -3,6 +3,7 @@ name = "ttrpc-example-prost" version = "0.2.0" authors = ["The AntFin Kata Team "] edition = "2018" +rust-version = "1.80" license = "Apache-2.0" keywords = ["ttrpc", "protobuf", "rpc", "prost"] description = "An example of ttrpc using the Prost backend." @@ -25,6 +26,12 @@ rand = "0.8.5" [build-dependencies] ttrpc-codegen-prost = { version = "0.1.0", path = "../ttrpc-codegen-prost" } +[dev-dependencies] +# Newer tempfile selects getrandom 0.4, which Cargo 1.80 cannot parse. +tempfile = ">=3.0, <3.25" +# Newer indexmap releases require a newer Rust/Cargo toolchain. +indexmap = ">=2.0, <2.12" + [[example]] name = "client" path = "./client.rs" diff --git a/example/Cargo.toml b/example/Cargo.toml index 2b851c36..b95349a9 100644 --- a/example/Cargo.toml +++ b/example/Cargo.toml @@ -3,6 +3,7 @@ name = "ttrpc-example" version = "0.2.0" authors = ["The AntFin Kata Team "] edition = "2018" +rust-version = "1.80" license = "Apache-2.0" keywords = ["ttrpc", "protobuf", "rpc"] readme = "README.md" @@ -20,7 +21,9 @@ ctrlc = { version = "3.0", features = ["termination"] } tokio = { version = "1.0.1", features = ["signal", "time", "rt-multi-thread", "macros"] } async-trait = "0.1.42" rand = "0.8.5" -clap = { version = "4.5.40", features = ["derive"] } +clap = { version = ">=4.5.40, <4.6", features = ["derive"] } +# clap 4.5 accepts clap_lex 1.1, whose 2024 edition needs newer Cargo. +clap_lex = ">=1.0, <1.1" [[example]] name = "client" diff --git a/ttrpc-codegen-prost/Cargo.toml b/ttrpc-codegen-prost/Cargo.toml index 9d7825b0..f30be6e4 100644 --- a/ttrpc-codegen-prost/Cargo.toml +++ b/ttrpc-codegen-prost/Cargo.toml @@ -2,7 +2,7 @@ name = "ttrpc-codegen-prost" version = "0.1.0" edition = "2021" -rust-version = "1.85" +rust-version = "1.80" authors = ["The Ant Group Kata Team "] license = "Apache-2.0" keywords = ["codegen", "ttrpc", "protobuf"] @@ -24,3 +24,9 @@ prost-types = "0.13" prost-build = "0.13" proc-macro2 = "1.0" quote = "1.0" + +[dev-dependencies] +# Newer tempfile selects getrandom 0.4, which Cargo 1.80 cannot parse. +tempfile = ">=3.0, <3.25" +# Newer indexmap releases require a newer Rust/Cargo toolchain. +indexmap = ">=2.0, <2.12" diff --git a/ttrpc-codegen/Cargo.toml b/ttrpc-codegen/Cargo.toml index 3b69a057..ceb1a31c 100644 --- a/ttrpc-codegen/Cargo.toml +++ b/ttrpc-codegen/Cargo.toml @@ -20,4 +20,5 @@ protobuf-parse = { workspace = true } ttrpc-compiler = { workspace = true } [dev-dependencies] -tempfile = "3" +# Newer tempfile selects getrandom 0.4, which Cargo 1.80 cannot parse. +tempfile = ">=3.0, <3.25"