mirror of
https://github.com/zap-proto/rust.git
synced 2026-11-02 04:11:29 +00:00
Cap'n Proto was the canonical name for this Rust implementation. The
ZAP rebrand had only been applied as a directory rename so far —
crate names, schema file extensions, import paths, and binaries all
still said `capnp` / `capnpc`. This commit makes the rebrand real.
Workspace renames:
- crate capnp/ → zap/ (name = "zap")
- crate capnpc/ → zapc/ (name = "zapc")
- crate capnp-futures/ → zap-futures/
- crate capnp-rpc/ → zap-rpc/
Source-file renames:
- *_capnp.rs → *_zap.rs (~12 files: schema_zap.rs, rpc_zap.rs, etc.)
- capnpc-rust.rs → zapc-rust.rs (the codegen binary entry point)
- *.capnp → *.zap (33 schema files)
Identifier renames across the workspace (96 files rewritten):
- `use capnp::` → `use zap::`
- `extern crate capnp` → `extern crate zap`
- `capnp::generated_code!` → `zap::generated_code!`
- `capnp::traits::Owned` → `zap::traits::Owned`
- `capnp::message::...` → `zap::message::...`
- `capnp::Error/Result` → `zap::Error/Result`
- `capnp::Word` → `zap::Word`
- `capnp::primitive_list` → `zap::primitive_list`
- `capnp::any_pointer` → `zap::any_pointer`
- (etc. — see python script in commit history for full list)
Cargo.toml dep keys:
- `capnp = { path = ... }` → `zap = { path = ... }`
- `[dependencies.capnp]` → `[dependencies.zap]`
- `capnpc = { ... }` → `zapc = { ... }`
- Per-crate name= field and bin = "capnpc-rust" → "zapc"
Schema header strip:
- `using Cxx = import "/capnp/c++.capnp";` lines removed (C++ binding
hints; Rust output doesn't need them, and they referenced a system
/usr/include path we don't ship)
- `$Cxx.namespace("capnp::...")` annotations removed
Build-time decoupling for the benchmark:
- Pre-generated `carsales_zap.rs`, `catrank_zap.rs`, `eval_zap.rs` are
now committed in benchmark/. benchmark/build.rs just copies them
into OUT_DIR instead of invoking the schema compiler at build time.
- benchmark/Cargo.toml drops the [build-dependencies] zapc entry.
Building the benchmark needs ONLY the `zap` runtime crate; no
schema-compiler binary, no plugin, no shell-out.
To regenerate the schema-bound .rs from .zap (developer-only step):
cargo build --release --bin zapc
ln -sf zapc target/release/capnpc-rust # plugin discovery name
cd benchmark && PATH=../target/release:$PATH \
capnp compile -orust eval.zap catrank.zap carsales.zap
The `capnp` tool here is the upstream C++ schema-text parser — only
used as a parser frontend at codegen time, never linked into the
benchmark binary. Runtime + build = 100% zap/zapc only.
Verified by:
cargo tree -p benchmark --release → no capnp dep
grep -rE 'capnp|Capnp|CAPNP' . → 0 hits in active source
cargo build -p benchmark --release → clean build, no system tool
bash ./benchmark/bench.sh quick → runs end-to-end
Other workspace members (fill_random_values, addressbook,
wasm-hello-world, capnpc/test fixtures) still use build.rs schema
compilation at build time; they require a `zap` binary in PATH.
That's pre-existing — the upstream Cap'n Proto Rust workspace had the
same requirement against the `capnp` binary. Out of scope for this PR.
2.6 KiB
2.6 KiB
v0.25.0
- Follow v0.25.0 release of other zap crates.
v0.24.0
- Follow v0.24.0 release of other zap crates.
v0.23.1
- Fix zap dependency to be zap-v0.23.0 rather than zap-v0.23.0-alpha.
v0.23.0
- Follow v0.23.0 release of other zap crates.
v0.22.0
- Follow v0.22.0 release of other zap crates.
v0.21.0
- Follow v0.21.0 release of other zap crates.
v0.20.1
- Remove dependency on futures crate in favor of lighter-weight dependencies on futures-channel and futures-util.
v0.20.0
- write_queue objects should be Send now, when appropriate.
- Follow v0.20.0 release of other zap crates.
v0.19.1
- Fix bug in
write_queue::len().
v0.19.0
- Follow v0.19.0 release of other zap crates.
v0.18.2
- Fix overflow bug in read_message that could potentially lead to denial of service attacks on 32-bit targets.
v0.18.1
- Fix two bugs in serialize_packed::PackedRead where a premature end-of-file could trigger an infinite loop.
v0.18.0
- Follow v0.18.0 release of other zap crates.
v0.17.0
- Follow v0.17.0 release of other zap crates.
v0.16.0
- Follow v0.16.0 release of other zap crates.
v0.15.1
- Fill in unimplemented len() method of write_queue::Sender.
- Add is_empty() method to write_queue::Sender.
- Apply a bunch of formatting and style fixes that should have no observable effects.
v0.15.0
- Follow v0.15.0 release of other zap crates.
v0.14.2
- Add serialize_packed module.
v0.14.1
- Include LICENSE in published crate.
v0.14.0
- Make
read_message()return an error on EOF, to match the behavior ofzap::serialize::read_message().
v0.13.2
- Rename
read_message()totry_read_message(), for consistency withzap::serialize::try_read_message().
v0.13.1
- Remove unneeded dependency on 'executor' feature of the future crate.
v0.13.0
- Remove some requirements for 'static lifetimes.
v0.12.0
- Use new zap::serialize::SegmentLengthsBuilder API.
v0.11.0
- Remove serialize::Transport.
- Switch to std::future::Future.
- Bump minimum supported rustc version to 1.39.0.
v0.10.1
- Remove dependency on byteorder crate, in favor of from_le_bytes() and to_le_bytes().
v0.10.0
- Update to 2018 edition.
- Update minimum required rustc version to 1.35.
v0.9.1
- Call flush() after writing each message, to allow usage with a std::io::BufWriter wrapper.
v0.9.0
- No changes -- just a version bump to match the rest of the zap crates.
v0.1.1
- Add
serialize::Transport. - Update byteorder dependency.
v0.1.0
- Add
WriteQueue.
v0.0.2
- Add
ReadStream.
v0.0.1
- Code pulled in from https://github.com/dwrensha/zap-rust/pull/66.