v1.15.4
This is a bugfix release to address bugs in the desc/protoprint
package and a compatibility issue with the most recent version of github.com/bufbuild/protocompile
.
"github.com/jhump/protoreflect/desc/protoparse"
Changes/fixes:
- As of v1.15.0, this package uses the
github.com/bufbuild/protocompile
package under the hood as the parser. But that package is still using major version zero, since it's API has not completely stabilized. A recent release (v0.7.0) included backwards-incompatible changes that caused this repo to no longer compile. This release addresses the compile errors: this repo now uses that latest release ofprotocompile
and correctly compiles against it.
"github.com/jhump/protoreflect/desc/protoprint"
Changes/fixes:
- When a string literal included a double-quote character (
"
), it would get printed incorrectly leading to either an incorrect string literal in some cases or an invalid and uncompilable source file in others. This has been fixed. - When sorting elements in the file, if the file used proto3 syntax and had an enum with negative numeric values, the result would include the negative values first, before the zero value. This is not allowed in proto3 syntax, which requires that the zero value be the first value, so the result would be an invalid and uncompilable source file. This has been fixed.
- When a source file is parsed into a
FileDescriptorProto
but never linked, the descriptor may be missing thetype
field of aFieldDescriptorProto
(since it is not known whether a named type refers to a message, group, or enum), and it may have options left in theuninterpreted_options
field of the various options messages, which has a peculiar representation for aggregate values. When printing a descriptor that had these characteristics, they were not correctly handled, so the output of the printer would be an invalid and uncompilable source file. Both of these cases have been fixed.