From c42c7b7a4e33f4e5f84575799a6971a0fcf2b281 Mon Sep 17 00:00:00 2001 From: Iain McGinniss <309153+iainmcgin@users.noreply.github.com> Date: Tue, 17 Mar 2026 01:58:00 +0000 Subject: [PATCH] Add community/anthropics-buffa plugin v0.2.0 buffa is a zero-copy Rust Protobuf implementation with editions support (2023/2024), no_std compatibility, and view types for borrowed field access. Passes the protobuf conformance suite (5539 binary+JSON tests). The plugin emits one .rs file per proto file using a flat naming convention (`foo/v1/bar.proto` -> `foo.v1.bar.rs`), matching what BSR expects. Module tree assembly is a separate `protoc-gen-buffa-packaging` plugin in the same repo, not needed for BSR (which synthesizes lib.rs server-side). Crates: https://crates.io/crates/protoc-gen-buffa Repo: https://github.com/anthropics/buffa --- .../community/anthropics-buffa/source.yaml | 4 ++ .../anthropics-buffa/v0.2.0/.dockerignore | 2 + .../anthropics-buffa/v0.2.0/Dockerfile | 15 +++++++ .../anthropics-buffa/v0.2.0/buf.plugin.yaml | 41 +++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 plugins/community/anthropics-buffa/source.yaml create mode 100644 plugins/community/anthropics-buffa/v0.2.0/.dockerignore create mode 100644 plugins/community/anthropics-buffa/v0.2.0/Dockerfile create mode 100644 plugins/community/anthropics-buffa/v0.2.0/buf.plugin.yaml diff --git a/plugins/community/anthropics-buffa/source.yaml b/plugins/community/anthropics-buffa/source.yaml new file mode 100644 index 000000000..d5e3466d9 --- /dev/null +++ b/plugins/community/anthropics-buffa/source.yaml @@ -0,0 +1,4 @@ +source: + github: + owner: anthropics + repository: buffa diff --git a/plugins/community/anthropics-buffa/v0.2.0/.dockerignore b/plugins/community/anthropics-buffa/v0.2.0/.dockerignore new file mode 100644 index 000000000..5d0f124ff --- /dev/null +++ b/plugins/community/anthropics-buffa/v0.2.0/.dockerignore @@ -0,0 +1,2 @@ +* +!Dockerfile diff --git a/plugins/community/anthropics-buffa/v0.2.0/Dockerfile b/plugins/community/anthropics-buffa/v0.2.0/Dockerfile new file mode 100644 index 000000000..b7520e057 --- /dev/null +++ b/plugins/community/anthropics-buffa/v0.2.0/Dockerfile @@ -0,0 +1,15 @@ +# syntax=docker/dockerfile:1.19 +FROM rust:1.91.1-alpine3.22 AS builder +RUN apk add --no-cache musl-dev +WORKDIR /app +ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse +RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked --mount=type=cache,target=/root/target \ + cargo install protoc-gen-buffa --version 0.2.0 --locked --root /app + +FROM gcr.io/distroless/static-debian12:latest@sha256:87bce11be0af225e4ca761c40babb06d6d559f5767fbf7dc3c47f0f1a466b92c AS base + +FROM scratch +COPY --link --from=base / / +COPY --link --from=builder /app/bin/protoc-gen-buffa /protoc-gen-buffa +USER nobody +ENTRYPOINT ["/protoc-gen-buffa"] diff --git a/plugins/community/anthropics-buffa/v0.2.0/buf.plugin.yaml b/plugins/community/anthropics-buffa/v0.2.0/buf.plugin.yaml new file mode 100644 index 000000000..bad7a156f --- /dev/null +++ b/plugins/community/anthropics-buffa/v0.2.0/buf.plugin.yaml @@ -0,0 +1,41 @@ +version: v1 +name: buf.build/community/anthropics-buffa +plugin_version: v0.2.0 +source_url: https://github.com/anthropics/buffa +description: Generates Rust message types with buffa, a zero-copy Protobuf implementation with editions support and no_std compatibility. +output_languages: + - rust +spdx_license_id: Apache-2.0 +license_url: https://github.com/anthropics/buffa/blob/v0.2.0/LICENSE +registry: + cargo: + rust_version: "1.85" + deps: + # Runtime: wire format, Message trait, view types, JSON helpers. + # https://github.com/anthropics/buffa/blob/v0.2.0/buffa/Cargo.toml + - name: "buffa" + req: "0.2.0" + default_features: true + features: + - json + # Well-known types (Timestamp, Duration, Any, Struct, etc.). + # Generated code references these via the auto-injected + # extern_path mapping `.google.protobuf` -> `::buffa_types::google::protobuf`. + - name: "buffa-types" + req: "0.2.0" + default_features: true + features: + - json + # Generated code derives `::serde::Serialize` / `::serde::Deserialize` + # directly when json=true, so serde must be a direct dep. + - name: "serde" + req: "1" + default_features: true + features: + - derive + opts: + # Enable serde derives + proto3 JSON mapping helpers. Required for + # downstream plugins that need the Connect protocol's JSON codec. + - json=true + # Zero-copy view types. Default, but explicit for clarity. + - views=true