Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,58 @@ 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.

## [0.10.0] - 2026-09-30

### 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 async frame headers with a bounded payload prefix and removed
boxed futures from internal connection delegates. ([#327], [#328])
- 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

### API changes
Expand Down Expand Up @@ -519,6 +571,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
Expand Down Expand Up @@ -564,3 +617,13 @@ 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
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
# workspace by specifying `workspace = true` instead of the crate
# version. For example, for protobuf:
# protobuf = { workspace = true }
ttrpc = { version = "0.9.0", path = "./" }
ttrpc-codegen = { version = "0.6.1", path = "./ttrpc-codegen" }
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"
protobuf-codegen = "3.7.2"
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 }
Expand Down
56 changes: 43 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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`:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -269,6 +268,37 @@ 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.

### Upgrading from 0.9

Upgrade the runtime and generators together, then regenerate checked-in bindings:

| Component | Version for this release |
| --- | --- |
| `ttrpc` | 0.10 |
| `ttrpc-codegen` (rust-protobuf) | 0.7 |
| `ttrpc-compiler` (also used by `ttrpc-codegen`) | 0.9 |
| `ttrpc-codegen-prost` (Prost) | 0.1 |

- With default features disabled, explicitly select `rustprotobuf` or `prost`
as well as `sync` and/or `async`. For Prost, follow [Using Prost](#using-prost).
- Import `Customize` from `ttrpc_codegen`, or upgrade a direct
`ttrpc-compiler` dependency to 0.9. The 0.8 and 0.9 types are not interchangeable.
- Generated RPC inputs and outputs for canonical Google well-known types now
use `protobuf::well_known_types` unless their proto files are explicitly
selected for generation. Update affected service signatures and call sites.
- Code that constructs server contexts directly must initialize the new
sync `conn_ctx` or async `connection_data` field. `Default::default()` gives
either field an empty context; async contexts also support `..Default::default()`.
- Custom `proto::Codec` implementations must implement `merge`.
`asynchronous::StreamInner::new` is no longer public; use generated clients
and typed stream APIs. Custom sync handlers should use `TtrpcContext::respond`
or `send_response` so connection payload transforms are applied.

The removed `ttrpc_compiler::prost_codegen` module generated grpcio bindings.
For ttrpc with Prost, use the separate `ttrpc-codegen-prost` package.
See the [runtime](./CHANGELOG.md), [compiler](./compiler/CHANGELOG.md), and
[codegen](./ttrpc-codegen/CHANGELOG.md) changelogs for the full API changes.

## Development

```bash
Expand Down
50 changes: 43 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# 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.

The v0.10.0 release set is:

| Crate | Previous release | New release |
| --- | --- | --- |
| `ttrpc` | 0.9.0 | 0.10.0 |
| `ttrpc-compiler` | 0.8.0 | 0.9.0 |
| `ttrpc-codegen` | 0.6.0 | 0.7.0 |
| `ttrpc-codegen-prost` | Unpublished | 0.1.0 |

The example crates have `publish = false` and use local path dependencies;
their package versions are independent of this release.

[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:
Expand All @@ -16,19 +38,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 <crate>` 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 <crate>` in the following order:
1. `ttrpc-compiler`
2. `ttrpc-codegen`
3. `ttrpc`
Expand All @@ -41,6 +76,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:
Expand Down
36 changes: 34 additions & 2 deletions compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,39 @@ 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.

## [Unreleased]
## [0.9.0] - 2026-09-30

### 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

Expand Down Expand Up @@ -183,6 +209,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
Expand All @@ -199,3 +226,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
27 changes: 19 additions & 8 deletions compiler/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
[0.10 migration guide](../README.md#upgrading-from-09) and
[compiler changelog](./CHANGELOG.md) before upgrading.
Loading
Loading