Skip to content

Commit 0a29d43

Browse files
Update prost and grpc-go plugins (#2120)
1 parent a96ed8f commit 0a29d43

File tree

26 files changed

+259
-0
lines changed

26 files changed

+259
-0
lines changed
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.19
2+
FROM rust:1.91.1-alpine3.22 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-prost-crate --version 0.5.0 --locked --root /app
8+
9+
FROM gcr.io/distroless/static-debian12:latest@sha256:87bce11be0af225e4ca761c40babb06d6d559f5767fbf7dc3c47f0f1a466b92c AS base
10+
11+
FROM scratch
12+
COPY --link --from=base / /
13+
COPY --link --from=builder /app/bin/protoc-gen-prost-crate /protoc-gen-prost-crate
14+
USER nobody
15+
ENTRYPOINT ["/protoc-gen-prost-crate"]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/community/neoeinstein-prost-crate
3+
plugin_version: v0.5.0
4+
source_url: https://crates.io/crates/protoc-gen-prost-crate
5+
description: Generates an include file and cargo manifest for turn-key crates.
6+
output_languages:
7+
- rust
8+
spdx_license_id: Apache-2.0
9+
license_url: https://github.com/neoeinstein/protoc-gen-prost/blob/protoc-gen-prost-crate-v0.5.0/LICENSE
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.19
2+
FROM rust:1.91.1-alpine3.22 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-prost-serde --version 0.4.0 --locked --root /app
8+
9+
FROM gcr.io/distroless/static-debian12:latest@sha256:87bce11be0af225e4ca761c40babb06d6d559f5767fbf7dc3c47f0f1a466b92c AS base
10+
11+
FROM scratch
12+
COPY --link --from=base / /
13+
COPY --link --from=builder /app/bin/protoc-gen-prost-serde /protoc-gen-prost-serde
14+
USER nobody
15+
ENTRYPOINT ["/protoc-gen-prost-serde"]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: v1
2+
name: buf.build/community/neoeinstein-prost-serde
3+
plugin_version: v0.4.0
4+
source_url: https://crates.io/crates/protoc-gen-prost-serde
5+
description: Generates serde serialization implementations that follow the conventions of protobuf-JSON.
6+
output_languages:
7+
- rust
8+
spdx_license_id: Apache-2.0
9+
license_url: https://github.com/neoeinstein/protoc-gen-prost/blob/protoc-gen-prost-serde-v0.4.0/LICENSE
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.19
2+
FROM rust:1.91.1-alpine3.22 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-prost --version 0.5.0 --locked --root /app
8+
9+
FROM gcr.io/distroless/static-debian12:latest@sha256:87bce11be0af225e4ca761c40babb06d6d559f5767fbf7dc3c47f0f1a466b92c AS base
10+
11+
FROM scratch
12+
COPY --link --from=base / /
13+
COPY --link --from=builder /app/bin/protoc-gen-prost /protoc-gen-prost
14+
USER nobody
15+
ENTRYPOINT ["/protoc-gen-prost"]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: v1
2+
name: buf.build/community/neoeinstein-prost
3+
plugin_version: v0.5.0
4+
source_url: https://github.com/neoeinstein/protoc-gen-prost
5+
description: Generates code using the Prost! code generation engine.
6+
output_languages:
7+
- rust
8+
spdx_license_id: Apache-2.0
9+
license_url: https://github.com/neoeinstein/protoc-gen-prost/blob/protoc-gen-prost-v0.5.0/LICENSE
10+
registry:
11+
cargo:
12+
rust_version: ""
13+
deps:
14+
# Matching the versions of the prost crates used in this version of the plugin.
15+
# https://github.com/neoeinstein/protoc-gen-prost/blob/protoc-gen-prost-v0.5.0/Cargo.toml#L15
16+
- name: "prost"
17+
req: "0.14.1"
18+
# https://docs.rs/crate/prost/0.14.1/features
19+
default_features: true
20+
# prost-types is necessary for any module using the WKTs.
21+
- name: "prost-types"
22+
req: "0.14.1"
23+
# https://docs.rs/crate/prost-types/0.14.1/features
24+
default_features: true
25+
# https://github.com/neoeinstein/protoc-gen-prost/blob/protoc-gen-prost-v0.5.0/protoc-gen-prost/README.md#options
26+
opts:
27+
# Includes the encoded FileDescriptorSet in the generated output for each module.
28+
- file_descriptor_set
29+
# Change generation of bytes type fields into Rust `bytes::Bytes` types.
30+
# Dependency on `bytes` crate is added as a result of `default_features: true` on `prost` dependency.
31+
# https://crates.io/crates/prost/0.14.1/dependencies
32+
- bytes=.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!Dockerfile

0 commit comments

Comments
 (0)