Skip to content

Commit f83ec94

Browse files
committed
Add anthropics/buffa plugin v0.5.2
1 parent 67027ac commit f83ec94

6 files changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source:
2+
crates:
3+
crate_name: protoc-gen-buffa
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!Dockerfile
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# syntax=docker/dockerfile:1.23
2+
FROM rust:1.95.0-alpine3.23@sha256:606fd313a0f49743ee2a7bd49a0914bab7deedb12791f3a846a34a4711db7ed2 AS builder
3+
RUN apk add --no-cache musl-dev
4+
WORKDIR /app
5+
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
6+
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked --mount=type=cache,target=/root/target \
7+
cargo install protoc-gen-buffa --version 0.5.2 --locked --root /app
8+
9+
FROM gcr.io/distroless/static-debian13:latest@sha256:47b2d72ff90843eb8a768b5c2f89b40741843b639d065b9b937b07cd59b479c6 AS base
10+
11+
FROM scratch
12+
COPY --link --from=base / /
13+
COPY --link --from=builder /app/bin/protoc-gen-buffa /protoc-gen-buffa
14+
USER nobody
15+
ENTRYPOINT ["/protoc-gen-buffa"]
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
version: v1
2+
name: buf.build/anthropics/buffa
3+
plugin_version: v0.5.2
4+
source_url: https://github.com/anthropics/buffa
5+
description: Generates Rust message types with buffa, a zero-copy Protobuf implementation with editions support and no_std compatibility.
6+
output_languages:
7+
- rust
8+
spdx_license_id: Apache-2.0
9+
license_url: https://github.com/anthropics/buffa/blob/v0.5.2/LICENSE
10+
registry:
11+
cargo:
12+
rust_version: "1.85"
13+
deps:
14+
# Runtime: wire format, Message trait, view types, JSON helpers.
15+
# https://github.com/anthropics/buffa/blob/v0.5.2/buffa/Cargo.toml
16+
- name: "buffa"
17+
req: "0.5.2"
18+
default_features: true
19+
features:
20+
- json
21+
# Well-known types (Timestamp, Duration, Any, Struct, etc.).
22+
# Generated code references these via the auto-injected
23+
# extern_path mapping `.google.protobuf` -> `::buffa_types::google::protobuf`.
24+
- name: "buffa-types"
25+
req: "0.5.2"
26+
default_features: true
27+
features:
28+
- json
29+
# Generated code derives `::serde::Serialize` / `::serde::Deserialize`
30+
# directly when json=true, so serde must be a direct dep.
31+
- name: "serde"
32+
req: "1"
33+
default_features: true
34+
features:
35+
- derive
36+
opts:
37+
# Enable serde derives + proto3 JSON mapping helpers. Required for
38+
# downstream plugins that need the Connect protocol's JSON codec.
39+
- json=true
40+
# Zero-copy view types. Default, but explicit for clarity.
41+
- views=true
42+
# Emit one `<dotted.package>.rs` per proto package instead of one
43+
# file per proto file. Matches the prost/tonic filename convention
44+
# the BSR Rust SDK lib.rs synthesis expects.
45+
- file_per_package=true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h1:ktcklOdY2UGmhTov4n3zaTVV0iCPTFbaog1tzH7DP/c=
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
h1:kF+N9OmF6c28gEY8W515PuHMwC/Cf0aA5oCSzA1URIw=

0 commit comments

Comments
 (0)