Skip to content

Commit 8082fdc

Browse files
Update apple/servicetalk and protoc plugins (#2100)
Fixes #2099.
1 parent 0af0ef1 commit 8082fdc

File tree

69 files changed

+648
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+648
-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 debian:bookworm-20251103 AS build
3+
4+
WORKDIR /app
5+
RUN apt-get update \
6+
&& apt-get install -y curl
7+
RUN curl -fsSL -o servicetalk-grpc-protoc.jar https://repo1.maven.org/maven2/io/servicetalk/servicetalk-grpc-protoc/0.42.61/servicetalk-grpc-protoc-0.42.61-all.jar
8+
9+
FROM gcr.io/distroless/java21-debian12:latest@sha256:b41ca849c90e111ed5a6d2431b474225535f266ac1b3902cd508718f160cea60 AS base
10+
11+
FROM scratch
12+
COPY --from=base --link / /
13+
COPY --from=build --link --chmod=0755 --chown=root:root /app/servicetalk-grpc-protoc.jar .
14+
USER nobody
15+
ENTRYPOINT [ "/usr/bin/java", "-jar", "/servicetalk-grpc-protoc.jar"]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: v1
2+
name: buf.build/apple/servicetalk
3+
plugin_version: v0.42.61
4+
source_url: https://github.com/apple/servicetalk
5+
integration_guide_url: https://docs.servicetalk.io/
6+
description: A networking framework that evolves with your application.
7+
deps:
8+
- plugin: buf.build/protocolbuffers/java:v33.1
9+
output_languages:
10+
- java
11+
spdx_license_id: Apache-2.0
12+
license_url: https://github.com/apple/servicetalk/blob/0.42.61/LICENSE.txt
13+
registry:
14+
maven:
15+
deps:
16+
- io.servicetalk:servicetalk-data-protobuf:0.42.61
17+
- io.servicetalk:servicetalk-grpc-api:0.42.61
18+
- io.servicetalk:servicetalk-grpc-protobuf:0.42.61
19+
# Add direct dependency on newer protobuf
20+
- com.google.protobuf:protobuf-java:4.33.1
21+
opts:
22+
- javaDocs=false
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!BUILD
3+
!cpp.cc
4+
!Dockerfile
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cc_binary(
2+
name = "protoc-gen-cpp",
3+
srcs = ["cpp.cc"],
4+
deps = [
5+
"//:protoc_lib",
6+
],
7+
)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# syntax=docker/dockerfile:1.19
2+
FROM debian:bookworm-20251103 AS build
3+
4+
ARG TARGETARCH
5+
ARG BAZEL_OPTS="--host_jvm_args=-Djava.net.preferIPv4Stack=true"
6+
7+
RUN apt-get update \
8+
&& apt-get install -y curl git cmake build-essential autoconf clang libc++-dev libtool pkg-config unzip zip
9+
RUN curl -fsSL -o /usr/local/bin/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-${TARGETARCH} \
10+
&& chmod +x /usr/local/bin/bazelisk \
11+
&& mkdir /build \
12+
&& chown nobody:nogroup /build \
13+
&& usermod --home /build nobody
14+
15+
USER nobody
16+
WORKDIR /build
17+
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v33.1/protobuf-33.1.tar.gz \
18+
&& tar --strip-components=1 -zxf protoc.tar.gz \
19+
&& rm protoc.tar.gz
20+
RUN bazelisk ${BAZEL_OPTS} build '//:protoc_lib'
21+
COPY --link BUILD cpp.cc plugins/
22+
RUN bazelisk ${BAZEL_OPTS} build '//plugins:protoc-gen-cpp.stripped'
23+
24+
FROM gcr.io/distroless/cc-debian12:latest@sha256:0000f9dc0290f8eaf0ecceafbc35e803649087ea7879570fbc78372df7ac649b AS base
25+
26+
FROM scratch
27+
COPY --from=base --link / /
28+
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-cpp .
29+
USER nobody
30+
ENTRYPOINT ["/protoc-gen-cpp"]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: v1
2+
name: buf.build/protocolbuffers/cpp
3+
plugin_version: v33.1
4+
source_url: https://github.com/protocolbuffers/protobuf
5+
description: Base types for C++. Generates message and enum types.
6+
output_languages:
7+
- cpp
8+
spdx_license_id: BSD-3-Clause
9+
license_url: https://github.com/protocolbuffers/protobuf/blob/v33.1/LICENSE
10+
registry:
11+
cmake: {}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <google/protobuf/compiler/cpp/generator.h>
2+
#include <google/protobuf/compiler/plugin.h>
3+
4+
int main(int argc, char *argv[]) {
5+
google::protobuf::compiler::cpp::CppGenerator generator;
6+
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
!BUILD
3+
!csharp.cc
4+
!Dockerfile
5+
!build.csproj
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cc_binary(
2+
name = "protoc-gen-csharp",
3+
srcs = ["csharp.cc"],
4+
deps = [
5+
"//:protoc_lib",
6+
],
7+
)

0 commit comments

Comments
 (0)