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

Update protoc plugin to support Proto3 optional #884

Merged
merged 4 commits into from
Jul 8, 2020
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
18 changes: 18 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ http_archive(
],
)

http_archive(
name = "bazel_skylib",
sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
],
)

http_archive(
name = "com_google_protobuf",
sha256 = "efaf69303e01caccc2447064fc1832dfd23c0c130df0dc5fc98a13185bb7d1a7",
strip_prefix = "protobuf-678da4f76eb9168c9965afc2149944a66cd48546",
urls = [
"https://github.com/google/protobuf/archive/678da4f76eb9168c9965afc2149944a66cd48546.tar.gz",
],
)

load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_dependencies", "rules_closure_toolchains")

rules_closure_dependencies()
Expand Down
5 changes: 5 additions & 0 deletions javascript/net/grpc/web/grpc_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,11 @@ class GrpcCodeGenerator : public CodeGenerator {
GrpcCodeGenerator() {}
~GrpcCodeGenerator() override {}

uint64_t GetSupportedFeatures() const override {
// Code generators must explicitly support proto3 optional.
return CodeGenerator::FEATURE_PROTO3_OPTIONAL;
}

bool Generate(const FileDescriptor* file, const string& parameter,
GeneratorContext* context, string* error) const override {
GeneratorOptions generator_options;
Expand Down
3 changes: 2 additions & 1 deletion net/grpc/gateway/docker/prereqs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN echo "\nloglevel=error\n" >> $HOME/.npmrc
WORKDIR /github/grpc-web

COPY ./Makefile ./Makefile
COPY ./WORKSPACE ./WORKSPACE
COPY ./bazel ./bazel
COPY ./javascript ./javascript
COPY ./net ./net
Expand All @@ -40,7 +41,7 @@ RUN cd ./packages/grpc-web && \
RUN wget -nv -O buildifier \
https://github.com/bazelbuild/buildtools/releases/download/$BUILDIFIER_VERSION/buildifier && \
chmod +x ./buildifier && \
./buildifier --mode=check --lint=warn --warnings=all -r bazel javascript net && \
./buildifier --mode=check --lint=warn --warnings=all -r ./WORKSPACE bazel javascript net && \
rm ./buildifier

RUN wget -nv -O bazel-installer.sh \
Expand Down
2 changes: 1 addition & 1 deletion scripts/init_submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ cd "$(dirname "$0")"/..
git submodule --quiet update --init
cd third_party/closure-library && git checkout tags/v20200406 -f && cd ../..
cd third_party/openssl && git checkout tags/OpenSSL_1_0_2h -f && cd ../..
cd third_party/grpc && git checkout tags/v1.28.1 -f && \
cd third_party/grpc && git checkout tags/v1.30.0 -f && \
git submodule --quiet update --init && cd ../..
2 changes: 1 addition & 1 deletion third_party/grpc
Submodule grpc updated 1277 files