1 2012-09-19 version 2.5.0:
4 * New notion "import public" that allows a proto file to forward the content
5 it imports to its importers. For example,
7 import public "bar.proto";
12 // Stuff defined in bar.proto may be used in this file, but stuff from
13 // baz.proto may NOT be used without importing it explicitly.
14 This is useful for moving proto files. To move a proto file, just leave
15 a single "import public" in the old proto file.
16 * New enum option "allow_alias" that specifies whether different symbols can
17 be assigned the same numeric value. Default value is "true". Setting it to
18 false causes the compiler to reject enum definitions where multiple symbols
19 have the same numeric value.
22 * New generated method set_allocated_foo(Type* foo) for message and string
23 fields. This method allows you to set the field to a pre-allocated object
24 and the containing message takes the ownership of that object.
25 * Added SetAllocatedExtension() and ReleaseExtension() to extensions API.
26 * Custom options are now formatted correctly when descriptors are printed in
28 * Various speed optimizations.
31 * Comments in proto files are now collected and put into generated code as
32 comments for corresponding classes and data members.
33 * Added Parser to parse directly into messages without a Builder. For
35 Foo foo = Foo.getParser().ParseFrom(input);
36 Using Parser is ~25% faster than using Builder to parse messages.
37 * Added getters/setters to access the underlying ByteString of a string field
39 * ByteString now supports more operations: substring(), prepend(), and
40 append(). The implementation of ByteString uses a binary tree structure
41 to support these operations efficiently.
42 * New method findInitializationErrors() that lists all missing required
44 * Various code size and speed optimizations.
47 * Added support for dynamic message creation. DescriptorDatabase,
48 DescriptorPool, and MessageFactory work like their C++ couterparts to
49 simplify Descriptor construction from *DescriptorProtos, and MessageFactory
50 provides a message instance from a Descriptor.
51 * Added pickle support for protobuf messages.
52 * Unknown fields are now preserved after parsing.
53 * Fixed bug where custom options were not correctly populated. Custom
54 options can be accessed now.
55 * Added EnumTypeWrapper that provides better accessibility to enum types.
56 * Added ParseMessage(descriptor, bytes) to generate a new Message instance
57 from a descriptor and a byte string.
59 2011-05-01 version 2.4.1:
62 * Fixed the frendship problem for old compilers to make the library now gcc 3
64 * Fixed vcprojects/extract_includes.bat to extract compiler/plugin.h.
67 * Removed usages of JDK 1.6 only features to make the library now JDK 1.5
69 * Fixed a bug about negative enum values.
70 * serialVersionUID is now defined in generated messages for java serializing.
71 * Fixed protoc to use java.lang.Object, which makes "Object" now a valid
75 * Experimental C++ implementation now requires C++ protobuf library installed.
76 See the README.txt in the python directory for details.
78 2011-02-02 version 2.4.0:
81 * The RPC (cc|java|py)_generic_services default value is now false instead of
83 * Custom options can have aggregate types. For example,
85 optional string comment = 1;
86 optional string author = 2;
88 extend google.protobuf.FieldOptions {
89 optional MyOption myoption = 12345;
91 This option can now be set as follows:
93 optional int32 field = 1 [(myoption) = { comment:'x' author:'y' }];
97 * Various speed and code size optimizations.
98 * Added a release_foo() method on string and message fields.
99 * Fixed gzip_output_stream sub-stream handling.
102 * Builders now maintain sub-builders for sub-messages. Use getFooBuilder() to
103 get the builder for the sub-message "foo". This allows you to repeatedly
104 modify deeply-nested sub-messages without rebuilding them.
105 * Builder.build() no longer invalidates the Builder for generated messages
106 (You may continue to modify it and then build another message).
107 * Code generator will generate efficient equals() and hashCode()
108 implementations if new option java_generate_equals_and_hash is enabled.
109 (Otherwise, reflection-based implementations are used.)
110 * Generated messages now implement Serializable.
111 * Fields with [deprecated=true] will be marked with @Deprecated in Java.
112 * Added lazy conversion of UTF-8 encoded strings to String objects to improve
114 * Various optimizations.
115 * Enum value can be accessed directly, instead of calling getNumber() on the
117 * For each enum value, an integer constant is also generated with the suffix
121 * Added an experimental C++ implementation for Python messages via a Python
122 extension. Implementation type is controlled by an environment variable
123 PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION (valid values: "cpp" and "python")
124 The default value is currently "python" but will be changed to "cpp" in
126 * Improved performance on message instantiation significantly.
127 Most of the work on message instantiation is done just once per message
128 class, instead of once per message instance.
129 * Improved performance on text message parsing.
130 * Allow add() to forward keyword arguments to the concrete class.
132 item = repeated_field.add()
136 repeated_field.add(foo=bar, baz=quux)
137 * Added a sort() interface to the BaseContainer.
138 * Added an extend() method to repeated composite fields.
139 * Added UTF8 debug string support.
141 2010-01-08 version 2.3.0:
144 * Parsers for repeated numeric fields now always accept both packed and
145 unpacked input. The [packed=true] option only affects serializers.
146 Therefore, it is possible to switch a field to packed format without
147 breaking backwards-compatibility -- as long as all parties are using
148 protobuf 2.3.0 or above, at least.
149 * The generic RPC service code generated by the C++, Java, and Python
150 generators can be disabled via file options:
151 option cc_generic_services = false;
152 option java_generic_services = false;
153 option py_generic_services = false;
154 This allows plugins to generate alternative code, possibly specific to some
155 particular RPC implementation.
158 * Now supports a plugin system for code generators. Plugins can generate
159 code for new languages or inject additional code into the output of other
160 code generators. Plugins are just binaries which accept a protocol buffer
161 on stdin and write a protocol buffer to stdout, so they may be written in
162 any language. See src/google/protobuf/compiler/plugin.proto.
163 **WARNING**: Plugins are experimental. The interface may change in a
165 * If the output location ends in .zip or .jar, protoc will write its output
166 to a zip/jar archive instead of a directory. For example:
167 protoc --java_out=myproto_srcs.jar --python_out=myproto.zip myproto.proto
168 Currently the archive contents are not compressed, though this could change
170 * inf, -inf, and nan can now be used as default values for float and double
174 * Various speed and code size optimizations.
175 * DynamicMessageFactory is now fully thread-safe.
176 * Message::Utf8DebugString() method is like DebugString() but avoids escaping
178 * Compiled-in message types can now contain dynamic extensions, through use
179 of CodedInputStream::SetExtensionRegistry().
180 * Now compiles shared libraries (DLLs) by default on Cygwin and MinGW, to
181 match other platforms. Use --disable-shared to avoid this.
184 * parseDelimitedFrom() and mergeDelimitedFrom() now detect EOF and return
185 false/null instead of throwing an exception.
186 * Fixed some initialization ordering bugs.
187 * Fixes for OpenJDK 7.
190 * 10-25 times faster than 2.2.0, still pure-Python.
191 * Calling a mutating method on a sub-message always instantiates the message
192 in its parent even if the mutating method doesn't actually mutate anything
193 (e.g. parsing from an empty string).
194 * Expanded descriptors a bit.
196 2009-08-11 version 2.2.0:
199 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
200 to generate code which only depends libprotobuf-lite, which is much smaller
201 than libprotobuf but lacks descriptors, reflection, and some other features.
202 * Fixed bug where Message.Swap(Message) was only implemented for
203 optimize_for_speed. Swap now properly implemented in both modes
205 * Added RemoveLast and SwapElements(index1, index2) to Reflection
206 interface for repeated elements.
207 * Added Swap(Message) to Reflection interface.
208 * Floating-point literals in generated code that are intended to be
209 single-precision now explicitly have 'f' suffix to avoid pedantic warnings
210 produced by some compilers.
211 * The [deprecated=true] option now causes the C++ code generator to generate
212 a GCC-style deprecation annotation (no-op on other compilers).
213 * google::protobuf::GetEnumDescriptor<SomeGeneratedEnumType>() returns the
214 EnumDescriptor for that type -- useful for templates which cannot call
215 SomeGeneratedEnumType_descriptor().
216 * Various optimizations and obscure bug fixes.
219 * Lite mode: The "optimize_for = LITE_RUNTIME" option causes the compiler
220 to generate code which only depends libprotobuf-lite, which is much smaller
221 than libprotobuf but lacks descriptors, reflection, and some other features.
222 * Lots of style cleanups.
225 * Fixed endianness bug with floats and doubles.
226 * Text format parsing support.
227 * Fix bug with parsing packed repeated fields in embedded messages.
228 * Ability to initialize fields by passing keyword args to constructor.
229 * Support iterators in extend and __setslice__ for containers.
231 2009-05-13 version 2.1.0:
234 * Repeated fields of primitive types (types other that string, group, and
235 nested messages) may now use the option [packed = true] to get a more
236 efficient encoding. In the new encoding, the entire list is written
237 as a single byte blob using the "length-delimited" wire type. Within
238 this blob, the individual values are encoded the same way they would
239 be normally except without a tag before each value (thus, they are
241 * For each field, the generated code contains an integer constant assigned
242 to the field number. For example, the .proto file:
243 message Foo { optional int bar_baz = 123; }
244 would generate the following constants, all with the integer value 123:
245 C++: Foo::kBarBazFieldNumber
246 Java: Foo.BAR_BAZ_FIELD_NUMBER
247 Python: Foo.BAR_BAZ_FIELD_NUMBER
248 Constants are also generated for extensions, with the same naming scheme.
249 These constants may be used as switch cases.
250 * Updated bundled Google Test to version 1.3.0. Google Test is now bundled
251 in its verbatim form as a nested autoconf package, so you can drop in any
252 other version of Google Test if needed.
253 * optimize_for = SPEED is now the default, by popular demand. Use
254 optimize_for = CODE_SIZE if code size is more important in your app.
255 * It is now an error to define a default value for a repeated field.
256 Previously, this was silently ignored (it had no effect on the generated
258 * Fields can now be marked deprecated like:
259 optional int32 foo = 1 [deprecated = true];
260 Currently this does not have any actual effect, but in the future the code
261 generators may generate deprecation annotations in each language.
262 * Cross-compiling should now be possible using the --with-protoc option to
263 configure. See README.txt for more info.
266 * --error_format=msvs option causes errors to be printed in Visual Studio
267 format, which should allow them to be clicked on in the build log to go
268 directly to the error location.
269 * The type name resolver will no longer resolve type names to fields. For
270 example, this now works:
273 optional int32 Foo = 1;
274 optional Foo baz = 2;
276 Previously, the type of "baz" would resolve to "Bar.Foo", and you'd get
277 an error because Bar.Foo is a field, not a type. Now the type of "baz"
278 resolves to the message type Foo. This change is unlikely to make a
279 difference to anyone who follows the Protocol Buffers style guide.
282 * Several optimizations, including but not limited to:
283 - Serialization, especially to flat arrays, is 10%-50% faster, possibly
284 more for small objects.
285 - Several descriptor operations which previously required locking no longer
287 - Descriptors are now constructed lazily on first use, rather than at
288 process startup time. This should save memory in programs which do not
289 use descriptors or reflection.
290 - UnknownFieldSet completely redesigned to be more efficient (especially in
291 terms of memory usage).
292 - Various optimizations to reduce code size (though the serialization speed
293 optimizations increased code size).
294 * Message interface has method ParseFromBoundedZeroCopyStream() which parses
295 a limited number of bytes from an input stream rather than parsing until
297 * GzipInputStream and GzipOutputStream support reading/writing gzip- or
298 zlib-compressed streams if zlib is available.
299 (google/protobuf/io/gzip_stream.h)
300 * DescriptorPool::FindAllExtensions() and corresponding
301 DescriptorDatabase::FindAllExtensions() can be used to enumerate all
302 extensions of a given type.
303 * For each enum type Foo, protoc will generate functions:
304 const string& Foo_Name(Foo value);
305 bool Foo_Parse(const string& name, Foo* result);
306 The former returns the name of the enum constant corresponding to the given
307 value while the latter finds the value corresponding to a name.
308 * RepeatedField and RepeatedPtrField now have back-insertion iterators.
309 * String fields now have setters that take a char* and a size, in addition
310 to the existing ones that took char* or const string&.
311 * DescriptorPool::AllowUnknownDependencies() may be used to tell
312 DescriptorPool to create placeholder descriptors for unknown entities
313 referenced in a FileDescriptorProto. This can allow you to parse a .proto
314 file without having access to other .proto files that it imports, for
316 * Updated gtest to latest version. The gtest package is now included as a
317 nested autoconf package, so it should be able to drop new versions into the
318 "gtest" subdirectory without modification.
321 * Fixed bug where Message.mergeFrom(Message) failed to merge extensions.
322 * Message interface has new method toBuilder() which is equivalent to
323 newBuilderForType().mergeFrom(this).
324 * All enums now implement the ProtocolMessageEnum interface.
325 * Setting a field to null now throws NullPointerException.
326 * Fixed tendency for TextFormat's parsing to overflow the stack when
327 parsing large string values. The underlying problem is with Java's
328 regex implementation (which unfortunately uses recursive backtracking
329 rather than building an NFA). Worked around by making use of possesive
331 * Generated service classes now also generate pure interfaces. For a service
332 Foo, Foo.Interface is a pure interface containing all of the service's
333 defined methods. Foo.newReflectiveService() can be called to wrap an
334 instance of this interface in a class that implements the generic
335 RpcService interface, which provides reflection support that is usually
336 needed by RPC server implementations.
337 * RPC interfaces now support blocking operation in addition to non-blocking.
338 The protocol compiler generates separate blocking and non-blocking stubs
339 which operate against separate blocking and non-blocking RPC interfaces.
340 RPC implementations will have to implement the new interfaces in order to
341 support blocking mode.
342 * New I/O methods parseDelimitedFrom(), mergeDelimitedFrom(), and
343 writeDelimitedTo() read and write "delemited" messages from/to a stream,
344 meaning that the message size precedes the data. This way, you can write
345 multiple messages to a stream without having to worry about delimiting
347 * Throw a more descriptive exception when build() is double-called.
348 * Add a method to query whether CodedInputStream is at the end of the input
350 * Add a method to reset a CodedInputStream's size counter; useful when
351 reading many messages with the same stream.
352 * equals() and hashCode() now account for unknown fields.
355 * Added slicing support for repeated scalar fields. Added slice retrieval and
356 removal of repeated composite fields.
357 * Updated RPC interfaces to allow for blocking operation. A client may
358 now pass None for a callback when making an RPC, in which case the
359 call will block until the response is received, and the response
360 object will be returned directly to the caller. This interface change
361 cannot be used in practice until RPC implementations are updated to
363 * Changes to input_stream.py should make protobuf compatible with appengine.
365 2008-11-25 version 2.0.3:
368 * Enum values may now have custom options, using syntax similar to field
370 * Fixed bug where .proto files which use custom options but don't actually
371 define them (i.e. they import another .proto file defining the options)
372 had to explicitly import descriptor.proto.
373 * Adjacent string literals in .proto files will now be concatenated, like in
375 * If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
376 the import path only contains "." (or contains "." but does not contain
377 the file), protoc incorrectly thought that the file was under ".", because
378 it thought that the path was relative (since it didn't start with a slash).
382 * Generated message classes now have a Swap() method which efficiently swaps
383 the contents of two objects.
384 * All message classes now have a SpaceUsed() method which returns an estimate
385 of the number of bytes of allocated memory currently owned by the object.
386 This is particularly useful when you are reusing a single message object
387 to improve performance but want to make sure it doesn't bloat up too large.
388 * New method Message::SerializeAsString() returns a string containing the
389 serialized data. May be more convenient than calling
390 SerializeToString(string*).
391 * In debug mode, log error messages when string-type fields are found to
392 contain bytes that are not valid UTF-8.
393 * Fixed bug where a message with multiple extension ranges couldn't parse
395 * Fixed bug where MergeFrom(const Message&) didn't do anything if invoked on
396 a message that contained no fields (but possibly contained extensions).
397 * Fixed ShortDebugString() to not be O(n^2). Durr.
398 * Fixed crash in TextFormat parsing if the first token in the input caused a
400 * Fixed obscure bugs in zero_copy_stream_impl.cc.
401 * Added support for HP C++ on Tru64.
402 * Only build tests on "make check", not "make".
403 * Fixed alignment issue that caused crashes when using DynamicMessage on
404 64-bit Sparc machines.
405 * Simplify template usage to work with MSVC 2003.
406 * Work around GCC 4.3.x x86_64 compiler bug that caused crashes on startup.
407 (This affected Fedora 9 in particular.)
408 * Now works on "Solaris 10 using recent Sun Studio".
411 * New overload of mergeFrom() which parses a slice of a byte array instead
413 * New method ByteString.asReadOnlyByteBuffer() does what it sounds like.
414 * Improved performance of isInitialized() when optimizing for code size.
417 * Corrected ListFields() signature in Message base class to match what
418 subclasses actually implement.
419 * Some minor refactoring.
420 * Don't pass self as first argument to superclass constructor (no longer
421 allowed in Python 2.6).
423 2008-09-29 version 2.0.2:
426 * License changed from Apache 2.0 to New BSD.
427 * It is now possible to define custom "options", which are basically
428 annotations which may be placed on definitions in a .proto file.
429 For example, you might define a field option called "foo" like so:
430 import "google/protobuf/descriptor.proto"
431 extend google.protobuf.FieldOptions {
432 optional string foo = 12345;
434 Then you annotate a field using the "foo" option:
436 optional int32 some_field = 1 [(foo) = "bar"]
438 The value of this option is then visible via the message's
440 const FieldDescriptor* field =
441 MyMessage::descriptor()->FindFieldByName("some_field");
442 assert(field->options().GetExtension(foo) == "bar");
443 This feature has been implemented and tested in C++ and Java.
444 Other languages may or may not need to do extra work to support
445 custom options, depending on how they construct descriptors.
448 * Fixed some GCC warnings that only occur when using -pedantic.
449 * Improved static initialization code, making ordering more
450 predictable among other things.
451 * TextFormat will no longer accept messages which contain multiple
452 instances of a singular field. Previously, the latter instance
453 would overwrite the former.
454 * Now works on systems that don't have hash_map.
457 * Print @Override annotation in generated code where appropriate.
460 * Strings now use the "unicode" type rather than the "str" type.
461 String fields may still be assigned ASCII "str" values; they will
462 automatically be converted.
463 * Adding a property to an object representing a repeated field now
464 raises an exception. For example:
465 # No longer works (and never should have).
466 message.some_repeated_field.foo = 1
469 * We now build static libraries rather than DLLs by default on MSVC.
470 See vsprojects/readme.txt for more information.
472 2008-08-15 version 2.0.1:
475 * New flags --encode and --decode can be used to convert between protobuf text
476 format and binary format from the command-line.
477 * New flag --descriptor_set_out can be used to write FileDescriptorProtos for
478 all parsed files directly into a single output file. This is particularly
479 useful if you wish to parse .proto files from programs written in languages
480 other than C++: just run protoc as a background process and have it output
481 a FileDescriptorList, then parse that natively.
482 * Improved error message when an enum value's name conflicts with another
483 symbol defined in the enum type's scope, e.g. if two enum types declared
484 in the same scope have values with the same name. This is disallowed for
485 compatibility with C++, but this wasn't clear from the error.
486 * Fixed absolute output paths on Windows.
487 * Allow trailing slashes in --proto_path mappings.
490 * Reflection objects are now per-class rather than per-instance. To make this
491 possible, the Reflection interface had to be changed such that all methods
492 take the Message instance as a parameter. This change improves performance
493 significantly in memory-bandwidth-limited use cases, since it makes the
494 message objects smaller. Note that source-incompatible interface changes
495 like this will not be made again after the library leaves beta.
496 * Heuristically detect sub-messages when printing unknown fields.
497 * Fix static initialization ordering bug that caused crashes at startup when
498 compiling on Mac with static linking.
499 * Fixed TokenizerTest when compiling with -DNDEBUG on Linux.
500 * Fixed incorrect definition of kint32min.
501 * Fix bytes type setter to work with byte sequences with embedded NULLs.
502 * Other irrelevant tweaks.
505 * Fixed UnknownFieldSet's parsing of varints larger than 32 bits.
506 * Fixed TextFormat's parsing of "inf" and "nan".
507 * Fixed TextFormat's parsing of comments.
508 * Added info to Java POM that will be required when we upload the
509 package to a Maven repo.
512 * MergeFrom(message) and CopyFrom(message) are now implemented.
513 * SerializeToString() raises an exception if the message is missing required
515 * Code organization improvements.
516 * Fixed doc comments for RpcController and RpcChannel, which had somehow been
518 * Fixed text_format_test on Windows where floating-point exponents sometimes
520 * Fix Python service CallMethod() implementation.
524 * VIM syntax highlighting improvements.
526 2008-07-07 version 2.0.0:
528 * First public release.