Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add protoc v26.0 and protobuf-ts v2.9.4 #1116

Merged
merged 4 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/docker/Dockerfile.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM gcr.io/bazel-public/bazel:7.1.0
FROM gcr.io/bazel-public/bazel:7.0.2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something the new bazel is doing is breaking protoc builds. I tested some locally and couldn't find a solution so reverting this back for now.

Build failures look like:

$ bazel build '//plugins:protoc-gen-cpp.stripped'
ERROR: Failed to initialize sandbox: /home/build/.cache/bazel/_bazel_build/433461e849f916304f45cf88ae617024/sandbox/_moved_trash_dir -> /home/build/.cache/bazel/_bazel_build/433461e849f916304f45cf88ae617024/sandbox/stale-trash-0 (Invalid cross-device link)
INFO: Elapsed time: 0.198s
INFO: 0 processes.
ERROR: Build did NOT complete successfully


CMD echo this is a dummy file used to automate dependency upgrades for plugins
3 changes: 3 additions & 0 deletions plugins/community/timostamm-protobuf-ts/v2.9.4/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!Dockerfile
!package*.json
11 changes: 11 additions & 0 deletions plugins/community/timostamm-protobuf-ts/v2.9.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# syntax=docker/dockerfile:1.4
FROM node:20.11.1-alpine3.19 AS build
WORKDIR /app
COPY --link package*.json .
RUN npm ci
RUN sed -i -e 's|/usr/bin/env node|/nodejs/bin/node|g' /app/node_modules/@protobuf-ts/plugin/bin/protoc-gen-ts

FROM gcr.io/distroless/nodejs20-debian12:latest@sha256:e0edb89411e3f93863e9bd97c15cddcbac968d7a16b7a82af6ae6b264da65de9
COPY --link --from=build /app /app
USER nobody
ENTRYPOINT [ "/app/node_modules/.bin/protoc-gen-ts" ]
21 changes: 21 additions & 0 deletions plugins/community/timostamm-protobuf-ts/v2.9.4/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: v1
name: buf.build/community/timostamm-protobuf-ts
plugin_version: v2.9.4
source_url: https://github.com/timostamm/protobuf-ts
integration_guide_url: https://github.com/timostamm/protobuf-ts#quickstart
description: Generates Protobuf and RPC for TypeScript.
output_languages:
- javascript
- typescript
registry:
npm:
import_style: module
deps:
- package: '@protobuf-ts/runtime'
version: ^2.9.4
- package: '@protobuf-ts/runtime-rpc'
version: ^2.9.4
opts:
- output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable
spdx_license_id: Apache-2.0
license_url: https://github.com/timostamm/protobuf-ts/blob/v2.9.4/LICENSE
73 changes: 73 additions & 0 deletions plugins/community/timostamm-protobuf-ts/v2.9.4/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions plugins/community/timostamm-protobuf-ts/v2.9.4/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "plugins-timostamm-protobuf-ts",
"version": "1.0.0",
"dependencies": {
"@protobuf-ts/plugin": "2.9.4"
}
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/cpp/v26.0/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!cpp.cc
!Dockerfile
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/cpp/v26.0/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-cpp",
srcs = ["cpp.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/cpp/v26.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.5
FROM debian:bookworm-20240311 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/7.0.2/bazel-7.0.2-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v26.0/protobuf-26.0.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD cpp.cc plugins/
RUN bazel build '//plugins:protoc-gen-cpp.stripped'

FROM gcr.io/distroless/cc-debian12:latest@sha256:e6ae66a5a343d7112167f9117c4e630cfffcd80db44e44302759ec13ddd2d22b
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-cpp .
USER nobody
ENTRYPOINT ["/protoc-gen-cpp"]
9 changes: 9 additions & 0 deletions plugins/protocolbuffers/cpp/v26.0/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/protocolbuffers/cpp
plugin_version: v26.0
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for C++. Generates message and enum types.
output_languages:
- cpp
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v26.0/LICENSE
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/cpp/v26.0/cpp.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/cpp/generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::cpp::CppGenerator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/csharp/v26.0/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!csharp.cc
!Dockerfile
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/csharp/v26.0/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-csharp",
srcs = ["csharp.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/csharp/v26.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.5
FROM debian:bookworm-20240311 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/7.0.2/bazel-7.0.2-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v26.0/protobuf-26.0.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD csharp.cc plugins/
RUN bazel build '//plugins:protoc-gen-csharp.stripped'

FROM gcr.io/distroless/cc-debian12:latest@sha256:e6ae66a5a343d7112167f9117c4e630cfffcd80db44e44302759ec13ddd2d22b
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-csharp .
USER nobody
ENTRYPOINT ["/protoc-gen-csharp"]
9 changes: 9 additions & 0 deletions plugins/protocolbuffers/csharp/v26.0/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v1
name: buf.build/protocolbuffers/csharp
plugin_version: v26.0
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for C#. Generates message and enum types.
output_languages:
- csharp
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v26.0/LICENSE
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/csharp/v26.0/csharp.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/csharp/csharp_generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::csharp::Generator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/java/v26.0/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!Dockerfile
!java.cc
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/java/v26.0/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-java",
srcs = ["java.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/java/v26.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.5
FROM debian:bookworm-20240311 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/7.0.2/bazel-7.0.2-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v26.0/protobuf-26.0.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD java.cc plugins/
RUN bazel build '//plugins:protoc-gen-java.stripped'

FROM gcr.io/distroless/cc-debian12:latest@sha256:e6ae66a5a343d7112167f9117c4e630cfffcd80db44e44302759ec13ddd2d22b
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-java .
USER nobody
ENTRYPOINT ["/protoc-gen-java"]
19 changes: 19 additions & 0 deletions plugins/protocolbuffers/java/v26.0/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: v1
name: buf.build/protocolbuffers/java
plugin_version: v26.0
source_url: https://github.com/protocolbuffers/protobuf
description: Base types for Java. Generates message and enum types.
output_languages:
- java
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v26.0/LICENSE
registry:
maven:
deps:
- com.google.protobuf:protobuf-java:4.26.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major version of dependencies bumped for Java.

additional_runtimes:
- name: lite
deps:
- com.google.protobuf:protobuf-javalite:4.26.0
- build.buf:protobuf-javalite:4.26.0
opts: [lite]
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/java/v26.0/java.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/java/generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::java::JavaGenerator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/kotlin/v26.0/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!Dockerfile
!kotlin.cc
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/kotlin/v26.0/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-kotlin",
srcs = ["kotlin.cc"],
deps = [
"//:protoc_lib",
],
)
24 changes: 24 additions & 0 deletions plugins/protocolbuffers/kotlin/v26.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1.5
FROM debian:bookworm-20240311 AS build

ARG TARGETARCH

RUN apt-get update \
&& apt-get install -y curl git cmake build-essential g++ unzip zip
RUN arch=${TARGETARCH}; \
if [ "${arch}" = "amd64" ]; then arch="x86_64"; fi; \
curl -fsSL -o /usr/local/bin/bazel https://github.com/bazelbuild/bazel/releases/download/7.0.2/bazel-7.0.2-linux-${arch} \
&& chmod +x /usr/local/bin/bazel

WORKDIR /build
RUN curl -fsSL -o protoc.tar.gz https://github.com/protocolbuffers/protobuf/releases/download/v26.0/protobuf-26.0.tar.gz \
&& tar --strip-components=1 -zxf protoc.tar.gz \
&& rm protoc.tar.gz
RUN bazel build '//:protoc_lib'
COPY --link BUILD kotlin.cc plugins/
RUN bazel build '//plugins:protoc-gen-kotlin.stripped'

FROM gcr.io/distroless/cc-debian12:latest@sha256:e6ae66a5a343d7112167f9117c4e630cfffcd80db44e44302759ec13ddd2d22b
COPY --from=build --link --chmod=0755 /build/bazel-bin/plugins/protoc-gen-kotlin .
USER nobody
ENTRYPOINT ["/protoc-gen-kotlin"]
27 changes: 27 additions & 0 deletions plugins/protocolbuffers/kotlin/v26.0/buf.plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: v1
name: buf.build/protocolbuffers/kotlin
plugin_version: v26.0
source_url: https://github.com/protocolbuffers/protobuf
integration_guide_url: https://protobuf.dev/getting-started/kotlintutorial
description: Base types for Kotlin. Generates message and enum types.
deps:
- plugin: buf.build/protocolbuffers/java:v26.0
output_languages:
- kotlin
spdx_license_id: BSD-3-Clause
license_url: https://github.com/protocolbuffers/protobuf/blob/v26.0/LICENSE
registry:
maven:
compiler:
kotlin:
version: 1.8.22
deps:
- com.google.protobuf:protobuf-kotlin:4.26.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major version bump for kotlin too.

- org.jetbrains.kotlin:kotlin-stdlib:1.8.22
- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22
additional_runtimes:
- name: lite
deps:
- com.google.protobuf:protobuf-kotlin-lite:4.26.0
- org.jetbrains.kotlin:kotlin-stdlib:1.8.22
opts: [lite]
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/kotlin/v26.0/kotlin.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <google/protobuf/compiler/java/kotlin_generator.h>
#include <google/protobuf/compiler/plugin.h>

int main(int argc, char *argv[]) {
google::protobuf::compiler::java::KotlinGenerator generator;
return google::protobuf::compiler::PluginMain(argc, argv, &generator);
}
4 changes: 4 additions & 0 deletions plugins/protocolbuffers/objc/v26.0/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!BUILD
!Dockerfile
!objectivec.cc
7 changes: 7 additions & 0 deletions plugins/protocolbuffers/objc/v26.0/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_binary(
name = "protoc-gen-objectivec",
srcs = ["objectivec.cc"],
deps = [
"//:protoc_lib",
],
)
Loading
Loading