examples/bazel: update to connectrpc 0.7.0 / buffa 0.7.0 and fix codegen rules#161
Merged
Conversation
…gen rules Bump the example's dependency pins to the published 0.7.0 crates and regenerate Cargo.lock with a targeted update (the lockfile was still at connectrpc 0.6.0 since the 0.6.1 bump was closed unmerged). Verifying the bump exposed that the genrules declared an output layout the plugins have not produced since companion files were introduced: protoc-gen-buffa also emits a __view.rs companion, the connect stubs live in __connect.rs rather than <stem>.rs, and the packaging plugin emits a per-package mod stitcher alongside the root mod.rs. Update both genrules' outs, the byte-identical-output test pairs, the rust_library srcs, and the README to the current seven-file layout. Verified with Bazel 8.3.1: build and all three tests pass, including the protoc-vs-buf byte-identical check, against crates.io 0.7.0 deps resolved by crates_universe from the new lockfile.
|
All contributors have signed the CLA ✍️ ✅ |
rpb-ant
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Post-release follow-up for 0.7.0: point the Bazel example at the published crates, and repair its codegen rules, which had silently drifted from the plugins' output layout.
Dependency bump
examples/bazel/Cargo.toml:buffa0.6.0 → 0.7.0,connectrpc0.6.1 → 0.7.0.examples/bazel/Cargo.lock: targetedcargo update -p connectrpc -p buffa(no blanket transitive refresh). buffa 0.7.0 pulls in its new transitive deps (compact_str,ecow,smol_str,castaway,static_assertions,cfg_aliases,ryu). The lockfile was still at connectrpc 0.6.0 — examples/bazel: regenerate Cargo.lock against connectrpc 0.6.1 #142 (the 0.6.1 bump) was closed unmerged when the 0.7.0 cycle superseded it — so this catches the example up two releases.BUILD.bazel repair
Verifying the bump exposed that the example's genrules declare an output layout the plugins have not produced since 0.4.0 introduced companion files. Nothing in CI builds this example, and the interim release follow-ups (#124, #142) only touched the lockfile, so the breakage went unnoticed. Current plugin output per proto file:
protoc-gen-buffa:<pkg>.greet.rsplus the<pkg>.greet.__view.rscompanionprotoc-gen-connect-rust:<pkg>.greet.__connect.rs(not<pkg>.greet.rs)protoc-gen-buffa-packaging: a per-package<pkg>.mod.rsstitcher in addition to the rootmod.rsBoth genrules'
outs, the byte-identical-outputsh_testpairs, therust_librarysrcs, and the README's output-naming section are updated to match (7 files per tree-pair instead of 4).Verification
cargo checkinexamples/bazel/compiles the dependency stub against the published 0.7.0 crates with the example's feature set (default-features = false, features = ["server", "client"]).bazel build //...andbazel test //...pass with Bazel 8.3.1, using the v0.7.0-tagged buffa plugins andprotoc-gen-connect-rustbuilt from this repo: both codegen paths (protoc-direct and buf-driven) produce the declared outputs, the byte-identical diff test passes, and the generated-code unit tests compile and pass against the crates.io 0.7.0 dependencies resolved by crates_universe from the new lockfile.Not addressed here
The example pins no Bazel version, and Bazel 9 removes the built-in
sh_testrule, sobazel build //...fails at package loading under a current bazelisk default. Verified with 8.3.1. A.bazelversion(or migrating torules_shell) would close that off — happy to do it as a separate change.