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

2017-04-20 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Apr 20, 2017 at 6:01 PM, Scott Sue  wrote:

> Hi Feng,
>
> Apologies, what I was meaning was that with the introduction of protobuf
> 3.2.0 now, is 3.2.0 binary compatible with protobuf 2.5.0?  Or does you
> original message reply still hold true?
>
No, 3.2.0 runtime is not binary compatible with 2.5.0 generated code. It is
only binary compatible with older 3.x version generated code, such as 3.0,
or 3.1.


>
>
> Regards,
> Scott
>
> SCOTT SUE
> CHIEF TECHNOLOGY OFFICER
>
> Support Line : +44(0) 2031 371 603 <+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  wrote:
>
>
>
> On Thu, Apr 20, 2017 at 3:55 AM, Scott Sue 
> wrote:
>
>> Hi Feng,
>>
>> Is this still the case considering that 3.2.0 is out that allows the
>> version number to be used by protoc?
>>
> Not sure what you are asking, but 3.0.0 generated code should work with
> 3.2.0 runtime and 3.2.0 protoc will work with any old version plugins.
>
>
>>
>> General
>> * Added protoc version number to protoc plugin protocol. It can be used by
>> protoc plugin to detect which version of protoc is used with the plugin
>> and
>> mitigate known problems in certain version 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 
>>> wrote:
>>>
 I've read through the release documents
  for Protocol
 Buffers v3.0.0 but I can't find any statements regrading binary
 compatibility with version 2.6.1 (or earlier). There are a couple of things
 I'd like to know:


1. If I dump a 3.0.0 version of the 
 com.google.protobuf/protobuf-java.jar
in a project the depends on java classes generated by protoc v2.6.1 (or
v2.5.0) will everything still work? That is, is the java runtime 
 backwards
compatible?

 Unfortunately no. The 3.0.0 version protobuf-java.jar will not work
>>> with java classes generated by protoc v2.6.1 (or v2.5.0). For those who can
>>> not upgrade to 3.0 directly, we are considering releasing a 2.7 version
>>> which provides the following compatibility guarantees:
>>> 1. 2.7 protobuf-java.jar will be compatible with java classes generated
>>> by protoc 2.6.1 and protoc 2.5.0.
>>> 2. 3.0 protobuf-java.jar will be compatible with java classes generated
>>> by protoc 2.7
>>>
>>> I.e., it allows you to upgrade to 3.0 in two steps: upgrade to 2.7, and
>>> after all your dependencies are upgraded to either 2.7 or 3.0, you can
>>> upgrade to 3.0 as well. It's not an ideal solution, but we hope it can help
>>> ease the migration pain for some users. I'm testing this 2.7 version in a
>>> github branch right now: https://github.com/google/protobuf/tree/2.7.0.
>>> If you are interested, feel free to test it and any feedback is welcome.
>>>
>>>

1. Is the binary wire format the same for purely proto2 messages?
If I serialize messages generated from proto2 sources using the 3.0.0 
 java
runtime will clients using protobuf v2.6.1 be able to decode the 
 messages
correctly?

 Yes. The wire format stays the same as long as you are using the proto2
>>> syntax version.
>>>
>>> Thanks,
 Jeff

 --
 You received this message because you are subscribed to the Google
 Groups "Protocol Buffers" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to protobuf+u...@googlegroups.com.
 To post to this group, send email to prot...@googlegroups.com.
 Visit this group at https://groups.google.com/group/protobuf.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>> *This message, including any attachments, may include private, privileged
>> and confidential information and is intended only for the personal and
>> confidential use of the intended recipient(s). If the reader of this
>> message is not an intended recipient, you are hereby notified that any
>> review, use, dissemination, distribution, printing or copying of this
>> message or its contents is strictly prohibited and may be unlawful. If you
>> are not an intended recipient or have received this communication in error,
>> please immediately notify the sender by telephone and/or a reply email and
>> permanently delete the original message, including any attachments, without
>> making a copy.*
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to protobuf+unsubscr...@googlegroups.com.
>> To post to this group, send email to protobuf@googlegroups.com.
>> Visit 

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

2017-04-20 Thread Scott Sue
Hi Feng,

Apologies, what I was meaning was that with the introduction of protobuf 3.2.0 
now, is 3.2.0 binary compatible with protobuf 2.5.0?  Or does you original 
message reply still hold true?


Regards,
Scott

SCOTT SUE
CHIEF TECHNOLOGY OFFICER

Support Line : +44(0) 2031 371 603
Mobile : +852 9611 3969

9/F, 33 Lockhart Road, Wanchai, Hong Kong
www.celer-tech.com 






> On 21 Apr 2017, at 2:08 AM, Feng Xiao  wrote:
> 
> 
> 
> On Thu, Apr 20, 2017 at 3:55 AM, Scott Sue  > wrote:
> Hi Feng,
> 
> Is this still the case considering that 3.2.0 is out that allows the version 
> number to be used by protoc?
> Not sure what you are asking, but 3.0.0 generated code should work with 3.2.0 
> runtime and 3.2.0 protoc will work with any old version plugins.
>  
> 
>  General
>   * Added protoc version number to protoc plugin protocol. It can be used by
> protoc plugin to detect which version of protoc is used with the plugin 
> and
> mitigate known problems in certain version 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 > wrote:
> I've read through the release documents 
>  for Protocol Buffers 
> v3.0.0 but I can't find any statements regrading binary compatibility with 
> version 2.6.1 (or earlier). There are a couple of things I'd like to know:
> 
> If I dump a 3.0.0 version of the com.google.protobuf/protobuf-java.jar in a 
> project the depends on java classes generated by protoc v2.6.1 (or v2.5.0) 
> will everything still work? That is, is the java runtime backwards compatible?
> Unfortunately no. The 3.0.0 version protobuf-java.jar will not work with java 
> classes generated by protoc v2.6.1 (or v2.5.0). For those who can not upgrade 
> to 3.0 directly, we are considering releasing a 2.7 version which provides 
> the following compatibility guarantees:
> 1. 2.7 protobuf-java.jar will be compatible with java classes generated by 
> protoc 2.6.1 and protoc 2.5.0.
> 2. 3.0 protobuf-java.jar will be compatible with java classes generated by 
> protoc 2.7
> 
> I.e., it allows you to upgrade to 3.0 in two steps: upgrade to 2.7, and after 
> all your dependencies are upgraded to either 2.7 or 3.0, you can upgrade to 
> 3.0 as well. It's not an ideal solution, but we hope it can help ease the 
> migration pain for some users. I'm testing this 2.7 version in a github 
> branch right now: https://github.com/google/protobuf/tree/2.7.0 
> . If you are interested, feel 
> free to test it and any feedback is welcome.
>  
> Is the binary wire format the same for purely proto2 messages? If I serialize 
> messages generated from proto2 sources using the 3.0.0 java runtime will 
> clients using protobuf v2.6.1 be able to decode the messages correctly?
> Yes. The wire format stays the same as long as you are using the proto2 
> syntax version.
> 
> Thanks,
> Jeff
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to protobuf+u...@googlegroups.com <>.
> To post to this group, send email to prot...@googlegroups.com <>.
> Visit this group at https://groups.google.com/group/protobuf 
> .
> For more options, visit https://groups.google.com/d/optout 
> .
> 
> 
> This message, including any attachments, may include private, privileged and 
> confidential information and is intended only for the personal and 
> confidential use of the intended recipient(s). If the reader of this message 
> is not an intended recipient, you are hereby notified that any review, use, 
> dissemination, distribution, printing or copying of this message or its 
> contents is strictly prohibited and may be unlawful. If you are not an 
> intended recipient or have received this communication in error, please 
> immediately notify the sender by telephone and/or a reply email and 
> permanently delete the original message, including any attachments, without 
> making a copy.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to protobuf+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to protobuf@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/protobuf 
> .
> For more options, visit https://groups.google.com/d/optout 
> .
> 


-- 
 

Re: [protobuf] Type URLs and Any types

2017-04-20 Thread Josh Humphries
On Thu, Apr 20, 2017 at 2:03 PM, Feng Xiao  wrote:

>
>
> 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
>> with encoded google.protobuf.Type message. The doc further states that
>> URLs with no scheme assume HTTPS (and runtime support that I've seen looks
>> like it intentionally leaves out the scheme when generating type URLs).
>>
>> However, the given URL examples for all well-known types don't work. Any
>> GET request for https://type.googleapis.com/ fails with a 404.
>> The actual example in the Any doc is for google.protobuf.Duration, and
>> https://type.googleapis.com/google.protobuf.Duration simply does not
>> work.
>>
>> I don't necessarily need these to work, but I have written stuff for
>> resolving types per the doc and have no out-of-the-box URLs I can play with
>> to test it.. It seems like an issue that none of the documented examples
>> actually work.
>>
> Can you create an github issue and give more context about how you plan to
> use it? Right now the type service doesn't exist because we find no use
> case of it for our API service stack.
>

I'm actually writing something for dynamic services. It currently uses GRPC
service reflection, but I was looking at supporting the google.protobuf.Api
type, too (first converting Api, Type, and Enum objects into equivalent
descriptors). I was also looking at implementing dynamic type resolution
for Any types the same way: download the Type object, generate a message
descriptor from it, and then use that to de-serialize the payload.

I don't need to implement this for my project. I just figured I would flesh
these things out, for the sake of completeness, since it's part of the spec
in the published documentation on
https://developers.google.com/protocol-buffers/.

So I'd appreciate the docs being updated to reflect reality. If reality is
that there will be no dynamic type resolution strategy and that clients of
Any messages must have all message URLs statically registered in order to
parse the payloads, that's fine. It just needs to be documented that way.


>
>
>>
>> 
>> *Josh Humphries*
>> jh...@bluegosling.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to protobuf+unsubscr...@googlegroups.com.
>> To post to this group, send email to protobuf@googlegroups.com.
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


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

2017-04-20 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Apr 20, 2017 at 3:55 AM, Scott Sue  wrote:

> Hi Feng,
>
> Is this still the case considering that 3.2.0 is out that allows the
> version number to be used by protoc?
>
Not sure what you are asking, but 3.0.0 generated code should work with
3.2.0 runtime and 3.2.0 protoc will work with any old version plugins.


>
> General
> * Added protoc version number to protoc plugin protocol. It can be used by
> protoc plugin to detect which version of protoc is used with the plugin and
> mitigate known problems in certain version 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  wrote:
>>
>>> I've read through the release documents
>>>  for Protocol
>>> Buffers v3.0.0 but I can't find any statements regrading binary
>>> compatibility with version 2.6.1 (or earlier). There are a couple of things
>>> I'd like to know:
>>>
>>>
>>>1. If I dump a 3.0.0 version of the com.google.protobuf/protobuf-java.jar
>>>in a project the depends on java classes generated by protoc v2.6.1 (or
>>>v2.5.0) will everything still work? That is, is the java runtime 
>>> backwards
>>>compatible?
>>>
>>> Unfortunately no. The 3.0.0 version protobuf-java.jar will not work with
>> java classes generated by protoc v2.6.1 (or v2.5.0). For those who can not
>> upgrade to 3.0 directly, we are considering releasing a 2.7 version which
>> provides the following compatibility guarantees:
>> 1. 2.7 protobuf-java.jar will be compatible with java classes generated
>> by protoc 2.6.1 and protoc 2.5.0.
>> 2. 3.0 protobuf-java.jar will be compatible with java classes generated
>> by protoc 2.7
>>
>> I.e., it allows you to upgrade to 3.0 in two steps: upgrade to 2.7, and
>> after all your dependencies are upgraded to either 2.7 or 3.0, you can
>> upgrade to 3.0 as well. It's not an ideal solution, but we hope it can help
>> ease the migration pain for some users. I'm testing this 2.7 version in a
>> github branch right now: https://github.com/google/protobuf/tree/2.7.0.
>> If you are interested, feel free to test it and any feedback is welcome.
>>
>>
>>>
>>>1. Is the binary wire format the same for purely proto2 messages? If
>>>I serialize messages generated from proto2 sources using the 3.0.0 java
>>>runtime will clients using protobuf v2.6.1 be able to decode the messages
>>>correctly?
>>>
>>> Yes. The wire format stays the same as long as you are using the proto2
>> syntax version.
>>
>> Thanks,
>>> Jeff
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Protocol Buffers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to protobuf+u...@googlegroups.com.
>>> To post to this group, send email to prot...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/protobuf.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
> *This message, including any attachments, may include private, privileged
> and confidential information and is intended only for the personal and
> confidential use of the intended recipient(s). If the reader of this
> message is not an intended recipient, you are hereby notified that any
> review, use, dissemination, distribution, printing or copying of this
> message or its contents is strictly prohibited and may be unlawful. If you
> are not an intended recipient or have received this communication in error,
> please immediately notify the sender by telephone and/or a reply email and
> permanently delete the original message, including any attachments, without
> making a copy.*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


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
> with encoded google.protobuf.Type message. The doc further states that
> URLs with no scheme assume HTTPS (and runtime support that I've seen looks
> like it intentionally leaves out the scheme when generating type URLs).
>
> However, the given URL examples for all well-known types don't work. Any
> GET request for https://type.googleapis.com/ fails with a 404.
> The actual example in the Any doc is for google.protobuf.Duration, and
> https://type.googleapis.com/google.protobuf.Duration simply does not work.
>
> I don't necessarily need these to work, but I have written stuff for
> resolving types per the doc and have no out-of-the-box URLs I can play with
> to test it.. It seems like an issue that none of the documented examples
> actually work.
>
Can you create an github issue and give more context about how you plan to
use it? Right now the type service doesn't exist because we find no use
case of it for our API service stack.


>
> 
> *Josh Humphries*
> jh...@bluegosling.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


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

2017-04-20 Thread Scott Sue
Hi Feng,

Is this still the case considering that 3.2.0 is out that allows the 
version number to be used by protoc?

General
* Added protoc version number to protoc plugin protocol. It can be used by
protoc plugin to detect which version of protoc is used with the plugin and
mitigate known problems in certain version 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  > wrote:
>
>> I've read through the release documents 
>>  for Protocol 
>> Buffers v3.0.0 but I can't find any statements regrading binary 
>> compatibility with version 2.6.1 (or earlier). There are a couple of things 
>> I'd like to know:
>>
>>
>>1. If I dump a 3.0.0 version of the 
>>com.google.protobuf/protobuf-java.jar in a project the depends on java 
>>classes generated by protoc v2.6.1 (or v2.5.0) will everything still 
>> work? 
>>That is, is the java runtime backwards compatible?
>>
>> Unfortunately no. The 3.0.0 version protobuf-java.jar will not work with 
> java classes generated by protoc v2.6.1 (or v2.5.0). For those who can not 
> upgrade to 3.0 directly, we are considering releasing a 2.7 version which 
> provides the following compatibility guarantees:
> 1. 2.7 protobuf-java.jar will be compatible with java classes generated by 
> protoc 2.6.1 and protoc 2.5.0.
> 2. 3.0 protobuf-java.jar will be compatible with java classes generated by 
> protoc 2.7
>
> I.e., it allows you to upgrade to 3.0 in two steps: upgrade to 2.7, and 
> after all your dependencies are upgraded to either 2.7 or 3.0, you can 
> upgrade to 3.0 as well. It's not an ideal solution, but we hope it can help 
> ease the migration pain for some users. I'm testing this 2.7 version in a 
> github branch right now: https://github.com/google/protobuf/tree/2.7.0. 
> If you are interested, feel free to test it and any feedback is welcome.
>  
>
>>
>>1. Is the binary wire format the same for purely proto2 messages? If 
>>I serialize messages generated from proto2 sources using the 3.0.0 java 
>>runtime will clients using protobuf v2.6.1 be able to decode the messages 
>>correctly?
>>
>> Yes. The wire format stays the same as long as you are using the proto2 
> syntax version.
>
> Thanks,
>> Jeff
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to protobuf+u...@googlegroups.com .
>> To post to this group, send email to prot...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
-- 
 *This message, including any attachments, may include private, privileged 
and confidential information and is intended only for the personal and 
confidential use of the intended recipient(s). If the reader of this 
message is not an intended recipient, you are hereby notified that any 
review, use, dissemination, distribution, printing or copying of this 
message or its contents is strictly prohibited and may be unlawful. If you 
are not an intended recipient or have received this communication in error, 
please immediately notify the sender by telephone and/or a reply email and 
permanently delete the original message, including any attachments, without 
making a copy.*

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.