Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/bvt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: |
cargo test --workspace --features async,sync,security_extension
cargo test -p ttrpc --no-default-features --features sync,async,prost
cargo test --manifest-path codegen/Cargo.toml
cargo test --manifest-path ttrpc-codegen-prost/Cargo.toml

check:
name: Check
Expand All @@ -40,9 +40,9 @@ jobs:
- name: Check
run: |
make check-all
# The codegen crate is a standalone workspace root, so its checks
# The ttrpc-codegen-prost crate is a standalone workspace root, so its checks
# must be invoked explicitly (protoc is required for its tests).
make -C codegen check
make -C ttrpc-codegen-prost check

make:
name: Build
Expand All @@ -63,7 +63,7 @@ jobs:
make -C ttrpc-codegen
make -C example build-examples
make -C example-prost build-examples
make -C codegen test
make -C ttrpc-codegen-prost test
# Keep bash so a native-command failure on Windows isn't masked by a
# later successful command (PowerShell swallows non-zero exits).
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
# they are standalone crates and intentionally kept decoupled from the
# rustprotobuf-oriented workspace members above.
exclude = [
"./codegen",
"./ttrpc-codegen-prost",
"./example-prost",
]
resolver = "2"
Expand All @@ -29,8 +29,8 @@ authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
# version. For example, for protobuf:
# protobuf = { workspace = true }
ttrpc = { version = "0.9.0", path = "./" }
ttrpc-codegen = { version = "0.6.0", path = "./ttrpc-codegen" }
ttrpc-compiler = { version = "0.8.0", path = "./compiler" }
ttrpc-codegen = { version = "0.6.1", 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"
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,18 @@ prost = "0.13"
ttrpc = { path = "../ttrpc-rust", default-features = false, features = ["sync", "prost"] }

[build-dependencies]
ttrpc-codegen = { path = "../ttrpc-rust/codegen" }
ttrpc-codegen-prost = { version = "0.1", path = "../ttrpc-rust/ttrpc-codegen-prost" }
```

Adjust the paths to your checkout. The Prost generator in `codegen/` is a separate
crate from the rust-protobuf generator in `ttrpc-codegen/`; select the appropriate
path. The two protobuf backend features are mutually exclusive. Because disabling
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.

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
`async-trait` in your application. Streaming requires async bindings. The
[Prost generator guide](./codegen/README.md) includes a complete dependency setup,
[Prost generator guide](./ttrpc-codegen-prost/README.md) includes a complete dependency setup,
service definition, build script, and generated-module import.

Generated Rust files and modules follow the protobuf package rather than the
Expand Down Expand Up @@ -230,7 +230,7 @@ you inspect the Prost APIs and fails on documentation warnings. The generator's
own documentation is built separately:

```bash
RUSTDOCFLAGS="-D warnings" cargo doc --manifest-path codegen/Cargo.toml --no-deps --open
RUSTDOCFLAGS="-D warnings" cargo doc --manifest-path ttrpc-codegen-prost/Cargo.toml --no-deps --open
```

## Transport addresses
Expand All @@ -253,7 +253,7 @@ ttrpc does not provide TLS. If you expose TCP beyond a trusted boundary, secure
| [`ttrpc-codegen`](https://crates.io/crates/ttrpc-codegen) | Build-script API for parsing `.proto` files and generating Rust code |
| [`ttrpc-compiler`](https://crates.io/crates/ttrpc-compiler) | Service code generator and `protoc` plugin |
| [`example`](https://github.com/containerd/ttrpc-rust/tree/master/example) | End-to-end unary and streaming examples using rust-protobuf |
| [Prost generator](./codegen) | Standalone build-script generator using Prost and `protoc` |
| [`ttrpc-codegen-prost`](./ttrpc-codegen-prost) | Standalone build-script generator using Prost and `protoc` |
| [`example-prost`](./example-prost) | Standalone unary and streaming examples using Prost |

## Compatibility
Expand All @@ -276,8 +276,8 @@ make test
make check-all

# The Prost generator is a separate workspace
make -C codegen test
make -C codegen check
make -C ttrpc-codegen-prost test
make -C ttrpc-codegen-prost check
```

## Project details
Expand Down
19 changes: 19 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ This document describes the steps to release a new version of the crate or wasi-
* `./CHANGELOG.md` for `ttrpc`.
* `./compiler/CHANGELOG.md` for `ttrpc-compiler`.
* `./ttrpc-codegen/CHANGELOG.md` for `ttrpc-codegen`.
* `./ttrpc-codegen-prost/CHANGELOG.md` for `ttrpc-codegen-prost`.
2. Bump package and dependency versions in:
* `./compiler/Cargo.toml`: Bump the package version as needed.
* `./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:
```bash
Expand All @@ -30,3 +32,20 @@ This document describes the steps to release a new version of the crate or wasi-
1. `ttrpc-compiler`
2. `ttrpc-codegen`
3. `ttrpc`

### Standalone Prost Generator

`ttrpc-codegen-prost` lives in `ttrpc-codegen-prost/` and is a separate workspace. It is
not included in the root workspace publish commands above. Validate and
publish it separately when selected for release:

```bash
cargo test --manifest-path ttrpc-codegen-prost/Cargo.toml
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:
cargo publish --manifest-path ttrpc-codegen-prost/Cargo.toml --locked
```

Keep its package version and release notes independent from the
rust-protobuf `ttrpc-codegen` package.
8 changes: 8 additions & 0 deletions compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ 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]

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

## [0.8.0] - 2025-07-15

### API changes
Expand Down
8 changes: 3 additions & 5 deletions compiler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ttrpc-compiler"
version = "0.8.0"
version = "0.9.0"
edition = { workspace = true }
rust-version = { workspace = true }
license = { workspace = true }
Expand All @@ -15,10 +15,8 @@ homepage = "https://github.com/containerd/ttrpc-rust/tree/master/compiler"
[dependencies]
protobuf = { workspace = true }
protobuf-codegen = { workspace = true }
prost = "0.8"
prost-build = "0.8"
prost-types = "0.8"
derive-new = "0.5"

[dev-dependencies]
tempfile = "3.0"

[[bin]]
Expand Down
2 changes: 0 additions & 2 deletions compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

/// Generates ttrpc service bindings from Protocol Buffers descriptors.
pub mod codegen;
/// Legacy Prost-based code generation helpers.
pub mod prost_codegen;
mod util;

/// Customize generated code.
Expand Down
Loading
Loading