From 5337787794d88aa09f92473bce6d620d552230bb Mon Sep 17 00:00:00 2001 From: Tim Zhang Date: Wed, 30 Sep 2026 22:50:53 +0800 Subject: [PATCH 1/3] release: ttrpc-codegen 0.7.0 Bump codegen and its workspace dependency to 0.7.0 for incompatible public types and generated bindings. Keep the existing compiler 0.9.0 version and finalize both generators' release notes and usage guides. Signed-off-by: Tim Zhang --- Cargo.toml | 2 +- compiler/CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++----- compiler/README.md | 27 +++++++++++++++++------- ttrpc-codegen/CHANGELOG.md | 37 +++++++++++++++++++++++++++----- ttrpc-codegen/Cargo.toml | 2 +- ttrpc-codegen/README.md | 26 ++++++++++++++--------- 6 files changed, 107 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 37a0dc61..78e6ab48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ authors = ["The AntFin Kata Team "] # version. For example, for protobuf: # protobuf = { workspace = true } ttrpc = { version = "0.9.0", path = "./" } -ttrpc-codegen = { version = "0.6.1", path = "./ttrpc-codegen" } +ttrpc-codegen = { version = "0.7.0", path = "./ttrpc-codegen" } ttrpc-compiler = { version = "0.9.0", path = "./compiler" } protobuf = "3.7.2" protobuf-codegen = "3.7.2" diff --git a/compiler/CHANGELOG.md b/compiler/CHANGELOG.md index 117d0f67..7827a97c 100644 --- a/compiler/CHANGELOG.md +++ b/compiler/CHANGELOG.md @@ -5,17 +5,44 @@ file. The format is based on [Keep a Changelog], and this project follows [Semantic Versioning]. Historical entries were reconstructed from the -published crates and Git history. Release dates are crates.io publication -dates. Releases are ordered by publication date because multiple version -lines were maintained in parallel. +published crates and Git history. Dates on historical entries are crates.io +publication dates. Historical releases are ordered by publication date rather +than version number because several release lines were maintained in parallel. +New release entries omit dates; see crates.io for publication timestamps. -## [Unreleased] +## [0.9.0] + +### API changes + +- **Breaking:** RPC bindings for canonical Google well-known types now use + the types from the `protobuf` runtime unless their proto files are selected + explicitly for generation. Update service implementations and call sites + that used locally generated well-known types. These bindings require the + new handler macro forms in ttrpc 0.10. ([#322]) +- **Migration:** Upgrade the runtime to ttrpc 0.10 and regenerate bindings. + Build scripts using `ttrpc-codegen` should upgrade it to 0.7. + +### Added + +- Resolved canonical Google well-known RPC input and output types through the + `protobuf` runtime, while preserving locally generated types when their + proto files are explicitly selected as inputs. ([#322]) + +### Fixed + +- Stabilized generated module ordering and kept generated `mod.rs` files from + being reordered by rustfmt, without duplicating headers or declarations. + ([#326], [#335]) + +### Changed + +- Expanded public API documentation. ([#320]) ### Removed - **Breaking:** Removed the unused `prost_codegen` module, which generated grpcio bindings, and its Prost 0.8 dependencies. Use the standalone Prost - generator in `ttrpc-codegen-prost/` for ttrpc bindings. + generator in `ttrpc-codegen-prost/` for ttrpc bindings. ([#332]) ## [0.8.0] - 2025-07-15 @@ -183,6 +210,7 @@ lines were maintained in parallel. [Keep a Changelog]: https://keepachangelog.com/en/2.0.0/ [Semantic Versioning]: https://semver.org/spec/v2.0.0.html +[0.9.0]: https://github.com/containerd/ttrpc-rust/compare/v0.9.0...v0.10.0 [0.8.0]: https://github.com/containerd/ttrpc-rust/compare/1d4cdeaf...f31f5925 [0.7.0]: https://github.com/containerd/ttrpc-rust/compare/b9e9dd8a...1d4cdeaf [0.6.3]: https://github.com/containerd/ttrpc-rust/compare/6fe7d395...b9e9dd8a @@ -199,3 +227,8 @@ lines were maintained in parallel. [0.3.2]: https://github.com/containerd/ttrpc-rust/compare/7e3634e0...4bebaa0f [0.3.1]: https://github.com/containerd/ttrpc-rust/commits/7e3634e0 [0.3.0]: https://crates.io/crates/ttrpc-compiler/0.3.0 +[#320]: https://github.com/containerd/ttrpc-rust/pull/320 +[#322]: https://github.com/containerd/ttrpc-rust/pull/322 +[#326]: https://github.com/containerd/ttrpc-rust/pull/326 +[#332]: https://github.com/containerd/ttrpc-rust/pull/332 +[#335]: https://github.com/containerd/ttrpc-rust/pull/335 diff --git a/compiler/README.md b/compiler/README.md index 56c827f2..882f6335 100644 --- a/compiler/README.md +++ b/compiler/README.md @@ -1,11 +1,16 @@ -# A compiler of ttrpc-rust +# ttrpc-compiler -generate rust version ttrpc code from proto files. +Generate rust-protobuf ttrpc service bindings from Protocol Buffers descriptors. ## Usage -- [Manual Generation](https://github.com/containerd/ttrpc-rust#1-generate-with-protoc-command) uses ttrpc-compiler as a protoc plugin -- [Programmatic Generation](https://github.com/containerd/ttrpc-rust#2-generate-programmatically) uses ttrpc-compiler as a rust crate +- For build-script generation, use [`ttrpc-codegen`](../ttrpc-codegen/README.md). + The [quick start](../README.md#add-ttrpc-to-your-project) includes the runtime + dependencies, proto definition, and build script. +- For manual generation, install the `ttrpc_rust_plugin` binary with + `cargo install ttrpc-compiler --version 0.9.0 --locked` and configure `protoc` + to use it as the `protoc-gen-ttrpc` plugin. This generates service bindings; + generate the message types separately with `protobuf-codegen`. ## Well-known types @@ -14,9 +19,15 @@ corresponding types provided by the `protobuf` runtime. Well-known proto files e for generation continue to use their locally generated modules. ## Versions + +Use these release pairs: + | ttrpc-compiler version | ttrpc version | | ------------- | ------------- | -| 0.3.x | <= 0.4.x | -| 0.4.x | == 0.5.x | -| 0.5.x | == 0.6.x | -| 0.6.x | >= 0.7.x | +| 0.8.0 | 0.9.x | +| 0.9.x | 0.10.x | + +Version 0.9 requires Rust 1.80 or newer. It removes the legacy `prost_codegen` +module and changes the generated APIs for well-known types. See the +[runtime changelog](../CHANGELOG.md) and +[compiler changelog](./CHANGELOG.md) before upgrading. diff --git a/ttrpc-codegen/CHANGELOG.md b/ttrpc-codegen/CHANGELOG.md index 40eedd98..c22dcb29 100644 --- a/ttrpc-codegen/CHANGELOG.md +++ b/ttrpc-codegen/CHANGELOG.md @@ -4,16 +4,38 @@ All notable changes to the `ttrpc-codegen` crate are documented in this file. The format is based on [Keep a Changelog], and this project follows [Semantic Versioning]. Historical entries were reconstructed from the -published crates and Git history. Release dates are crates.io publication -dates. Releases are ordered by publication date because multiple version -lines were maintained in parallel. +published crates and Git history. Dates on historical entries are crates.io +publication dates. Historical releases are ordered by publication date rather +than version number because several release lines were maintained in parallel. +New release entries omit dates; see crates.io for publication timestamps. -## [Unreleased] +## [0.7.0] + +### API changes + +- **Breaking:** The re-exported `Customize` type and `Codegen::customize` + now use `ttrpc-compiler` 0.9. Types from `ttrpc-compiler` 0.8 are not + interchangeable; use `ttrpc_codegen::Customize` or upgrade direct compiler + dependencies to 0.9. ([#332]) +- **Breaking:** RPC bindings for canonical Google well-known types now use + the types from the `protobuf` runtime unless their proto files are selected + explicitly for generation. Update service implementations and call sites + that used locally generated well-known types. These bindings require the + new handler macro forms in ttrpc 0.10. ([#322]) +- **Migration:** Upgrade to ttrpc 0.10 and regenerate checked-in bindings. + This release starts a new compatibility line rather than a 0.6 patch. + +### Added + +- Resolved canonical Google well-known proto imports without extra include + directories or copied proto files. ([#322]) ### Changed +- Replaced the bundled proto parser with `protobuf-parse` 3.7.2. ([#322]) - Updated the `ttrpc-compiler` dependency to 0.9.0 after removing its unused - legacy Prost generator. + legacy Prost generator. ([#332]) +- Expanded API documentation and retained Rust 1.80 support. ([#320], [#333]) ## [0.6.0] - 2025-07-15 @@ -169,6 +191,7 @@ lines were maintained in parallel. [Keep a Changelog]: https://keepachangelog.com/en/2.0.0/ [Semantic Versioning]: https://semver.org/spec/v2.0.0.html +[0.7.0]: https://github.com/containerd/ttrpc-rust/compare/v0.9.0...v0.10.0 [0.6.0]: https://github.com/containerd/ttrpc-rust/compare/1d4cdeaf...f31f5925 [0.5.0]: https://github.com/containerd/ttrpc-rust/compare/22cd9ca4...1d4cdeaf [0.2.4]: https://github.com/containerd/ttrpc-rust/compare/4b90ee15...8968bfad @@ -184,3 +207,7 @@ lines were maintained in parallel. [0.2.0]: https://github.com/containerd/ttrpc-rust/compare/9ea607a6...eef20041 [0.1.2]: https://github.com/containerd/ttrpc-rust/compare/ec2a9193...9ea607a6 [0.1.1]: https://github.com/containerd/ttrpc-rust/commits/ec2a9193 +[#320]: https://github.com/containerd/ttrpc-rust/pull/320 +[#322]: https://github.com/containerd/ttrpc-rust/pull/322 +[#332]: https://github.com/containerd/ttrpc-rust/pull/332 +[#333]: https://github.com/containerd/ttrpc-rust/pull/333 diff --git a/ttrpc-codegen/Cargo.toml b/ttrpc-codegen/Cargo.toml index ceb1a31c..b9e7cf98 100644 --- a/ttrpc-codegen/Cargo.toml +++ b/ttrpc-codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ttrpc-codegen" -version = "0.6.1" +version = "0.7.0" edition = { workspace = true } rust-version = { workspace = true } authors = { workspace = true } diff --git a/ttrpc-codegen/README.md b/ttrpc-codegen/README.md index 43049204..ce287743 100644 --- a/ttrpc-codegen/README.md +++ b/ttrpc-codegen/README.md @@ -47,20 +47,26 @@ Cargo.toml: ``` [build-dependencies] -ttrpc-codegen = "0.2" +ttrpc-codegen = "0.7.0" ``` ## Versions + +Use these release pairs: + | ttrpc-codegen version | ttrpc version | | ------------- | ------------- | -| 0.1.x | <= 0.4.x | -| 0.2.x | == 0.5.x | -| 0.3.x | == 0.6.x | -| 0.4.x | >= 0.7.x | -| 0.5.x | >= 0.7.x | +| 0.6.0 | 0.9.x | +| 0.7.x | 0.10.x | + +Version 0.7 requires Rust 1.80 or newer and uses `ttrpc-compiler` 0.9. +Import `Customize` from `ttrpc_codegen` to use the matching compiler type. +Regenerate bindings and review the [runtime changelog](../CHANGELOG.md) +when upgrading from 0.6; see the [changelog](./CHANGELOG.md) for API details. ## Alternative -The alternative is to use -[protoc-rust crate](https://github.com/stepancheg/rust-protobuf), -which relies on `protoc` command to parse descriptors. Both crates should produce the same result, -otherwise please file a bug report. + +For manual rust-protobuf service generation with `protoc`, use the +[`ttrpc-compiler` plugin](../compiler/README.md#usage). +For Prost messages and services, use the separate +[`ttrpc-codegen-prost` package](../ttrpc-codegen-prost/README.md). From 033968481ecdce97e5bbe25b71a95b7e4986c0a9 Mon Sep 17 00:00:00 2001 From: Tim Zhang Date: Wed, 30 Sep 2026 22:50:53 +0800 Subject: [PATCH 2/3] release: ttrpc-codegen-prost 0.1.0 Finalize the first standalone Prost generator release notes and point usage examples to the published crate versions. Signed-off-by: Tim Zhang --- ttrpc-codegen-prost/CHANGELOG.md | 9 ++++----- ttrpc-codegen-prost/README.md | 30 +++++++++++------------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/ttrpc-codegen-prost/CHANGELOG.md b/ttrpc-codegen-prost/CHANGELOG.md index f9e933a7..583c7ae3 100644 --- a/ttrpc-codegen-prost/CHANGELOG.md +++ b/ttrpc-codegen-prost/CHANGELOG.md @@ -3,9 +3,7 @@ All notable changes to the `ttrpc-codegen-prost` crate are documented here. The format is based on [Keep a Changelog]. -## [Unreleased] - -The first release is being prepared as `0.1.0`. +## [0.1.0] ### Added @@ -25,7 +23,7 @@ The first release is being prepared as `0.1.0`. - Renamed the unpublished Prost package from `ttrpc-codegen` version `1.0.0` to `ttrpc-codegen-prost` version `0.1.0`. Rust imports now use `ttrpc_codegen_prost`; the rust-protobuf `ttrpc-codegen` package retains - its existing name and version line. + its existing name and version line. ([#332]) ### Fixed @@ -33,5 +31,6 @@ The first release is being prepared as `0.1.0`. descriptors share the same output package file. ([#286]) [Keep a Changelog]: https://keepachangelog.com/en/2.0.0/ -[Unreleased]: https://github.com/containerd/ttrpc-rust/commits/master/ttrpc-codegen-prost +[0.1.0]: https://github.com/containerd/ttrpc-rust/tree/v0.10.0/ttrpc-codegen-prost [#286]: https://github.com/containerd/ttrpc-rust/pull/286 +[#332]: https://github.com/containerd/ttrpc-rust/pull/332 diff --git a/ttrpc-codegen-prost/README.md b/ttrpc-codegen-prost/README.md index 063239a8..14530e6f 100644 --- a/ttrpc-codegen-prost/README.md +++ b/ttrpc-codegen-prost/README.md @@ -3,23 +3,19 @@ This standalone crate generates Prost messages and ttrpc clients, server traits, and service registration helpers from `.proto` files. It requires `protoc` on `PATH` and uses Prost 0.13. The runtime must also use the `prost` backend. -The separate `ttrpc-codegen` package continues to use rust-protobuf. This -generator was previously an unpublished package with the same name; its first -release is planned as `ttrpc-codegen-prost` 0.1.0. +The separate `ttrpc-codegen` package continues to use rust-protobuf. +`ttrpc-codegen-prost` 0.1 targets ttrpc 0.10. ## Build a service -The following example assumes your application and a checkout of this repository -are sibling directories: +Create an application with the following layout: ```text -parent/ - ttrpc-rust/ - prost-greeter/ - Cargo.toml - build.rs - proto/greeter.proto - src/lib.rs +prost-greeter/ + Cargo.toml + build.rs + proto/greeter.proto + src/lib.rs ``` In the application's `Cargo.toml`: @@ -32,16 +28,12 @@ edition = "2021" [dependencies] prost = "0.13" -ttrpc = { path = "../ttrpc-rust", default-features = false, features = ["sync", "prost"] } +ttrpc = { version = "0.10", default-features = false, features = ["sync", "prost"] } [build-dependencies] -ttrpc-codegen-prost = { version = "0.1", path = "../ttrpc-rust/ttrpc-codegen-prost" } +ttrpc-codegen-prost = "0.1" ``` -The `ttrpc-codegen-prost/` directory contains the Prost generator; -`ttrpc-codegen/` contains the rust-protobuf generator. Use the local path above -until the Prost generator is published. - Define `proto/greeter.proto`: ```proto @@ -104,7 +96,7 @@ Replace the application's runtime dependencies with: [dependencies] async-trait = "0.1" prost = "0.13" -ttrpc = { path = "../ttrpc-rust", default-features = false, features = ["async", "prost"] } +ttrpc = { version = "0.10", default-features = false, features = ["async", "prost"] } tokio = { version = "1", features = ["macros", "rt"] } ``` From c02a82f475cb8c696a2db9b4c6f0136828a135af Mon Sep 17 00:00:00 2001 From: Tim Zhang Date: Wed, 30 Sep 2026 22:50:53 +0800 Subject: [PATCH 3/3] release: ttrpc 0.10.0 Bump the runtime and its workspace dependency to 0.10.0. Document API migrations, release highlights, and source PRs in the changelog. Update runtime examples, API documentation, and release instructions for the coordinated runtime and generator versions. Signed-off-by: Tim Zhang --- CHANGELOG.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++--- Cargo.toml | 4 +-- README.md | 29 +++++++++++---------- RELEASE.md | 40 +++++++++++++++++++++++------ src/lib.rs | 23 ++++++++++++----- 5 files changed, 135 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a3c9fec..7a7a5fdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,63 @@ All notable changes to the `ttrpc` crate are documented in this file. The format is based on [Keep a Changelog], and this project follows [Semantic Versioning]. Historical entries were reconstructed from the -published crates and Git history. Release dates are crates.io publication -dates. Because several release lines were maintained in parallel, releases -are ordered by publication date rather than version number. +published crates and Git history. Dates on historical entries are crates.io +publication dates. Historical releases are ordered by publication date rather +than version number because several release lines were maintained in parallel. +New release entries omit dates; see crates.io for publication timestamps. + +## [0.10.0] + +### API changes + +- **Breaking:** Builds with default features disabled must explicitly select + either `rustprotobuf` or `prost`, along with the desired runtime features. + The two protobuf backends are mutually exclusive. ([#286]) +- **Breaking:** Direct construction of synchronous `TtrpcContext` now requires + `conn_ctx`; asynchronous `TtrpcContext` requires `connection_data`. Use a + default connection context or `..Default::default()` for async test contexts. + ([#316]) +- **Breaking:** Custom implementations of `proto::Codec` must implement the + new `merge` method. ([#286]) +- **Breaking:** `asynchronous::StreamInner::new` is no longer public; use the + generated clients and typed stream APIs instead. ([#316]) +- **Migration:** Regenerate rust-protobuf bindings with `ttrpc-codegen` 0.7.0 + and `ttrpc-compiler` 0.9.0. For Prost, use `ttrpc-codegen-prost` 0.1.0 with + Prost 0.13 and install `protoc`. +- **Deprecated:** Use `TtrpcContext::respond` or `send_response` instead of + `response_to_channel` to preserve per-connection payload transforms. ([#316]) + +### Added + +- Added a Prost 0.13 backend for synchronous, asynchronous, and streaming RPCs. + ([#286]) +- Added the Unix-only `security_extension` feature with accept/connect hooks, + per-connection metadata, and pluggable payload transforms. ([#316]) +- Added API documentation, backend setup guides, and Prost examples. + ([#286], [#320], [#329]) + +### Changed + +- Reduced allocation and copying by reusing sync receive and async send + buffers, using stack-allocated frame headers, and moving owned metadata. + ([#328]) +- Coalesced sync and async frame headers with a bounded payload prefix, + reused sender buffers, and removed boxed futures from internal connection + delegates. ([#327], [#328], [#337]) +- Raised the declared minimum supported Rust version from 1.70 to 1.80 and + added CI coverage for both protobuf backends and the code generators on + Rust 1.80. ([#333]) + +### Fixed + +- Enforced async unary request deadlines during queueing and writing, and + cleaned up pending registrations when requests time out or are cancelled. + ([#318]) +- Preserved client stream frame ordering, including data and close frames. + ([#312]) +- Closed async connections after writer failures. ([#324]) +- Validated the complete encoded request size, including the protobuf envelope. + ([#286]) ## [0.9.0] - 2025-07-15 @@ -519,6 +573,7 @@ are ordered by publication date rather than version number. [Keep a Changelog]: https://keepachangelog.com/en/2.0.0/ [Semantic Versioning]: https://semver.org/spec/v2.0.0.html +[0.10.0]: https://github.com/containerd/ttrpc-rust/compare/v0.9.0...v0.10.0 [0.9.0]: https://github.com/containerd/ttrpc-rust/compare/cfe37a2c...f31f5925 [0.8.6]: https://github.com/containerd/ttrpc-rust/compare/af812a6f...44d34d5c [0.5.10]: https://github.com/containerd/ttrpc-rust/compare/9a79290f...5784dc00 @@ -564,3 +619,14 @@ are ordered by publication date rather than version number. [0.2.1]: https://github.com/containerd/ttrpc-rust/compare/fce4b488...90d85de6 [0.2.0]: https://github.com/containerd/ttrpc-rust/compare/76888ad7...fce4b488 [0.1.0]: https://github.com/containerd/ttrpc-rust/commits/76888ad7 +[#286]: https://github.com/containerd/ttrpc-rust/pull/286 +[#312]: https://github.com/containerd/ttrpc-rust/pull/312 +[#316]: https://github.com/containerd/ttrpc-rust/pull/316 +[#318]: https://github.com/containerd/ttrpc-rust/pull/318 +[#320]: https://github.com/containerd/ttrpc-rust/pull/320 +[#324]: https://github.com/containerd/ttrpc-rust/pull/324 +[#327]: https://github.com/containerd/ttrpc-rust/pull/327 +[#328]: https://github.com/containerd/ttrpc-rust/pull/328 +[#329]: https://github.com/containerd/ttrpc-rust/pull/329 +[#333]: https://github.com/containerd/ttrpc-rust/pull/333 +[#337]: https://github.com/containerd/ttrpc-rust/pull/337 diff --git a/Cargo.toml b/Cargo.toml index 78e6ab48..7a527754 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ authors = ["The AntFin Kata Team "] # workspace by specifying `workspace = true` instead of the crate # version. For example, for protobuf: # protobuf = { workspace = true } -ttrpc = { version = "0.9.0", path = "./" } +ttrpc = { version = "0.10.0", path = "./" } ttrpc-codegen = { version = "0.7.0", path = "./ttrpc-codegen" } ttrpc-compiler = { version = "0.9.0", path = "./compiler" } protobuf = "3.7.2" @@ -37,7 +37,7 @@ protobuf-parse = "3.7.2" [package] name = "ttrpc" -version = "0.9.0" +version = "0.10.0" authors = { workspace = true } edition = { workspace = true } license = { workspace = true } diff --git a/README.md b/README.md index 2169e3fe..28a64e00 100644 --- a/README.md +++ b/README.md @@ -71,10 +71,10 @@ Add the runtime, Protocol Buffers support, and build-time generator: ```toml [dependencies] protobuf = "3.7" -ttrpc = "0.9" +ttrpc = "0.10" [build-dependencies] -ttrpc-codegen = "0.6" +ttrpc-codegen = "0.7.0" ``` For async clients, servers, and streaming, use the following dependency set: @@ -83,11 +83,11 @@ For async clients, servers, and streaming, use the following dependency set: [dependencies] async-trait = "0.1" protobuf = "3.7" -ttrpc = { version = "0.9", features = ["async"] } +ttrpc = { version = "0.10", features = ["async"] } tokio = { version = "1", features = ["macros", "rt"] } [build-dependencies] -ttrpc-codegen = "0.6" +ttrpc-codegen = "0.7.0" ``` Define a service in `proto/greeter.proto`: @@ -179,23 +179,22 @@ You can generate only one side with `async_client` or `async_server`. Streaming ## Using Prost -Prost support in this checkout uses `prost` 0.13 and requires `protoc` on `PATH` -for both the runtime build and application code generation. Use a local dependency -on the checkout to try the current implementation: +Prost support uses `prost` 0.13 and requires `protoc` on `PATH` for both the +runtime build and application code generation: ```toml [dependencies] prost = "0.13" -ttrpc = { path = "../ttrpc-rust", default-features = false, features = ["sync", "prost"] } +ttrpc = { version = "0.10", default-features = false, features = ["sync", "prost"] } [build-dependencies] -ttrpc-codegen-prost = { version = "0.1", path = "../ttrpc-rust/ttrpc-codegen-prost" } +ttrpc-codegen-prost = "0.1" ``` -Adjust the paths to your checkout. The `ttrpc-codegen-prost` package is separate -from the rust-protobuf `ttrpc-codegen` package; its first release is planned as -version 0.1. The two protobuf backend features are mutually exclusive. Because disabling -default features also disables `sync`, list the runtime features explicitly. +The `ttrpc-codegen-prost` package is separate from the rust-protobuf +`ttrpc-codegen` package and uses its own version line. The two protobuf backend +features are mutually exclusive. Because disabling default features also +disables `sync`, list the runtime features explicitly. Use `.prost()` in `build.rs`. Set `Customize::async_all = true` for async bindings and enable the runtime's `async` feature; generated async bindings also require @@ -269,6 +268,10 @@ ttrpc does not provide TLS. If you expose TCP beyond a trusted boundary, secure - Enable exactly one of `rustprotobuf` and `prost`; never use `--all-features` for the runtime. - Keep `protobuf`, `protobuf-codegen`, and generated sources on matching versions. Regenerate bindings after changing the Protocol Buffers runtime version. +For release notes and API migration details, see the +[runtime](./CHANGELOG.md), [compiler](./compiler/CHANGELOG.md), +and [codegen](./ttrpc-codegen/CHANGELOG.md) changelogs. + ## Development ```bash diff --git a/RELEASE.md b/RELEASE.md index b208e581..7b09bc33 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,12 +1,22 @@ # Release Process -This document describes the steps to release a new version of the crate or wasi-demo-app images. +This document describes how to release the ttrpc runtime and code generators. ## Crate Release Process +### Versioning + +Choose versions relative to each crate's latest published release, not an +unpublished version already present on the development branch. For `0.x.y` +crates, incompatible changes require incrementing `x` and resetting `y` to zero, +following [Cargo's compatibility rules]. Check both the generator's public API +(including re-exported dependency types) and the generated bindings. + +[Cargo's compatibility rules]: https://doc.rust-lang.org/cargo/reference/semver.html#change-categories + ### Release Steps -1. Add a new dated release section to the relevant crate changelog: +1. Add a release section for the target version to the relevant crate changelog: * `./CHANGELOG.md` for `ttrpc`. * `./compiler/CHANGELOG.md` for `ttrpc-compiler`. * `./ttrpc-codegen/CHANGELOG.md` for `ttrpc-codegen`. @@ -16,19 +26,32 @@ This document describes the steps to release a new version of the crate or wasi- * `./ttrpc-codegen/Cargo.toml`: Bump the package version as needed. * `./Cargo.toml`: Bump package version as needed. Then bump the workspace dependencies version to match the respective crates versions. * `./ttrpc-codegen-prost/Cargo.toml`: Bump `ttrpc-codegen-prost` as needed and update its dependency version in `./example-prost/Cargo.toml`. -3. Commit the changes and get them merged in the repo. -4. Dry run the `cargo publish` command as follows: +3. Update dependency examples, compatibility tables, and migration notes in + the READMEs and crate-level API documentation (`src/lib.rs`). +4. Validate the release using the toolchain pinned in `rust-toolchain.toml`: + ```bash + cargo build -p ttrpc-example --examples + cargo test --workspace --features sync,async,security_extension + cargo test -p ttrpc --no-default-features --features sync,async,prost,security_extension + make check-all + ``` + These commands are for Unix; `security_extension` is not supported on + Windows. Run the standalone Prost generator checks below as well. + Cargo.lock files are not tracked in this repository. These validation + commands generate them; keep them for the locked publish checks. Run + validation sequentially because example tests start Cargo subprocesses. +5. Commit the release changes and dry run publishing the workspace crates: ```bash - cargo +nightly publish \ - -Z package-workspace \ + cargo publish \ --dry-run \ --locked \ -p ttrpc \ -p ttrpc-codegen \ -p ttrpc-compiler ``` -5. If the dry run succeeds, publish the crates that need publishing using - `cargo publish -p ` in the following order: +6. After the release changes are merged and all checks pass, publish the + selected crates from the validated revision using + `cargo publish --locked -p ` in the following order: 1. `ttrpc-compiler` 2. `ttrpc-codegen` 3. `ttrpc` @@ -41,6 +64,7 @@ publish it separately when selected for release: ```bash cargo test --manifest-path ttrpc-codegen-prost/Cargo.toml +make -C ttrpc-codegen-prost check cargo build --manifest-path example-prost/Cargo.toml --examples cargo publish --manifest-path ttrpc-codegen-prost/Cargo.toml --dry-run --locked # After the dry run succeeds and the release changes are merged: diff --git a/src/lib.rs b/src/lib.rs index f829b646..d3795934 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,20 +33,21 @@ //! //! ```toml //! [dependencies] -//! ttrpc = "0.9" +//! protobuf = "3.7" +//! ttrpc = "0.10" //! //! [build-dependencies] -//! ttrpc-codegen = "0.6" +//! ttrpc-codegen = "0.7" //! ``` //! //! To use the Tokio runtime, disable the default synchronous runtime or enable both: //! //! ```toml //! # Async only -//! ttrpc = { version = "0.9", default-features = false, features = ["async", "rustprotobuf"] } +//! ttrpc = { version = "0.10", default-features = false, features = ["async", "rustprotobuf"] } //! //! # Sync and async -//! # ttrpc = { version = "0.9", features = ["async"] } +//! # ttrpc = { version = "0.10", features = ["async"] } //! ``` //! //! Generate message types and service bindings from `build.rs`: @@ -74,6 +75,10 @@ //! helper for the server. See the repository's complete [client, server, and streaming examples] //! for working programs. //! +//! When upgrading from ttrpc 0.9, use ttrpc-codegen 0.7 and ttrpc-compiler 0.9, +//! regenerate bindings, and review the [runtime changelog]. The runtime and generators +//! require Rust 1.80 or newer. +//! //! # Choosing a runtime //! //! | Runtime | Feature | Execution model | Streaming | @@ -91,15 +96,18 @@ //! uses Prost message types. Enable exactly one backend and pair it with `sync`, `async`, or //! both runtime features. Disabling default features also disables `sync` and `rustprotobuf`. //! -//! To use the Prost implementation from a checkout of this repository: +//! To use the Prost backend: //! //! ```toml //! [dependencies] //! prost = "0.13" -//! ttrpc = { path = "../ttrpc-rust", default-features = false, features = ["sync", "prost"] } +//! ttrpc = { version = "0.10", default-features = false, features = ["sync", "prost"] } +//! +//! [build-dependencies] +//! ttrpc-codegen-prost = "0.1" //! ``` //! -//! Adjust the path to your checkout. Install `protoc` for the runtime build and application +//! Install `protoc` for the runtime build and application //! code generation, and use the separate [Prost generator] in `ttrpc-codegen-prost/`. Its builder uses //! `.prost()` and supports `Customize::async_all` for async and streaming bindings. //! Generated Rust modules follow the protobuf package name; see the [Prost examples] for @@ -187,6 +195,7 @@ //! [client, server, and streaming examples]: https://github.com/containerd/ttrpc-rust/tree/master/example //! [Prost generator]: https://github.com/containerd/ttrpc-rust/tree/master/ttrpc-codegen-prost //! [Prost examples]: https://github.com/containerd/ttrpc-rust/tree/master/example-prost +//! [runtime changelog]: https://github.com/containerd/ttrpc-rust/blob/v0.10.0/CHANGELOG.md //! [ttrpc]: https://github.com/containerd/ttrpc //! [`ttrpc-codegen`]: https://docs.rs/ttrpc-codegen