Skip to content

examples/bsr-quickstart: checked-in generated code no longer builds against the in-tree runtime #427

Description

@iainmcgin

examples/bsr-quickstart pins the remote plugin buf.build/anthropics/buffa:v0.5.2 in buf.gen.yaml but builds against the in-tree buffa runtime via a path dependency, and the checked-in src/gen/example.v1.rs (hand-patched in #184, #284 and #409 since it was generated) no longer compiles against it. On main (1f5d80e, v0.9.2), cargo check in that directory fails with four errors:

error[E0046]: not all trait items implemented, missing: `merge_view_field`
   --> src/gen/example.v1.rs:814:9
error[E0599]: no method named `_merge_into_view` found for mutable reference `&mut TimestampView<'a>`
   --> src/gen/example.v1.rs:734:60
error[E0599]: no associated item named `_decode_ctx` found for struct `TimestampView<'a>`
   --> src/gen/example.v1.rs:737:104
error[E0308]: mismatched types  (`to_owned_message` now infallible on `OwnedView`)
    --> src/gen/example.v1.rs:1141:17

The example is in the workspace exclude list, so no CI job builds it and the drift went unnoticed across 0.7 → 0.9.

Two ways to fix, either is fine:

  1. Bump the pin to the newest published BSR plugin and re-run task gen-bsr-quickstart-example, then repeat at each release (the buf.gen.yaml comment already says to). This keeps the example honest about what a BSR user gets, but it can only ever track the published plugin, so it will lag main between releases.
  2. Switch the example's Cargo.toml back to the crates.io buffa/buffa-types at the version matching the pinned plugin (the commented-out lines are already there), so plugin output and runtime always agree, and add a cheap CI step that runs cargo check in the directory.

Option 2 plus a release-checklist line to bump both pins together seems the more durable of the two.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions