Re: [protobuf] How to handle options in compiler plugin?

2018-08-31 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Aug 30, 2018 at 4:14 PM Ankit Patel wrote: > Hi Kenton, > > I am trying to do something similiar. I am writing a java plugin and I > have defined my custom service options and method options but inside my > plugin I see I only have access to FileDescriptorProto and not the >

Re: [protobuf] Re: Message imports from different locations and stub generation

2018-08-28 Thread 'Feng Xiao' via Protocol Buffers
I have written some explanation of protoc "-I" flag and import path here: https://github.com/xfxyjwf/protobuf/blob/protoc/docs/protoc.md To run protoc correctly: 1. Determine the import path for every one of your .proto files. In your case, I think it should be "dms/v1/dms.proto" and

Re: [protobuf] how to build executable protoc-gen-javalite

2018-08-22 Thread 'Feng Xiao' via Protocol Buffers
Can you help creat a github issue for this? On Wed, Aug 22, 2018 at 06:07 Luan Cooper wrote: > Hi > > *We need to build protoc/protoc-gen-javalite ourself, because we changed > some java lite code generate behavior* > > I followed Github C++ Installation Wiki >

Re: [protobuf] Importing any.proto in .proto files

2018-08-21 Thread 'Feng Xiao' via Protocol Buffers
other proto files eg. import > "tensorflow/core/framework/tensor.proto" > > On Tuesday, August 21, 2018 at 12:16:12 AM UTC-5, Feng Xiao wrote: >> >> >> >> On Mon, Aug 20, 2018 at 10:02 PM Siddharth >> wrote: >> >>> Hi feng, >>>

[protobuf] Re: Protobuf is moving to its own github organization!

2018-08-21 Thread 'Feng Xiao' via Protocol Buffers
, please comment on this issue: https://github.com/protocolbuffers/protobuf/issues/4796 On Tuesday, June 19, 2018 at 5:13:36 PM UTC-7, Feng Xiao wrote: > > Dear Protobuf users, > > Since 3.0.0 release, we have brought official support for several new > languages into protobuf. Due to

Re: [protobuf] Importing any.proto in .proto files

2018-08-20 Thread 'Feng Xiao' via Protocol Buffers
l/src/test/java/com/google/protobuf/util/JsonFormatTest.java#L835 > > Thanks, > Sid > > On Tue, Aug 21, 2018, 10:27 AM 'Feng Xiao' via Protocol Buffers < > protobuf@googlegroups.com> wrote: > >> >> >> On Mon, Aug 20, 2018 at 9:24 PM akshay patil wrote

Re: [protobuf] Importing any.proto in .proto files

2018-08-20 Thread 'Feng Xiao' via Protocol Buffers
Have you install protocol compiler, i.e., protoc? These protos should be installed along with the protoc binary if you get it from our release page. On Mon, Aug 20, 2018 at 8:13 PM akshay patil wrote: > I am trying to define my own messages representing python classes that I > want to

Re: [protobuf] How to workaround enum sibling issue in Java

2018-07-21 Thread 'Feng Xiao' via Protocol Buffers
On Fri, Jul 20, 2018 at 10:22 PM jiandai via Protocol Buffers < protobuf@googlegroups.com> wrote: > Hi there, > > I am creating a protobuf message to match with a JSON data in legacy > application. The problem is that legacy JSON has mulitple enum data, and > some of them have the same enum name,

Re: [protobuf] Re: Java API: creating message by name

2018-07-09 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Jul 9, 2018 at 2:45 PM John Lilley wrote: > Well, apparently I am really off base. Given a Descriptor I cannot figure > out how to create the right message. I *thought* this was the right > approach: > Descriptors.Descriptor desc = // look up the descriptor > Builder builder =

Re: [protobuf] VS2017 issue (#4773/#4679) : seeking advice on workaround

2018-06-29 Thread 'Feng Xiao' via Protocol Buffers
You can use the release version of protobuf as a workaround. The bug doesn't happen in release build. On Wed, Jun 27, 2018 at 1:38 PM John Lilley wrote: > I am starting a POC project involving protobuf, which must work on > Windows. I've run into issues #4773 and #4679. Is there any

Re: [protobuf] Performance of JsonFormat.printer() for converting proto to json.

2018-06-26 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Jun 25, 2018 at 10:19 PM Jiten Gupta wrote: > Hi Feng > > Thanks for quick reply. Is there any alternative to parse proto to JSON > which performance is a concern. > There isn't an official alternative. > > Regards > Jiten > > On Mon, Jun 25, 2018

Re: [protobuf] Performance of JsonFormat.printer() for converting proto to json.

2018-06-25 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Jun 25, 2018 at 10:02 AM Jiten Gupta wrote: > Hi, > > I am using google proto and we need to convert proto payload to JSON to > be sent out for monitoring and logging purpose. Size of the payload is > around 10KB. We are using JsonFormat.printer().print for proto to json > conversion.

[protobuf] Protobuf is moving to its own github organization!

2018-06-19 Thread 'Feng Xiao' via Protocol Buffers
Dear Protobuf users, Since 3.0.0 release, we have brought official support for several new languages into protobuf. Due to that growth, we are considering moving the project to its own github organization. This can help us better manage the project and improve the support we provide to the

Re: [protobuf] Re: Strings and Arenas

2018-06-07 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Jun 7, 2018 at 8:01 AM aram wrote: > I am working on the same problem in my project (arena-allocated strings), > and came across this topic. It is 2.5 years old now, so I wonder if > arena-allocated strings or StringPiece class is going to be included in > official protobuf releases any

Re: [protobuf] Proto3 Default Value Conformance

2018-05-29 Thread 'Feng Xiao' via Protocol Buffers
On Tue, May 29, 2018 at 11:30 AM Cyrus Katrak wrote: > I am implementing a protobuf implementation for a new language and I am > failing the conformance test named: > > > Required.Proto3.ProtobufInput.RepeatedScalarSelectsLast.UINT64.ProtobufOutput > > The test input appears to be an optional

Re: [protobuf] Errors building Protobuf 3.5.1 with Visual Studio 2005

2018-05-29 Thread 'Feng Xiao' via Protocol Buffers
On Tue, May 29, 2018 at 9:42 AM Eric Pederson wrote: > Hi all: > > I am trying to build Protobuf (3.5.1) using Visual Studio 2005 (I know, > it's ancient, but we are stuck with it for now). I am getting these errors: > > > Compiling... > main.cc > src\google/protobuf/stubs/hash.h(309) : error

Re: [protobuf] Do protoc 3.5.1 and 2.6.1 generate compatible output?

2018-05-22 Thread 'Feng Xiao' via Protocol Buffers
On Tue, May 22, 2018 at 1:05 PM Tomáš Volf wrote: > We are thinking about switching to newer protocol buffer (current 3.5.1) > but keeping on using proto2 syntax. Under this condition (proto2), does > library created using 3.5.1 generate compatible messages with one

Re: [protobuf] Making message reader strict, rejecting non-canonical messages

2018-05-16 Thread 'Feng Xiao' via Protocol Buffers
On Wed, May 16, 2018 at 7:39 AM Dmitry Timofeev wrote: > Hi, > > I consider if Protocol Buffers can be possibly used in an application that > requires canonical representation of messages coming from external source. > > The encoding and proto3 guide [1, 2] include

Re: [protobuf] Is proto3 specification still beta?

2018-04-30 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Apr 30, 2018 at 6:37 AM Gary Pennington wrote: > This is probably a silly question, but: > > "Is protocol buffers language 3 a finished specification?" > > At various points on the gRPC pages, e.g.: > https://grpc.io/docs/tutorials/basic/java.html, the text

Re: [protobuf] How to use a different protoc version?

2018-04-27 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Apr 26, 2018 at 6:22 PM elmer wrote: > Hi there, > > When I want use the gRPC and make the C++ files, I got the following error: > > error: This file was generated by an older version of protoc which is > error: incompatible with your Protocol Buffer headers. Please

Re: [protobuf] Default value not accessible in proto3

2018-04-26 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Apr 26, 2018 at 2:12 AM love sidhu wrote: > Hi, > > This is how my response message is defined in proto file. > > message Response{ > bool isOk = 1; > } > > > When I set this bool value in gRPC server to false, I'm not receiving it > on client side > If you

Re: [protobuf] return to arena (C++)

2018-04-10 Thread 'Feng Xiao' via Protocol Buffers
Arena is not supposed to be used as a memory pool. The recommended pattern is to use one arena per rpc request/response. You can tweak that to one arena multiple rpc request/response but the number of messages you want to put into the arena should be limited. It won't work well if you use one

Re: [protobuf] Protobuf arena, perfomance

2018-04-06 Thread 'Feng Xiao' via Protocol Buffers
On Fri, Apr 6, 2018 at 5:02 AM wrote: > Hello, everybody. > I would like to detail some moments about protobuf arena. > In my project there is a structure with ~100 fields. > I compared elapsed time for parse and serialize methods with arena and > without it. > > 1.Arena: >

Re: [protobuf] Building with debug symbols?

2018-04-02 Thread 'Feng Xiao' via Protocol Buffers
On Sun, Apr 1, 2018 at 3:20 AM Aaron Glenn wrote: > Hi, > > I am the next foolish person in line trying to get any version of protobuf > 3.x compiled and tests passing on OpenBSD. Release 3.5.1 compiles without > much fuss but when running tests, a segmentation fault occurs at

Re: [protobuf] package com.google.protobuf does not exist error while trying to build ProtoBuf Java component

2018-04-02 Thread 'Feng Xiao' via Protocol Buffers
Try following the instructions in examples/README.md and define CLASSPATH properly: https://github.com/google/protobuf/tree/master/examples#java On Sun, Apr 1, 2018 at 10:19 AM Prag Thiru wrote: > Previously I was able to run make all and make java. I did a make clean after

Re: [protobuf] MutableExtension crash in Release only

2018-03-27 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Mar 27, 2018 at 5:24 AM Vylsain wrote: > Hi, > > I'm trying to implement polymorphism with protobuf. I want to have several > levels, each new level extending the previous one. > I have a crash when calling MutableExtension. > > My .proto file looks like : > > >

Re: [protobuf] JSON Serialization Performance

2018-03-22 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Mar 22, 2018 at 8:23 AM, Edward Clark wrote: > Howdy, > > I'm working on a project that recently needed to insert data represented > by protobufs into elasticsearch. Using the built in JSON serialization we > were able to quickly get data into elasticsearch, however,

Re: [protobuf] Impossible to launch ubuntu unity after protobuf install

2018-03-20 Thread 'Feng Xiao' via Protocol Buffers
Do you happen to install protobuf into /usr instead of the default /usr/local? ubuntu 16.04 comes with a default installation of protobuf library and it's used by unity. Your new installation likely has overridden the default libprotobuf.so and leads to compatibility issues. On Tue, Mar 20, 2018

Re: [protobuf] Protocol Buffer + AIDL

2018-03-09 Thread 'Feng Xiao' via Protocol Buffers
On Fri, Mar 9, 2018 at 1:36 PM, Matt W wrote: > Is it possible to have the generated code implement Parcelable? > No (assuming you are using the official Java implementation). I think you can implement a simple wrapper for this purpose. > My System Service is receiving

Re: [protobuf] Override equals and hashCode for generated Java code?

2018-02-28 Thread 'Feng Xiao' via Protocol Buffers
Protobuf generated classes can't be subclassed. I suggest create a wrapper type and implement the hashCode()/equals() there. To generate one .java file for each message, use "option java_multiple_files = true;" in your .proto file. On Wed, Feb 28, 2018 at 5:41 AM Kaushal Hooda

Re: [protobuf] Protocol message had invalid UTF-8 (C++ to Java)

2018-02-26 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Feb 26, 2018 at 5:54 AM wrote: > Hello, > > I'm hoping someone can help me out a bit here.. > > I've developed a C++ GRPC server (Question is protobuf specific though), > that talks with a Java client. The C++ server takes data from an older C++ > API and

Re: [protobuf] How do I create a field mask for a field of a repeated field?

2018-02-20 Thread 'Feng Xiao' via Protocol Buffers
On Sun, Feb 18, 2018 at 9:05 PM Shelley Tong wrote: > Let's say you have a proto defined as the following: > > message Zoo { > repeated Cat cats = 1; > } > > Let's say cat looks like this: > > message Cat { > google.protobuf.StringValue name = 1 > Decimal

Re: [protobuf] "unwrap descriptor class before comparison of RepeatedField types" into release

2018-02-16 Thread 'Feng Xiao' via Protocol Buffers
January 30, 2018 at 11:58:39 PM UTC, x...@rubynerd.net wrote: >> >> Absolutely amazing - please can we land this in 3.5.2 then? >> >> On Tuesday, January 30, 2018 at 11:39:31 PM UTC, Feng Xiao wrote: >>> >>> >>> >>> On Tue, Jan 30, 2018 at 3:22 PM, <

Re: [protobuf] Generating a api descriptor proto in bazel for a grpc service

2018-02-08 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Feb 7, 2018 at 7:14 PM, Marquis Taliaferro < marquis.taliafe...@gmail.com> wrote: > Is there a way to generating a api descriptor proto in bazel for a grpc > service. I dont mind writing my own rule but i would prefer not to just > use a genrule for this. What im trying to do is

Re: [protobuf] Is Any safe to use for java in proto3?

2018-02-08 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Feb 8, 2018 at 12:42 PM, Mark Hoffman wrote: > Hi, > > I have a little concern using the 'Any' type in java due to this message > in the docs: > > *Currently the runtime libraries for working with Any types are under > development*. > > Does anyone know what the status

Re: [protobuf] Porting Protocol Buffer Library to Green Hills Integrity

2018-02-07 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Feb 7, 2018 at 4:32 PM, Alex Chen wrote: > I am trying to port the protocol buffer library to Green Hills Integrity > on a PPC platform. When compiling the library, I ran into the following > compiler error: > >

Re: [protobuf] Porting Protocol Buffer Library to Green Hills Integrity

2018-02-07 Thread 'Feng Xiao' via Protocol Buffers
I think moving "using RepeatedFieldAccessor::Add" to the parent class RepeatedPtrFieldWrapper might fix the issue. Could you give it a try? If it works, could you also help make a pull request? I don't have a compiler that can reproduce the error you saw. On Wed, Feb 7, 2018 at 4:53 PM,

Re: [protobuf] Porting Protocol Buffer Library to Green Hills Integrity

2018-02-07 Thread 'Feng Xiao' via Protocol Buffers
Can you create an issue on our github repo? https://github.com/google/protobuf On Wed, Feb 7, 2018 at 4:32 PM, Alex Chen wrote: > I am trying to port the protocol buffer library to Green Hills Integrity > on a PPC platform. When compiling the library, I ran into the following

Re: [protobuf] Generating Code With Parent Directory Imports?

2018-01-31 Thread 'Feng Xiao' via Protocol Buffers
scalapb_pb2.py, deploy it to pypi, and share it with all other projects that depend on the same thing. > > > > > > On Wednesday, January 31, 2018 at 11:39:08 PM UTC+2, Feng Xiao wrote: >> >> >> >> On Wed, Jan 31, 2018 at 8:54 AM, Jonnny <irs...@gmail

Re: [protobuf] Generating Code With Parent Directory Imports?

2018-01-31 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jan 31, 2018 at 8:54 AM, Jonnny wrote: > Hello everyone, > > I have a couple of micro-services, and each has couple of proto files. > It's common for one micro-service proto file to reference another service > proto file using import like so: > > import

Re: [protobuf] "unwrap descriptor class before comparison of RepeatedField types" into release

2018-01-30 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Jan 30, 2018 at 3:22 PM, wrote: > Hey, > > I'm trying to get https://github.com/google/protobuf/pull/2519 into a > release - as it was merged into master, I think it's been forgotten! :( > > I've opened https://github.com/google/protobuf/pull/4254 to try and get > the

Re: [protobuf] Tags and values

2018-01-22 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Jan 22, 2018 at 3:08 PM, Ashwin Kini wrote: > Hi all, > > While defining messages can the *tags *be non continous? The > documentation never mentions the same > > message abc { > optional uint32 xyz = *100*; > optional uint32 def = *200*; > optional unit32 abc =

Re: [protobuf] Python CPP Implementation

2018-01-16 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Jan 15, 2018 at 4:34 AM, Matthew Heritage < matthew.c.herit...@gmail.com> wrote: > According to the docs, the C++ Python implementation is experimental, but > this has been the case in the docs for 7 years. > Is it really still experimental or are the docs out of date? > A link to the

Re: [protobuf] Performance for Messages containing big (1...100MByte) binary blobs

2018-01-11 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Jan 11, 2018 at 4:58 AM, wrote: > Thanks for the reply :) > > I was planning to use the "bytes" Proto-Type from the proto3 language > specification (see here: https://developers.google.com/ > protocol-buffers/docs/proto3). > It seems to be suited to transfer binary

Re: [protobuf] How to fix “com.google.protobuf.InvalidProtocolBufferException: Cannot find field” thrown from JsonFormat.parser().merge(…)?

2017-12-22 Thread 'Feng Xiao' via Protocol Buffers
odel.User.Builder userBuilder2 = UserModel.User.newBuilder().mergeFrom(data); > > > > On Thursday, December 21, 2017 at 10:56:10 AM UTC+11, Feng Xiao wrote: >> >> JsonFormat doesn't support extensions. You can replace extensions with >> google.protobuf.Any if you want to

Re: [protobuf] How to fix “com.google.protobuf.InvalidProtocolBufferException: Cannot find field” thrown from JsonFormat.parser().merge(…)?

2017-12-20 Thread 'Feng Xiao' via Protocol Buffers
JsonFormat doesn't support extensions. You can replace extensions with google.protobuf.Any if you want to use the proto with JsonFormat. On Wed, Dec 20, 2017 at 3:39 PM, Behrang Saeedzadeh wrote: > > > *down vote**favorite* >

[protobuf] Re: [protobuf-team] Protobuf and Abseil in Debian/Ubuntu

2017-12-20 Thread 'Feng Xiao' via Protocol Buffers
e internet... We can make it harder but people will get a way around it. > > Since the philosophy of ABSL is that users will always build from source, > we could ask that users do this if they want to develop against protobuf. > Debian packages that depend on protobuf could build protobu

[protobuf] Re: [protobuf-team] Protobuf and Abseil in Debian/Ubuntu

2017-12-20 Thread 'Feng Xiao' via Protocol Buffers
+abseil...@googlegroups.com, +proto...@gogolegroups.com CCed public google groups so László can reply to the group. BCCed internal mailing lists. On Tue, Dec 19, 2017 at 8:24 PM, Josh Haberman wrote: > Hi all, > > I wanted to kick off a conversation about the future of

Re: [protobuf] Protobuf and Golang: How to generate a map string interface using proto3?

2017-12-19 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Dec 19, 2017 at 10:01 AM, wrote: > Hi, I am new in using Protobuf for golang. > > https://github.com/golang/protobuf > > > Using golang Protobuf, within *package **foo*, I created *message > TaskJobEntity* which is a combination of other messages: > > > message

Re: [protobuf] ParseFromArray always returning true

2017-12-07 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Dec 6, 2017 at 4:39 PM, 'Allen Vicencio' via Protocol Buffers < protobuf@googlegroups.com> wrote: > If all my fields in a protobuf are `optional`, will ParseFromArray ever > return false? I am doing some tests right now, and I am testing two > scenarios: > > >> Person > > optional string

Re: [protobuf] Status of protobuf-java 2.x / 3.x compatibility

2017-12-05 Thread 'Feng Xiao' via Protocol Buffers
gt; GeneratedMessage, SingleFieldBuilder, etc? Are these classes simply > vestigial at this point or do they still provide some benefit to > compatibility (even if not 100%). > They are still needed to be compatible with older beta releases like 3.0.0-beta-3 etc. > > Thanks again, >

Re: [protobuf] Status of protobuf-java 2.x / 3.x compatibility

2017-12-04 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Dec 4, 2017 at 9:00 AM, Chris Thunes wrote: > > I'm looking at options for moving some applications that currently depend > on protobuf-java 2.5.0 to a more recent version. This is made complicated > by the fact that we have a mixure of internal and external

Re: [protobuf] Issues identified in version 3.4.0 by security scan

2017-11-15 Thread 'Feng Xiao' via Protocol Buffers
Can you create an issue for this on https://github.com/google/protobuf ? On Wed, Nov 15, 2017 at 6:26 AM, wrote: > Tho following 3 issues were flagged by a security scan where we use > Protobuf v3.4.0. Will these be resolved in an upcoming version? > > >

Re: [protobuf] Golang: issues/discussions/pull requests

2017-11-09 Thread 'Feng Xiao' via Protocol Buffers
Some new updates from go protobuf developers: https://github.com/golang/protobuf/issues/454#issuecomment-343250894 An announcement about this change will be posted in this discussion group soon. On Tuesday, October 24, 2017 at 12:06:22 PM UTC-7, Feng Xiao wrote: > > On Tue, Oct 24, 2017 a

Re: [protobuf] C++ - Protobuf descriptor static memory leaks

2017-11-09 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Nov 9, 2017 at 11:53 AM, Arpit Baldeva wrote: > Hi, > > Currently, protobuf generated code makes allocations in the static > descriptor objects. For example, valgrind reports > > >Memcheck:Leak >fun:malloc >fun:_ZN20PassthroughAllocator5AllocEmPKcj >

Re: [protobuf] Avoid C++11 warning about switch on proto3 enum w/o default clause?

2017-10-31 Thread 'Feng Xiao' via Protocol Buffers
want to rename "XXX_DO_NOT_USE" to "XXX_DO_NOT_USE_PLEASE_ADD_DEFAULT_CASE". > It seems to me that there's some merit to formalize this in the proto3 > language. Thoughts? > > Best, > Chun-Hung > > > On Monday, October 30, 2017 at 12:29:26 PM UTC-7, Feng Xi

Re: [protobuf] Avoid C++11 warning about switch on proto3 enum w/o default clause?

2017-10-30 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Oct 30, 2017 at 9:57 AM, wrote: > Hi all, > > I'm from the Apache Mesos community and we're working on things that uses > proto3. > We usually turn on compiler options to report missing values in switch > statements, > and don't do a "default" clause. This gives us

Re: [protobuf] Integrate proto2 messages from a device to C#

2017-10-27 Thread 'Feng Xiao' via Protocol Buffers
On Fri, Oct 27, 2017 at 10:16 AM, cleal wrote: > I have to integrate a third part protocol from a gps device, they send me > the .proto files, they are using the schema proto2. > > I should receive the binary messages and I need desarialize it in order to > work with the

Re: [protobuf] How to use custom options in official docs

2017-10-25 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Oct 25, 2017 at 5:38 AM, wrote: > the example in https://developers.google.com/protocol-buffers/docs/ > proto#customoptions below > > message FooOptions { > optional int32 opt1 = 1; > optional string opt2 = 2; > } > > extend google.protobuf.FieldOptions { >

Re: [protobuf] Deserializing of protobf Message from JSON string in C++

2017-10-25 Thread 'Feng Xiao' via Protocol Buffers
ing treated as dead code and removed by gcc > optimization, any thoughts on overcoming this problem. > The extension has to be explicitly referenced or the linker will strip them out. > > > Thank you > > Giri > On Thursday, 6 June 2013 00:15:14 UTC+5:30, Feng Xiao wrot

Re: [protobuf] Golang: issues/discussions/pull requests

2017-10-24 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Oct 24, 2017 at 8:12 AM Josh Humphries wrote: > In the past, when I've asked questions in this mailing list or hoped to > discuss details of the protobuf package for Go, I've been pointed to the > Github project. > > And, for some period, I had luck having

Re: [protobuf] Protobuf well-known types and C++

2017-10-21 Thread 'Feng Xiao' via Protocol Buffers
On Sat, Oct 21, 2017 at 4:39 PM, Antonia Elsen wrote: > What is the proper way to include well-known types in proto files? > I'm hoping to use FieldMasks and Any among others. > So far I haven't had any luck. > I've tried importing the proto files and using the namespace

Re: [protobuf] Best practice for effecting inheritance/polymorphism in proto3

2017-10-19 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Oct 18, 2017 at 3:04 PM, Jeff White wrote: > There seem to be 2 techniques to effect pseudo-inheritance/polymorphism. > > oneof: > > message Animal { > string name = 1; > oneof animal_type { > Bird bird = 2; > Dog dog = 3; > } > } > message

Re: [protobuf] "ParseFromString()" and "JsonStringToMessage()" have inconsistent behavior when parsing an unrecognized enum value.

2017-10-17 Thread 'Feng Xiao' via Protocol Buffers
ny suggestions? Thanks! > There really isn't a good way to solve this. The server has to know the enum definition to be able to accept it in JSON format. You will either need to make sure the server is updated with the new definition before sending it JSON data using the new enum names, or use

Re: [protobuf] "ParseFromString()" and "JsonStringToMessage()" have inconsistent behavior when parsing an unrecognized enum value.

2017-10-10 Thread 'Feng Xiao' via Protocol Buffers
at 2:18 PM, Feng Xiao <xiaof...@google.com> wrote: > > > On Tue, Oct 10, 2017 at 12:29 AM, Qian Zhang <zhq527...@gmail.com> wrote: > >> Hi, >> >> I am using protobuf-3.3.0, and I found when parsing an unrecognized enum >> value for an option

Re: [protobuf] "ParseFromString()" and "JsonStringToMessage()" have inconsistent behavior when parsing an unrecognized enum value.

2017-10-10 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Oct 10, 2017 at 12:29 AM, Qian Zhang wrote: > Hi, > > I am using protobuf-3.3.0, and I found when parsing an unrecognized enum > value for an optional enum field, the behaviors of "ParseFromString()" and > "JsonStringToMessage()" are different. "ParseFromString()"

Re: [protobuf] Is it possible to retrieve an absolute path to a proto-file from a Protoc plugin?

2017-09-25 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Sep 25, 2017 at 5:21 AM, Andrew Pashkin wrote: > Hello, everyone, > > I have a case where I need to read non-Protobuf files that are referenced > from a target proto-file by a relative path. I use this approach to embed > some information in a language different

Re: [protobuf] table_driven_parsing option in protobuf 3.4 C++ library

2017-09-18 Thread 'Feng Xiao' via Protocol Buffers
On Mon, Sep 18, 2017 at 3:13 PM, Todd Lipcon wrote: > Hi folks, > > I noticed that protobuf 3.4 includes the new 'table_driven_parsing' option > for C++ code generation, but can't seem to find any docs about this feature. > > From a quick skim of the code, it seems like the

Re: [protobuf] How to get value of protobuf custom option in Java?

2017-09-05 Thread 'Feng Xiao' via Protocol Buffers
Suppose you have two .proto files, an options.proto where the extension is defined, and a foo.proto where the custom option is used. If both proto files are actually part of your protoc plugin (i.e., your plugin includes the generated Java class of both .proto files), you should be able to access

Re: [protobuf] Is there any way to add a prefix to canonical name?

2017-08-11 Thread 'Feng Xiao' via Protocol Buffers
On Fri, Aug 11, 2017 at 1:41 PM, 'Jungho Ahn' via Protocol Buffers < protobuf@googlegroups.com> wrote: > Hello, > > I'm trying to import protos from a third party repo, but they don't have > proper canonical names. > > For example, there is a repo X which has > > a/p1.proto > a/p2.proto with

Re: [protobuf] Re: Compiler error with GCC targeting ARM - Atomic32 vs AtomicWord

2017-08-10 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Aug 10, 2017 at 9:53 AM, Brad Larson <bklar...@gmail.com> wrote: > > > On Wednesday, August 9, 2017 at 1:13:54 PM UTC-5, Feng Xiao wrote: >> >> Hi Brad, can you send your patch as a pull request? It's easier to review >> the diff there. >> > >

Re: [protobuf] Re: Compiler error with GCC targeting ARM - Atomic32 vs AtomicWord

2017-08-09 Thread 'Feng Xiao' via Protocol Buffers
Hi Brad, can you send your patch as a pull request? It's easier to review the diff there. On Wed, Aug 9, 2017 at 8:27 AM, Brad Larson wrote: > > > On Monday, August 7, 2017 at 1:13:46 PM UTC-5, Brad Larson wrote: >> >> Hello, I'm getting a compiler error when using GCC to

Re: [protobuf] Re: Protobuf on ARM pads integers

2017-08-01 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Aug 1, 2017 at 4:13 AM, Brian Savage wrote: > This problem has reared it's ugly head again. This time, some enums were > changed and it caused a crash in an unrelated message when serialized. > Padding the message with a bool type at the end of the message fixed

Re: [protobuf] Contribution Guide?

2017-07-18 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Jul 18, 2017 at 7:04 AM, Brian Bustamante wrote: > Hi Adam, > > Who would be the best person to talk about possibly adding support for a > new language to the protobuf compiler? > I have opened a mostly feature complete proto3 PR for F#: >

Re: [protobuf] Where to find Protobuf Javascript tutorial?

2017-07-17 Thread 'Feng Xiao' via Protocol Buffers
On Sat, Jul 15, 2017 at 8:28 PM, hce h wrote: > Hi, > > We are using javascript for web front end development and we are using the > protobuf to communicate with backend web applications. Currently we are > using GO to do protobuf communication between the backend

Re: [protobuf] A timeout in this test probably indicates a real bug.

2017-07-12 Thread 'Feng Xiao' via Protocol Buffers
. On Wed, Jul 12, 2017 at 1:44 PM, Sara Quigley <sara.quig...@gmail.com> wrote: > Sure. Here it is. > > Thanks, > Sara > > On Wed, Jul 12, 2017 at 1:40 PM, Feng Xiao <xiaof...@google.com> wrote: > >> Can you attach the full log file? >> >> On We

Re: [protobuf] A timeout in this test probably indicates a real bug.

2017-07-12 Thread 'Feng Xiao' via Protocol Buffers
Can you attach the full log file? On Wed, Jul 12, 2017 at 1:27 PM, Sara Quigley wrote: > Hi there, > > I was installing Protocol Buffers and it looks like during my "make > check", the protobuf-test failed. > > /Applications/Xcode.app/Contents/Developer/usr/bin/make

Re: [protobuf] Need help with compilation of protobuf with a large enum for java

2017-07-11 Thread 'Feng Xiao' via Protocol Buffers
ps://github.com/google/protobuf/blob/cf14183bcd5485b4a71541599ddce0b35eb71352/src/google/protobuf/compiler/java/java_enum.cc#L95 > > On Tuesday, July 11, 2017 at 1:58:38 PM UTC-7, Feng Xiao wrote: >> >> >> >> On Tue, Jul 11, 2017 at 1:06 PM, Minimol Thomas <m

Re: [protobuf] [Java] Proper way to add an item to a List?

2017-07-11 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Jul 11, 2017 at 4:53 PM, Laird Nelson wrote: > I hope this is the right group. > > I've generated a Java API for Helm's Tiller using gRPC and protocol > buffers. You can see the javadocs here: https://microbean. > github.io/microbean-helm/apidocs/index.html Look at

Re: [protobuf] Need help with compilation of protobuf with a large enum for java

2017-07-11 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Jul 11, 2017 at 1:06 PM, Minimol Thomas wrote: > Compilation of java code generated using protobuf compiler fails giving > the error, "code too large". > We have an enumeration with 6000 values. And the code generated for this > enum is causing the problem. > I

Re: [protobuf] Re: MessageToJsonString output empty

2017-07-11 Thread 'Feng Xiao' via Protocol Buffers
On Sun, Jul 9, 2017 at 4:52 AM, hce h wrote: > Let me add more details, here is what I have a test program: > > test.proto: > > syntax = "proto3"; > package test; > > message TestMessage { > string query = 1; > int32 page_number = 2; // Which page number do we

Re: [protobuf] Compiling protobuf with GOOGLE_PROTOBUF_NO_THREAD_SAFETY macro

2017-07-07 Thread 'Feng Xiao' via Protocol Buffers
t;> Thanks a lot Feng for your quick answer. Well at the moment, we are only >>> planning to use it in a single threaded application where we write/read >>> messages sequentially, instead of in parallel. So I guess we are safe for >>> now. >>> >>> Reg

Re: [protobuf] Important!! please help, protoc command not working on linux x86_64

2017-07-06 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Jul 6, 2017 at 6:57 AM, wrote: > Hi All, > I downloaded protoc binary (protoc-3.2.0-linux-x86_64.zip > ) > for linux from https://github.com/google/protobuf/releases >

Re: [protobuf] Proto compiler creating Strong Type Enum

2017-07-06 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Jul 5, 2017 at 9:07 PM, Abhi wrote: > Hi > > I am using proto compiler 3.1 and it's a C++ project. > > When I compile my proto Its generating myproto.struct.h file along with > myproto.pb.cc and myproto.pb.h. > I don't think protoc generates .struct.h file. Is

Re: [protobuf] Protobuf Json conversion

2017-07-05 Thread 'Feng Xiao' via Protocol Buffers
You can keep using proto2 (i.e., adding 'syntax = "proto2";' to your existing files). There is a catch though: the JSON support is designed for proto3 and won't work well (or won't work at all) for proto2 only features. If feasible, it might be better to migrate to proto3 to avoid any confusion

Re: [protobuf] why not 150

2017-07-05 Thread 'Feng Xiao' via Protocol Buffers
"96 01" is written in hex. 0x96 = 150. On Sun, Jul 2, 2017 at 6:18 AM Jing Lupeng wrote: > > https://developers.google.com/protocol-buffers/docs/encoding#structure > > > >

Re: [protobuf] Unable to compile protobuf files under Ubuntu 16.04

2017-06-29 Thread 'Feng Xiao' via Protocol Buffers
It seems com.github.os72.protocjar only supports 64bit system. On Thu, Jun 29, 2017 at 5:10 AM, wrote: > Hi guys, > > Unfortunate, I have met the following problem - I cannot compile protos > in my scala project. > I use "Protocol Buffer Compiler for Scala - Scala PB".

Re: [protobuf] [golang] API provides no way to access unknown extensions

2017-06-27 Thread 'Feng Xiao' via Protocol Buffers
I'm not sure if the go team monitors this mailing group. You might get a better chance to reach them by posting an issue to the golang/protobuf github repo. On Mon, Jun 26, 2017 at 7:49 PM, Josh Humphries wrote: > For messages generates from syntax="proto2" files, there

Re: [protobuf] Is the extension registry address still monitored?

2017-06-16 Thread 'Feng Xiao' via Protocol Buffers
On Fri, Jun 16, 2017 at 11:42 AM, Marc Gravell wrote: > In descriptor.proto, it asks public authors to request extension numbers > (for the DSL) via protobuf-global-extension-regis...@google.com It is monitored, but these emails (one request in about one to two months)

Re: [protobuf] Timestamp

2017-05-17 Thread 'Feng Xiao' via Protocol Buffers
On Wed, May 17, 2017 at 8:10 AM, Leonardo Toledo wrote: > Hi! I am using protobufs but i need to use the version 2 (syntax 2) of > protobufs and at the same time i need to use the a timestamp, but the > examples that i saw they use always the syntax 3 of protobufs. I already

Re: [protobuf] Re: Porting protobuf to iRTOS

2017-05-17 Thread 'Feng Xiao' via Protocol Buffers
On Tue, May 16, 2017 at 11:26 PM, Shiva Kumar wrote: > I have even tried using static member class. But in protobuf, namespace > are nested and distributed across files. Mapping them to class will not > work out. Removing the all the namespace is another

Re: [protobuf] Crosscompiling for AARCH64

2017-05-12 Thread 'Feng Xiao' via Protocol Buffers
On Wed, May 10, 2017 at 1:21 AM, jebina elsie wrote: > Hi All, > > I'm trying to cross compile the Protobuf 3.3.0 to the 64 bit ARM processor. > > with the configure command > ./configure CC="aarch64-oe-linux-gcc" CXX="aarch64-oe-linux-g++" >

Re: [protobuf] zigzag encode and zigzag decode invoking undefined behavior

2017-04-25 Thread 'Feng Xiao' via Protocol Buffers
Right now protobuf implementation assumes 2s complement and won't work on any other environments. That's undefined behavior according to C++ standard but in practice it's very unlikely to be a problem. On Tue, Apr 25, 2017 at 5:42 AM, Wolfgang Brehm wrote: > right

Re: [protobuf] binary compatibility between versions 2.x and 3.x

2017-04-20 Thread 'Feng Xiao' via Protocol Buffers
<+44%2020%203137%201603> > Mobile : +852 9611 3969 <+852%209611%203969> > > 9/F, 33 Lockhart Road, Wanchai, Hong Kong > www.celer-tech.com > > > > > > > > On 21 Apr 2017, at 2:08 AM, Feng Xiao <xiaof...@google.com> wrote: > > >

Re: [protobuf] binary compatibility between versions 2.x and 3.x

2017-04-20 Thread 'Feng Xiao' via Protocol Buffers
ersion of protoc. > Regards, > Scott > > > On Saturday, August 13, 2016 at 8:00:23 AM UTC+8, Feng Xiao wrote: >> >> On Thu, Aug 11, 2016 at 12:21 PM, Jeff Olson <jeff.d...@gmail.com> wrote: >> >>> I've read through the release documents >>> <htt

Re: [protobuf] Type URLs and Any types

2017-04-20 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Apr 19, 2017 at 5:25 PM, Josh Humphries wrote: > The protobuf docs for the Any type > > talk about the URL being a real URL, where an HTTP GET request will reply >

Re: [protobuf] Parse/Decode raw protobuf msg

2017-04-19 Thread 'Feng Xiao' via Protocol Buffers
wed by creating FileDescriptorProto by using > parseFrom(FileInputStream)? > > And moving forward as stated here https://groups.google.com/d/ > msg/protobuf/bWlJaaMmx4Q/kIYJ1-5YRb0J > > > On Wednesday, April 19, 2017 at 11:43:42 PM UTC+5:30, Feng Xiao wrote: >> >>

Re: [protobuf] Parse/Decode raw protobuf msg

2017-04-19 Thread 'Feng Xiao' via Protocol Buffers
tream? > > Also is it bad practise to invoke protoc compiler in a production > environment? > > On Wednesday, April 19, 2017 at 11:00:17 PM UTC+5:30, Feng Xiao wrote: >> >> >> >> On Wed, Apr 19, 2017 at 4:20 AM, Rohan Suri <rohan@gmail.com> wrote: >

Re: [protobuf] Parse/Decode raw protobuf msg

2017-04-19 Thread 'Feng Xiao' via Protocol Buffers
On Wed, Apr 19, 2017 at 4:20 AM, Rohan Suri wrote: > Hello everyone, > > I'm trying to find the right Java APIs to do what protoc --decode_raw and > protoc --decode do. > Essentially handling two cases: > 1) When I don't have the proto, and only the raw protobuf msg. > eg

Re: [protobuf] Define pubsub like rpc in protobuf file

2017-04-12 Thread 'Feng Xiao' via Protocol Buffers
only works with proto2 though as it uses extensions. > I could just define strings, but then you would have to make sure they're > the same between protobufs and using a code generator, I would have to find > that other protobuf and link them together > > > On Tuesday, 11 April

  1   2   3   4   5   6   >