Skip to content

examples/bazel: update to connectrpc 0.7.0 / buffa 0.7.0 and fix codegen rules#161

Merged
iainmcgin merged 1 commit into
mainfrom
bazel-lock-0.7.0
Jun 11, 2026
Merged

examples/bazel: update to connectrpc 0.7.0 / buffa 0.7.0 and fix codegen rules#161
iainmcgin merged 1 commit into
mainfrom
bazel-lock-0.7.0

Conversation

@iainmcgin

Copy link
Copy Markdown
Collaborator

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: buffa 0.6.0 → 0.7.0, connectrpc 0.6.1 → 0.7.0.
  • examples/bazel/Cargo.lock: targeted cargo 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.rs plus the <pkg>.greet.__view.rs companion
  • protoc-gen-connect-rust: <pkg>.greet.__connect.rs (not <pkg>.greet.rs)
  • protoc-gen-buffa-packaging: a per-package <pkg>.mod.rs stitcher in addition to the root mod.rs

Both genrules' outs, the byte-identical-output sh_test pairs, the rust_library srcs, and the README's output-naming section are updated to match (7 files per tree-pair instead of 4).

Verification

  • cargo check in examples/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 //... and bazel test //... pass with Bazel 8.3.1, using the v0.7.0-tagged buffa plugins and protoc-gen-connect-rust built 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_test rule, so bazel build //... fails at package loading under a current bazelisk default. Verified with 8.3.1. A .bazelversion (or migrating to rules_shell) would close that off — happy to do it as a separate change.

…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.
@github-actions

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@iainmcgin iainmcgin marked this pull request as ready for review June 11, 2026 02:51
@iainmcgin iainmcgin requested a review from rpb-ant June 11, 2026 02:51
@iainmcgin iainmcgin added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit b2e9520 Jun 11, 2026
13 checks passed
@iainmcgin iainmcgin deleted the bazel-lock-0.7.0 branch June 11, 2026 03:10
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants