Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7696)

Issue 851048: Issue 174: RFE: Allow service defs in optimize_for=LITE_RUNTIME if *_generic_service = false (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years ago by t.broyer
Modified:
14 years ago
Reviewers:
kenton
CC:
protobuf_googlegroups.com
Base URL:
http://protobuf.googlecode.com/svn/trunk/
Visibility:
Public.

Description

This is a trivial patch to simply remove the error; which means if you have some (java,cpp)_generic_services=true and optimize_for=LITE_RUNTIME, declared services will simply be ignored without any warning or error (if you're generating Python code, services will be generated because there's no LITE_RUNTIME support) (I do have some code to add an error in google::protobuf::compiler::java::FileGenerator::Validate but it would require adding such a Validate method for C++; do not hesitate to ask me if you want me to try this way, but first read the note below) IMPORTANT NOTE: I haven't tested the code (not even compiled) as do not have a build environment (I'm using the Windows pre-built binary)

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+0 lines, -6 lines) Patch
src/google/protobuf/descriptor.cc View 1 chunk +0 lines, -6 lines 0 comments Download

Messages

Total messages: 2
t.broyer
14 years ago (2010-04-18 00:34:45 UTC) #1
kenton
14 years ago (2010-04-19 19:16:28 UTC) #2
Good point.  Instead of removing the error, I changed it to only happen if
one of {cc,java}_generic_services is true.  Committed as revision 326.

On Sat, Apr 17, 2010 at 5:34 PM, <t.broyer@gmail.com> wrote:

> Reviewers: kenton,
>
> Description:
> This is a trivial patch to simply remove the error; which means if you
> have some (java,cpp)_generic_services=true and
> optimize_for=LITE_RUNTIME, declared services will simply be ignored
> without any warning or error (if you're generating Python code, services
> will be generated because there's no LITE_RUNTIME support)
>
> (I do have some code to add an error in
> google::protobuf::compiler::java::FileGenerator::Validate but it would
> require adding such a Validate method for C++; do not hesitate to ask me
> if you want me to try this way, but first read the note below)
>
> IMPORTANT NOTE: I haven't tested the code (not even compiled) as do not
> have a build environment (I'm using the Windows pre-built binary)
>
> Please review this at http://codereview.appspot.com/851048/show
>
> Affected files:
>  src/google/protobuf/descriptor.cc
>
>
> Index: src/google/protobuf/descriptor.cc
> ===================================================================
> --- src/google/protobuf/descriptor.cc   (revision 325)
> +++ src/google/protobuf/descriptor.cc   (working copy)
> @@ -3720,12 +3720,6 @@
>  }
>  void DescriptorBuilder::ValidateServiceOptions(ServiceDescriptor* service,
>     const ServiceDescriptorProto& proto) {
> -  if (IsLite(service->file())) {
> -    AddError(service->full_name(), proto,
> -             DescriptorPool::ErrorCollector::NAME,
> -             "Files with optimize_for = LITE_RUNTIME cannot define
> services.");
> -  }
> -
>   VALIDATE_OPTIONS_FROM_ARRAY(service, method, Method);
>  }
>
>
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b