Packages
gpb
4.21.5
5.0.0
4.21.7
4.21.6
4.21.5
4.21.4
4.21.3
4.21.2
4.21.1
4.21.0
4.20.0
4.19.9
4.19.8
4.19.7
4.19.6
4.19.5
4.19.4
4.19.3
4.19.2
4.19.1
4.19.0
4.18.0
4.17.7
4.17.6
4.17.5
4.17.3
4.17.2
4.17.1
4.17.0
4.16.2
4.16.1
4.16.0
4.15.2
4.15.1
4.14.2
4.14.1
4.14.0
4.13.0
4.12.0
4.11.2
4.11.1
4.11.0
4.10.6
4.10.5
4.10.4
4.10.3
4.10.2
4.10.1
4.10.0
4.9.3
4.9.2
4.9.1
4.9.0
4.8.0
4.7.3
4.7.2
4.7.1
4.7.0
4.6.0
4.5.1
4.5.0
4.4.1
4.4.0
4.3.3
4.3.2
4.3.1
4.3.0
4.2.3
4.2.2
4.2.1
4.2.0
4.1.9
4.1.8
4.1.7
4.1.6
4.1.5
4.1.4
4.1.3
4.1.2
4.1.1
4.1.0
4.0.2
4.0.1
4.0.0
3.28.1
3.28.0
3.27.7
3.27.6
3.27.5
3.27.4
3.27.3
3.27.2
3.27.1
3.27.0
3.26.8
3.26.7
3.26.6
3.26.5
3.26.4
3.26.3
3.26.2
3.26.1
3.26.0
3.25.2
3.25.1
3.25.0
3.24.4
3.24.3
3.24.2
3.24.1
3.24.0
3.23.2
3.23.1
3.23.0
3.22.5
3.22.4
3.22.3
3.22.2
3.22.1
3.22.0
3.21.3
3.21.2
3.21.1
3.21.0
3.20.3
3.20.2
3.20.0
3.19.0
3.18.10
3.18.9
3.18.8
3.18.7
3.18.6
3.18.5
3.18.4
3.18.3
3.18.2
3.18.1
3.18.0
3.17.13
3.17.12
3.17.11
3.17.10
3.17.9
3.17.8
3.17.5
3.17.4
3.17.3
3.17.2
3.17.1
3.17.0
3.16.0
3.15.0
3.14.0
3.13.0
3.12.2
3.12.1
3.12.0
3.11.0
A compiler for Google protocol buffer definitions files for Erlang.
Current section
Files
Jump to
Current section
Files
ChangeLog
-*- coding: utf-8; indent-tabs-mode: nil -*-
Version 4.21.5
2025-Sep-14
* Bugfix verification and decoding for flat oneof with
maps with binary keys. Thanks to Thales Macedo Garitezi. (#239)
Version 4.21.4
2025-Aug-13
* Support Google protobuf 30.0 and later with NIFs.
Version 4.21.3
2025-Jan-13
* Add priv/proto3/google/protobuf/LICENSE covering
the .proto files in that directory. Thanks to Peter Lemenkov.
Version 4.21.2
2024-Dec-28
* Add a missing option to the gpb_defs:def() type. Thanks to
Paulo F. Oliveira. (#236)
* Support Google protobuf 26.0 and later with NIFs and JSON.
This version of Google protobuf deprecates the JSON option
always_print_primitive_fields and adds another option, the
always_print_fields_with_no_presence. Gpb now supports both
options. In gpb they both have the same behaviour as the
always_print_fields_with_no_presence option. For proto3
optional fields with omitted values, this brings a change,
in that the such fields are now printed for JSON.
Version 4.21.1
2024-Feb-19
* Emit @generated to mitigate a performance issue with ELP (#233)
* Update to support Erlang 27
* Bugfix edoc for {json_format, maps}
Version 4.21.0
2024-Jan-07
* Update the set of Google well-known protos by
importing from protobuf 4.25.1. Thanks to Gilbert. (#231)
* Add the possibility to parse a descriptor back to
gpb-internal definitions.
* Fix several minor bugs in the generation of descriptors.
* Set a minimum heap size to benchmarks to avoid excessive gc.
Version 4.20.0
2023-Oct-01
* Add an option enum_macros (-gen-enum-macros) to generate macros for
enum values, with the intention to make it possible to catch
enumerator symbol changes already in compile-time (#229)
Add sub-options {rename,{What,uppercase}}
and {rename,{enum_macros,How}} (corresponding to
-rename What:uppercase and -rename enum_macro:How)
* Add an option allow_preencoded_submsgs to specify a binary
for a sub-message. The intention is to make it encoding faster
if sub-messages are already known or occur several times. (#220)
* Add options {gen_encoders,bool()} and {gen_decoders,bool()}
to make it possible to omit encoders or decoders. The intention is
is to make it possible to shrink the footprint when not only
encoding or decoding is needed.
* Bugfix the cmd line option -rename What:lowercase.
* Support Erlang 26.1 and later. In Erlang 26.1 and later, exact
comparison with zero must now be written as +0.0 or -0.0, as a
preparation for Erlang 27. This is for both generated code
and in gpb eunit tests. (#230)
Version 4.19.9
2023-Aug-06
* Fix verifiers to catch floats for int fields. (#228)
Version 4.19.8
2023-Aug-06
* Fix code generation for options mapfields_as_maps and json (#227)
* Support Google protobuf 22.0 and later with NIFs and JSON.
* Include enough Erlang/OTP apps in the plt so that there are no
dialyzer issues with Erlang 26.
* Don't generate gpb_version.hrl unnecessarily.
Version 4.19.7
2023-Feb-04
* Support Google protobuf 3.16 and later with NIFs.
* Add an option {gen_verifiers, false} (no-gen-verifiers).
This implies {verify, never} (-v never)
* Don't emit -include("gpb.hrl") when not generating introspection
functions. It is not needed.
Version 4.19.6
2022-Sep-24
* Bugfix spec order for msg_name_to_fqbin and fqbin_to_msg_name
when there are no messages. (#221)
* Use iolists in the data-driven encoder in gpb.erl to improve
performance. Thanks to Saša Jurić. (#218)
Version 4.19.5
2022-Mar-17
* Fix a bug with the import_fetcher option and multiple imports.
An error {multiply_defined_file_or_files,["from_fetched.proto"]}
could occur and the defs would refer to the wrong proto file.
Version 4.19.4
2022-Mar-12
* Add a command line option -ignore-priv-dir for
the ignore_wellknown_types_directory option.
Version 4.19.3
2022-Mar-05
* Emit a -nifs() attribute on Erlang 25 when generating nifs.
Version 4.19.2
2021-Dec-05
* Wrap no_underspecs in a preprocessor check. (#212)
* Fix typos. Thanks to Ang Kian Meng Ang. (#213)
* Fix potential dialyzer issue for type encoders when all fields
are translated.
Version 4.19.1
2021-Aug-28
* Wrap errors in the data-driven encoder/decoder: On invalid input,
catch for instance function clause errors and re-raise as
a {gpb_error, Info} error instead. This has been the case
for the generated encoder/decoder since 3.28.1. #211.
* Add an option {include_mod_hrl_prepend, string()} which can
insert a string before the mod.hrl in the generated
-include("mod.hrl"). (related to erlang/rebar3#2610)
* Remove the old parser. There has been no reported problems
with the new parser for over a year.
Version 4.18.0
2021-Jun-10
* Add a new option, verify_decode_required_present (-vdrp) for
generating code that verifies that required fields are
present in message binaries during decoding. (#210)
Version 4.17.7
2021-May-27
* Bugfix building on windows (#208)
* Bugfix building with rebar3 >= 3.14.0 with _checkouts (#209)
Version 4.17.6
2021-May-19
* Fix generation of map types when targeting Erlang 17 and 18 (#196)
* Rework building outside of a git-repo:
- Add the possibility to manually specify version
by adding a gpb.vsn file.
- Add the concept of a version source: git | file
include this info in the generated code
- Add a --dest-dir=DIR option to the mk-versioned-archive
Version 4.17.3
2021-Apr-19
* Fix mk-versioned-archive to also substitute the
version in the gpb.app.src file.
Version 4.17.2
2021-Apr-19
* Fix mk-versioned-archive to actually also work
from a non-git directory tree.
Version 4.17.1
2021-Apr-17
* Fix compilation with Elixir 1.12.0, by respecting the
REBAR_BARE_COMPILER_OUTPUT_DIR env var during descriptor
compilation. Thanks to Michael Davis. (#204, #205)
* On decoding, mask ints to 32 or 64 bits. (#206)
* Rename helpers/export-from-git to mk-versioned-archive
and make it able to export also from a non-git dir,
allowing the version to be set using options.
Keep a symlink from the old name for backwards compatibility.
Version 4.17.0
2021-Apr-11
* Save all options as well as custom options, and introduce
versions 3 and 4 of the proto defs format. (#202)
See the doc/dev-guide/proto-defs-versions.md for more info.
The following definition elements were added and changed:
- Enum values have changed from 2-tuples to 3-tuples:
previously: {Symbol, Value}
now: {Symbol, Value, EnumValueOptions}
- Added: {{enum_options,EnumName}, [<option>, ...]}
- Added: {{service_options,ServiceName}, [<option>, ...]}
- Rpc (custom) option names now look like any other
custom option names.
- Option name elements can now contain tuples
to indicate parenthesized path components, as indicated
in the doc/dev-guide/proto-defs-versions.md.
The above redesign also fixes a crash when there were
enum option. (#203)
The default version of the returned format and of the format
in the generated introspection functions is still 1, for
backwards compatibility. Use the {proto_defs_version,4} option
in order to use the added definition elements.
* Add an option, introspect_get_proto_defs (-introspect-get_proto_defs)
Normally a get_msg_defs/0 function is generated, but this
has historically only contained message and enum elements.
With the introspect_get_proto_defs option, a get_proto_defs/0
is instead generated, containing the same definitions as returned
when compiling with the to_proto_defs option.
NB that the format version of the definitions for get_proto_defs/0,
as well as those for get_msg_defs/0, is by default 1, but can
be changed with the {proto_defs_version,N} option.
Version 4.16.2
2021-Feb-27
* Rework the import handling to check full paths when checking
if an proto to import has already been seen. #194
* In a verifier error, emit the faulty field as a string
instead of as an atom to avoid hitting the system limit
of 255 chars during the making of the error re ason. #195
* Fix spec for empty messages to work with dialyzer -Wunderspecs #196
Also emit -dialyzer({no_underspecs, <fn>/<arity>}) on erl >= 24.
* Fix the Erlang type of string fields: change to unicode:chardata()
from iodata() to allow for unicode code points >255. #200
For clarity, the encoding always worked with such code points,
it was just the field's type that was wrong.
* Fix help text when using protoc-erl.
* A few fixes for Erlang 24 (doc building and in an eunit test)
Version 4.16.1
2021-Jan-19
* Create Github releases on upload of new tagged versions.
This is done by a workflow script.
* Bugfix the export-from-git helper script.
Except for this fix, this release contains no functional change.
Version 4.16.0
2020-Nov-26
* Add an option preserve_unknown_fields (-preserve-unknown-fields)
If set, each message will have one extra field, '$unknowns'
in which info on any unknown fields are saved during
decoding, and which will be re-encoded after all other
field during encoding. (#189)
* Handle also proto3 syntax for extend Msg { Field; ... } (#190)
* Bugfix generation of json enum decoders for enums
not in any message (#192)
* Set rebar3 as hex build tool. (#191)
Version 4.15.2
2020-Nov-07
* Fixes for dialyzer issues in generated code,
mostly when generating for Erlang 17 and 18. (#188)
Version 4.15.1
2020-Nov-01
* Fixup a workflow syntax error.
Version 4.15.0
2020-Nov-01
* Add -M family of (makedep) cmd-line options and
the gpb_compile:[string_]list_io/2,3 functions to
retreieve dependencies, and outputs from code generation.
* Fix a link to rebar3. (#187). Thanks to aqian1103 for notifying.
* Switch to github workflows from travis.
Version 4.14.2
2020-Oct-17
* Apply renames to the enum type also in export_type. Thanks
to Jonas Boberg. (#185, #186)
* Bugfix gpb:msg_to_map/3 for proto3 messages.
* Fix map associations in type specs and instead indicate
proto presence in comments.
Version 4.14.1
2020-Sep-05
* Add a utility gpb:decode_packet/3 mimicking erlang:decode_packet/3,
but for varint length encoded framing of data.
* Document the public API in gpb.erl.
* Document gpb_defs:fetch_imports, it is part of the API.
* Fix some dialyzer issues in generated code
* Add back some non-API functions to gpb_parse and gpb_scan
with the intention of getting exprotobuf going again until
its issue bitwalker/exprotobuf#114 has been addressed.
Version 4.14.0
2020-Jul-24
* Introduce a new parser to fix issues with keywords in
identifier positions. Here are a few examples of .proto that
the old parser could not handle, but the new one can:
package a.service.b; // 'service' is also a keyword
message enum { optional int32 f = 1; } // 'enum'
message rpc { optional int32 f = 1; } // 'rpc'
The new parser is a recursive-descent parser that is
free of such limitations.
Several parsing shortcomings have also been fixed, such as:
* Options for oneof, service extensions and groups,
as well as option blocks: { ... }
* Allow inf, -inf and nan as default values for float/double
* Allow "to max" and negative values for reserved
* Allow reserved names and numbers in enums too
* Allow, but ignore, public or weak in import
The intention is that the new parser should accept all files
that the old parser accepted, and more. Should there be any
need to invoke the old parser, eg for comparison or due to bugs,
it is possible:
* Set the environment variable GPB_PARSER to old
* Set the option {parser,old}
Note that these options will exist only temporarily. The
intention is to keep the old parser for a few releases,
and then remove it.
The functions in gpb_parse and gpb_scan have changed.
However, they were never part of the external API.
To retrieve parsed proto definitions use this instead:
gpb_compile:file(..., [to_proto_defs, ...]).
Version 4.13.0
2020-Jun-30
* Add support for `optional` fields in proto3 messages.
This is new in Google's protobuf 3.12.0. In gpb, this is
supported out-of-the-box, without any special option option.
Related to this, the proto defs format has changed and also
gotten versioned. The new version is needed to represent
proto3 messages with optional fields. By default, when gpb
returns proto defs, these are returned on the old format,
for backwards compatibility in gpb-4.x.x. For more info,
see to the doc/dev-guide/proto-defs-versions.md file.
Version 4.12.0
2020-Apr-27
* Add possibility to build on Windows with no Cygwin. Thanks to
yidayoung. (#182)
* Add gpb:msg_to_map/3 and gpb:msg_from_map/4.
* Fix an warning in the generated nif code with protobuf >= 3.7.0.
Version 4.11.2
2020-Apr-09
* Fix parsing enum option deprecated. Thanks to Paul Swartz for a
testcase. (#179)
Version 4.11.1
2020-Mar-10
* Fix a bug in comments generated for 64 bit integer types,
they were all indicated in the comment as being 32 bits.
* Fix a bug in the type spec generated for oneof fields,
when oneof alternatives were translated: they were
lacking the wrapping tuple, or (for flat oneofs) never included the
translated type at all.
* Fix a bug where the decode translator for proto3 scalar fields
was never called if the field had the default value.
Version 4.11.0
2020-Jan-09
* Add an option, ignore_wellknown_types_directory, for not
trying to read and use the priv/proto3/google/protobuf directory
for wellknowns. Thanks to Nicolas Martyanoff. (#176, #177)
Version 4.10.6
2019-Nov-02
* Fix a bug for an error return value for missing keys
when map_key_type = binary
* Improve description on what proto3 means for optional fields,
especially for the maps_unset_optional = omitted option.
Version 4.10.5
2019-Oct-25
* Fix a bug in the generated verifiers for option
map_key_type = binary: it would report any field
as extraneous. #174
Version 4.10.4
2019-Oct-05
* Fix a dialyze issue for map<_,_> type fields
in generated code (#171).
Version 4.10.3
2019-Oct-03
* Avoid unnecessary recompilation
* Fix a eunit test error with Erlang 21.1
Version 4.10.2
2019-Sep-08
* Fix parsing of custom options for enums.
Version 4.10.1
2019-Aug-16
* Handle the special JSON mapping of proto3 wellknowns, such as
google.protobuf.Duration, google.protobuf.Struct, wrapper types etc.
Only the google.protobuf.Any is not yet handled.
Version 4.10.0
2019-Jul-11
* New options {gen_mergers,false} (-no-gen-mergers)
and {gen_introspect,false} (-no-gen-introspect)
mainly to reduce size of the generated code, especially with nif.
The first option even requires nif, since merging is an integral
part of decoding, generally. (#168)
* Make the rename option available also as a command line
option. (#168)
* Make nif code generation handle renamings. (#168)
Version 4.9.3
2019-Jul-10
* Find and report more errors. Previously these often resulted
in compilation errors for generated code, but now more errors
get caught and reported.
Version 4.9.2
2019-Jul-09
* Add support for the json_name field option
* Add json support for aliased enums (option allow_alias=true)
* A few bugfixes and refactorizations
Version 4.9.1
2019-Jul-09
* Fix bug in nif generation for imports with different
packages. (#168)
Version 4.9.0
2019-Jul-02
* Add JSON support via the json options (#164)
* Add option to prefix/suffix type names (#165)
* Minor fixes and updates
Version 4.8.0
2019-Jun-06
* Drop support for Erlang 17 and earlier, now that Erlang 22 is
out and rebar3 has dropped support for the same versions. At
the moment, things still work, but in the future, the support
will gradually erode. (#133)
* Bugfix generation of an unused functions for when strings were
only occurring in proto3 oneof fields.
* Bugfix compilation functions return type spec.
Version 4.7.3
2019-May-03
* Bugfix type specs for strings. Thanks to 柯林呵呵呵. (#166)
Version 4.7.2
2019-Mar-09
* Wellknown type (google/protobuf/*.proto) can be imported also for
syntax="proto2", just like how it is for protoc.
* Misc doc improvements, including addition of developer's guides,
see doc/dev-guide/*.md
Version 4.7.1
2019-Mar-08
* Fix descriptor compilation in rebar3 (and rebar2)
also when gpb is compiled as a dependency.
Version 4.7.0
2019-Mar-08
* Generate a set of query functions for translating to and from
fully qualified binaries (fqbin) and internal format, as well as
functions for locating proto by type definition name. (#163)
Thanks to Tristan Sloughter.
* For descriptors, also keep track of what proto file each type
definition belongs to, by new {file,Info} entries interspersed
in the definitions. (#163) Thanks to Tristan Sloughter.
* Bugfix descriptors, ie the self-description info generated when the
option descriptor (-descr) is specified. (#163)
Thanks to Tristan Sloughter.
This introduces a POTENTIAL INCOMPATIBILITY, for code that relied
on details of the old, erroneous, descriptors.
Version 4.6.0
2019-Jan-23
* Fix error when generating descriptors for protos importing other
protos, each having package definitions. Thanks to Tristan Sloughter
for reporting. (#162)
* Generate a new function, source_basename/0 for retrieving the basename
of the (main) input source file. Thanks to Tristan Sloughter for the
idea. (#162)
* Fix error when running edoc after having compiled more than once. The
gpb_scan.erl got prepended multiple times with a @doc chunk.
Version 4.5.1
2019-Jan-09
* Fix dialyzer error in generate code when there were no services.
Thanks to Guilherme Andrade. (#161)
Version 4.5.0
2019-Jan-03
* Don't edoc generated files by marking them as @private. Thanks to
Tristan Sloughter. (#159)
* Generate the functions below. These can convert between fully
qualified service names (ie with package) and rpc name as binaries, to
internal names, as atoms, and back. These functions do take into
consideration options use_packages as well as any renaming options.
The intended use case is from grpc server or client code.
- uses_packages()
- fqbin_to_service_name/1
- service_name_to_fqbin/1
- fqbins_to_service_and_rpc_name/2
- service_and_rpc_name_to_fqbins/2
Version 4.4.1
2018-Dec-03
* Bugfix decoding: with maps and proto3 unset sub-messages decoded to
undefined instead of getting omitted. (#158)
This introduces a POTENTIAL INCOMPATIBILITY, for code that relied on
finding the value undefined, which was arguably somewhat unexpected.
Version 4.4.0
2018-Sep-28
* New option, bypass_wrappers (-bypass-wrappers). (#153)
* Fix bash paths for FreeBSD, and incdir variable in Makefile.
Thanks to Krzysztof Jurewicz. (#155, #156)
* Drop interim stacktrace macro-overrides GPB_FUNCTION_STACK and
GPB_PATTERN_STACK, and rely on the ?OTP_RELEASE macro, for
better direct portability across Erlang pre- and post-21. (#154)
Version 4.3.3
2018-Sep-11
* Revert the inclusion of the PropEr tests of 4.3.2,
due to licensing issues. (#152)
Version 4.3.2
2018-Sep-03
This release brings no new options or fixes, but improves on
testing of gpb.
* Add PropEr tests: Use "rebar3 as test proper" to run them.
This is a conversion of the gpb-eqc tests. Thanks
to Pierre Fenoll. (#142, #151)
* Run with protobuf >= 3.0.0 in Travis. Previously, 2.5.0 was
used. Thanks to Pierre Fenoll for bringing this up. (#144)
* Bugfix nif unit tests with libprotobuf 2.6
Version 4.3.1
2018-Aug-30
* Fix math.h/cmath and isnan/isinf issue for NIF code.
Thanks to François Bernier. #150
Version 4.3.0
2018-Aug-29
* Add options to translate all fields and types: {translate_type,T}
{translate_field,T} (-translate_type, -translate_field)
* Add option to have map keys as binaries, for interop with
other libraries: {maps_key_type,binary} (-maps_key_type binary).
Thanks to Leonardo Rossi for proposing this functionality. #138
Version 4.2.3
2018-Aug-28
* Fix a dialyzer issue (a redundant check for undefined) in
decoding for proto3. Thanks to Tristan Sloughter for reporting.
Version 4.2.2
2018-Aug-23
* For NIFs, also accept enums as integers. Thanks to
Jean-Alexandre Barszcz. (#147, #148)
* Fix NIF generation when fields are C++ reserved words, Thanks to
Jean-Alexandre Barszcz for reporting. (#146)
* Fix type specs for oneof fields beginning in uppercase.
Version 4.2.1
2018-Jul-13
* Fix proto3 bug in encoding of default values for enums when
given as 0 instead of as atom. Thanks to Jean-Alexandre Barszcz
for reporting.
Version 4.2.0
2018-Jun-27
* Add an option, translate_type (-translate_type). Previously the
any_translate option could generate code that called translation
functions for google.protobuf.Any messages. Translator functions can now
be called for any types of (sub) message. Thanks to Tristan Sloughter
for asking the question that prompted this.
* Add an option {maps_oneof,flat}. For maps, it changes the
Erlang representation of oneof fields from #{..., c => {x,Value}, ...}
to #{..., x => Value}, ...}
* Generate type specifications for records, and refer to them. This
makes it possible to generate types also when there are cyclic
dependencies. Thanks to Peter Zeller.
Version 4.1.9
2018-Jun-14
* Bugfix crash when using the renaming options such as
msg_name_to_lower, when the protobuf files contains package
definitions, and the use_packages option is not specified. Thanks
to Mark Geib for reporting. (#139)
Version 4.1.8
2018-May-25
* Use the OTP_RELEASE macro in generated code, so it can compile
cleanly with different OTP versions. The OTP_RELEASE will
appear in Erlang 21; it has been merged to master, but it is not
in Erlang 21-rc1, so still honour the GPB_FUNCTION_STACK and
GPB_PATTERN_STACK macros described for 4.1.6 below.
Version 4.1.7
2018-May-13
* Fix improper interpretation of nested extend block. If inside
a message, extending another message, the surrounding message
was wrongly extended, but this as now been fixed. Thanks to Paul
Guyot for reporting.
Version 4.1.6
2018-May-08
* Make the Erlang 21 stacktrace syntax choice overridable.
In addition to the targeting version described in 4.1.5 below,
make it possible to override the stacktrace selection:
When targeting Erlang 21 or later, generate code that uses the new
stacktrace syntax, but if the user defines 'GPB_FUNCTION_STACK' when
compiling the generated code, it overrides.
When targeting Erlang 20 or earlier, generate erlang:get_stacktrace/0
calls, but if the user defines 'GPB_PATTERN_STACK' when compiling
the generated code, it overrides.
Version 4.1.5
2018-May-04
* Prepare for new Erlang 21 stacktrace syntax. If gpb runs on
the Erlang 21, or if the {target_erlang_version,N} (-for-version N)
option is set to 21, then gpb generates code that uses the new
stacktrace syntax, instead of the deprecated erlang:get_stacktrace/0.
Version 4.1.4
2018-May-04
* Fix type spec for field of types bytes. Thanks to Marc Nijdam.
Version 4.1.3
2018-Feb-08
* Build changes: Provide better errors when building
outside of a git repo, and provide a helper script,
helers/export-from-git, to extract gpb from git in a way such
that it can be compiled outside of git.
Version 4.1.2
2018-Jan-26
* Fix Dialyzer issues in generated code. This regression was
introduced already in 3.23.0, but only if the type_specs (-type)
option was specified. That option was on by default in 4.0.0.
Thanks to GeraldXv for reporting.
Version 4.1.1
2018-Jan-04
* Bugfix a renaming check: Check for duplicate rpc names only per
service. The same rpc name can be used in different services, but in
4.1.0, this was not allowed. Thanks to Tristan Sloughter for reporting.
Version 4.1.0
2017-Dec-30
* Rework renaming options, to make it easier to work with grpc
where package, service and rpc names are exposed. The new
options are {rename,{What,How}} where What can specify eg msg_name
or msg_fqname to operate on only the msg name or the fully
qualified name, ie prepended with package name. How can be eg
lowercase or snake_case.
New renaming possibilities for How are: base_name and
dots_to_underscores.
The old msg_name_* options are still handled in backwards
compatible way.
Thanks to Tristan Sloughter for the suggestions.
Version 4.0.2
2017-Nov-18
* Prepare for Erlang 21 by using string functions that are new
in Erlang 20 and stop using the ones that are going to be
deprecated in Erlang 21.
Version 4.0.1
2017-Nov-07
* Fix a build issue.
Version 4.0.0
2017-Nov-07
* When generating for maps, the maps_unset_optional = omitted
is now the default. This is an INCOMPATIBILITY. The previous
default was present_undefined. This incompatibility is also a
reason for the stepping to a new major version.
* Type specs are generated by default when possible.
The option `{type_specs,false}` (-no_type) can be used if
this is undesirable for some reason.
* Automatically append current directory, ".", to the include path.
* Treat dashes and underscores in command line opts equally
* Refactor code into separate modules (gpb_compile.erl was far
too long)
* Rework decoding by breaking out various parts to separate steps.
Version 3.28.1
2017-Nov-02
* Similar to the fix in 3.28.0, but for encoding: Warn and
ignore the option packed for repeated fields that are not
allowed to be packed, such as string, bytes and sub
messages. Such fields were not allowed to be be packed i the
first place, but gpb never said anything so this could go
unnoticed. And gpb packed them in an invalid fashion, that was
probably incompaitble with other protobuf parsers/encoders.
For such fields, this introduces a POTENTIAL INCOMPATIBILITY,
in that the invalid option is now ignored and warned about.
* Add an option {module_name, Name} (-modname Name) for
entirely controlling the resulting module name, instead of
only being able to prefix or suffix it. Thanks to
Tomas Johansson for the suggestion.
* Wrap decoding in a {gpb_error, {decoding_failure, ...}}
if it fails. Thanks to Tristan Sloughter for the suggestion.
Version 3.28.0
2017-Oct-14
* Fix decoding of packed/non-packed repeated. If a repeated
fields was declared as packed, but an encoder encoded it as
non-packed (or vice versa), then gpb previously failed to decode
it.
This introduces a POTENTIAL INCOMPATIBILITY: For repeated packed
fields of type string, bytes and sub messages: such fields were
actually non-packable but gpb accidentally accepted them.
Messages with such fields were packed invalidly, and gpb of this
version will not be able to unpack/decode such stored messages.
Thanks to Moxley Stratton for reporting.
* Make the -spec for encode_msg more narrow to avoid some
dialzer underspec warnings. Note that all underspecs warnings
can not in general be avoided. Thanks to Moxley Stratton and
Kevin C. Baird for fixing and to Heinz N. Gies for reporting.
Version 3.27.7
2017-Sep-19
* When verifying maps with maps_unset_optional = omitted,
signal an error if extraneous fields are present, since they
might be misspellings of optional fields. Thanks to Guilherme Andrade
for the suggestion to do this.
Version 3.27.6
2017-Aug-19
* Add type-defaults to proto3 message records. Thanks to Evan
Vigil-McClanahan and Tristan Sloughter.
Version 3.27.5
2017-Aug-16
* Apply tolower or snakecase to rpc names as well. Thanks to Tristan
Sloughter.
* Fix an edoc generation bug in gpb_parse.yrl with the edoc opt
{preprocess,true}.
Version 3.27.4
2017-Aug-07
Minor small issues
* Fix crash in encoding of string fields in proto3 messages,
when the string contained code-points >= 256.
* Fix wrong type-default in encoding for bytes fields in proto3
messages, when the bytes was specified as an iolist.
* Improve typespec for map<_,_> type fields to use := in Erlang 19+
* Fix dialyzer issues in the generated code
* Fix decoding of map<_,_> type field items with missing keys
or values so they decode to type-defaults. Thanks to Tiago
Guedes for reporting.
Version 3.27.3
2017-Jul-10
* Repeated fields can now be omitted with maps if option
maps_unset_optional = omitted. This makes sense especially
for proto3. Thanks to Adam Cook.
* Parse custom message and field options. Custom message
options land in {{msg_options,MsgName},[{Name,Value}] items
in the output when compiling with to_proto_defs. Thanks
to Tristan Sloughter for reporting.
* Improve unit tests to also cover generated hrl files
One issue fixed: when only mapfields_as_maps (-mapfields_as_maps)
but not the maps (-maps) option was set.
Version 3.27.2
2017-Jun-18
* Bugfix code generation for empty groups.
Version 3.27.1
2017-Jun-16
* Add support for custom options. Thanks to Geoff Hayes.
Version 3.27.0
2017-May-28
* Add support for groups. Thanks to David Weinstein for prompting
this to get implemented.
Version 3.26.8
2017-Mar-24
* Fix name resolution bugs when extending messages in enclosing
packages and in other packages. Thanks to Michael Ries for reporting.
Version 3.26.7
2017-Mar-15
* Fix default for map type fields (map<_,_>) when the
mapfields_as_maps option is set. Thanks to Tristan Sloughter
Version 3.26.6
2016-Dec-29
* Improve parser to accept keywords such as "message" also as
message names. This applies to enums, oneof names as well as
service and rpc names too. Thanks to ionuthristodorescu for
reporting.
Version 3.26.5
2016-Dec-10
* Consider also messages also for map fields when calculating
order of messages, so that type specs for record fields come in
the right order. Thanks to Tristan Sloughter.
Version 3.26.4
2016-Oct-21
* Add api functions gpb_compile:{locate,read}_import/2 and
gpb_parse:fetch_imports/1 to facilitate eg proto file dependency
tracking.
* Add -types and convert @spec doc tags to proper -specs.
Version 3.26.3
2016-Oct-05
* Fix dialyzer issue with Erlang 19 in the generated code. Thanks
to Sargun Dhillon for reporting. The generated code for merging
messages unnecessarily/erroneously checked required scalar fields
for undefined.
Version 3.26.2
2016-Oct-04
* Integrate with Travis CI. Thanks to Luke Bakken.
* Improve unit tests:
- increased timeouts for slow machines
- eunit test bug fixes for hosts running a 32 bit os
- bug fix for nif tests for when Google's protobuf library
is not installed on the host
Version 3.26.1
2016-Sep-27
* Don't generate auxiliary functions id/2, cons/3,
lists_reverse/2, 'erlang_++'/3 if they are not used.
Thanks to Tristan Sloughter for reporting.
Version 3.26.0
2016-Sep-21
* New option {target_erlang_version,N}. Thanks to Eric
Meadows-Jönsson for suggensting this.
* New options defaults_for_omitted_optionals and
type_defaults_for_omitted_optionals. Also improved
epb_compatibility when fields have [default=...] specified.
Thanks to Luke Bakken for finding and analyzing this.
* Fix for accessing bin/protoc-erl via symlinks. Thanks to
Wang Chao.
* Clarified licensing conditions. Thanks to Luke Bakken for
proposing this.
* Fixes for type-default handling for proto3.
* Fixes for Erlang 19 (eunit and dialyzer)
Version 3.25.2
2016-Aug-25
* New options: mapfields_as_maps, defs_as_maps and msgs_as_maps
(-mapfields-as-maps, -defs-as-maps and -msgs-as-maps). Previously,
these were all the same maps option, but now the maps option
merely expands to the above.
Version 3.25.1
2016-Aug-24
* New option, epb_functions, to control generation of epb
compatibility functions encode/1, decode/2 etc. The
epb_compatibility option now implies also epb_functions.
* Fix for the by_proto sub-option to msg_name_prefix for map-type
fields. Thanks to Tristan Sloughter.
* Add parsing of stream indicator to rpc service definitions.
* Fix bug in fetch_rpc_def/2 for options maps (-maps) and
defs_as_proplists (-pldefs).
Version 3.25.0
2016-Aug-16
* Fix a crash for message name prefixing and suffixing or
lower-casing for oneof, and also handle this for map<_,_> fields.
Thanks to Tristan Sloughter.
* Add an option, msg_name_to_snake_case, to turn SomeMsgName into
some_msg_name. Thanks to Tristan Sloughter.
* Improve rebar3 compatibility. Thanks to Tristan Sloughter.
* Make it possible to specify msg name prefix on a per-proto-file
basis using the by_proto sub-option. Thanks to Tristan Sloughter.
* Make the epb_compatibility option also imply the
msg_name_to_lower option, and a "_pb" module_name_suffix option.
* Add gpb_compile:string/2,3 to compile from a string
* Add an option, import_fetcher to make it possible to specify
an alternate source of imported files, instead of using the file
system.
* Add examples to the README
Version 3.24.4
2016-Aug-08
* Proto3: Fix encoding of repeated fields of types string, bytes
and sub messages. These were erroneously defaulted to packed.
* Proto3: Fix parsing of unused fields: non-repeated message
fields are optional, but were erroneously parsed as required,
thanks to Tyler Margison for fixing.
* A new Erlang Protobuffs option: epb_compatibility (-epb):
If this option is specified, generate also functions encode/1,
decode/1, encode_<MsgName>/1 and decode_<MsgName>/1.
* Simplified interface for verifying translators for
google.protobuf.Any messages: the '$errorf' is deprecated.
Version 3.24.3
2016-Jul-29
* Decode unknown enums to integers. Integers are allowed for
encoding, for symmetry. Thanks to Eric Meadows-Jönsson for
suggesting.
* Fix epb compat function when the .proto contained no
messages, and the maps option was specified.
* Fix a bad type spec for the generated encode_msg, to make
dialyzer happier again about the generated code.
Version 3.24.2
2016-Jul-25
* Fix parsing of rpc method options. Thanks to Tony Han for
reporting.
Version 3.24.1
2016-Jul-25
* In 3.24.0, the input encoding was effectively changed to UTF-8,
whereas it previously was not defined, but in practice
it was latin1. Now, both for backwards compatibility, and also
for similarity with the behaviour of Google protobuf, treat the
input format as UTF-8 if possible, and fallback to latin1.
Version 3.24.0
2016-Jul-23
* Several improvements for compatibility with Erlang protobuffs,
thanks to Luke Bakken for all of these:
-- bool fields: Accept also 0 and 1 on encoding
-- bytes fields: Accept also iolists on encoding
-- API: Add compatibility functions encode/1 and decode/2
* Accept an UTF-8 byte order mark (BOM). This is accepted by Google
protobuf 3.0.0. Thanks to Julius Beckmann for highlighting this.
* Related to the UTF-8 BOM, UTF-8-decode the input .proto files, and
UTF-8-encode the generated files.
Version 3.23.2
2016-Jul-19
* Bugfix compilation error with rebar on Erlang R16 and earlier.
Version 3.23.1
2016-Jul-19
* It is now possible to pass user-data---via an option to the
generated encode_msg, decode_msg, merge_msgs and verify_msg
functions---to translators for google.protobuf.Any messages.
* Type specs for strings now say iolist, because this is what they
accept on encoding. On decoding, they always return strings or
binaries depending on the strings_as_binary (-strbin) option.
* Correct benchmark measurements.
Version 3.23.0
2016-Jul-12
* Add possibility---the any_translate option---to specify a
callback for translating (packing on encode and unpacking on
decode) google.protobuf.Any types.
Version 3.22.5
2016-Jun-30
* Bugfix a regression, which was introduced in 3.22.4, so that it
is now again possible use integers for floating point fields, in
the call to encode_msg. Thanks to Ilya Khaprov for spotting this.
Version 3.22.4
2016-Jun-30
* For floats, handle infinity, and not a number. They are
represented as the atoms infinity, '-infinity' and nan. Thanks to
Ilya Khaprov for reporting this and hinting at a solution.
Version 3.22.3
2016-Jun-15
* Running the eunit tests previously caused the files x.erl and
x.hrl to be created as a side-effect, this has been fixed: they
are no longer created.
* Don't include the timestamp in a comment in the generated source
code, for the purpose of reproducible builds.
Version 3.22.2
2016-Jun-04
* For proto3, automatically find well-known types in imports,
without the user explicitly having to specify include paths.
This is done by adding an internal include path last.
Version 3.22.1
2016-Jun-03
* Fix an bug in the generated code in Erlang 17. An attribute to
mute dialyzer, for generated verifiers, wasn't available until
Erlang 18, but erroneously used with too old Erlang versions.
* Fix an bug in the generated code for fields of type
map<KeyType,ValueType> for Erlang 17. A syntax that wasn't
available until Erlang 18 was erroneously used already
with Erlang 17.
Version 3.22.0
2016-Jun-03
* Add proto3 support to a rudimentary level: support for the new
syntax and semantics, but not yet any well-known types, or any
JSON mapping.
* Fix more dialyzer errors in the generated code.
* For Erlang 19, use := for the type specs for maps for mandatory
fields (required and repeated). For earlier Erlang versions,
fallback to using the => notation.
* Improve the error when an import file is not found, to make it
easier to trouble-shoot search path problems.
Version 3.21.3
2016-May-30
* Add support for extending messages in other packages. As part
of this, also fixup resolution of what 'extend' refers to.
Thanks to Steven Gravell for reporting and providing code
outlining the way to go.
* Fix a bug if a message is 'extend'ed more than once.
Version 3.21.2
2016-May-27
* Make it easier to HiPE compile benchmarks. Thanks to Luke
Bakken.
* Fix dialyzer error in the generated code, in verifiers for
repeated fields, with the -Wunmatched_returns flag to dialyzer.
Thanks to Luke Bakken for reporting this.
Version 3.21.1
2016-May-25
* Improve performance slightly for maps by replacing calls to
maps:find with map matching expressions. On the benchmarks, it
only yields a 2-7% speedup, but the generated code looks nicer.
* Refine the type definitions in gpb.hrl
* Make dialyzer happy about gpb. (It is also happy about generated
code.)
* Several benchmark updates:
-- Make it easier to run benchmarks for code generated with -maps.
-- Update the benchmarks/README.txt, thanks to Luke Bakken.
-- Use pkg-config if present to get protobuf lib information,
thanks to Luke Bakken.
-- Use which to find protoc command, else use PROTOC or PROTOHOME,
thanks to Luke Bakken.
-- Pass CXXFLAGS to C++ compiler so that include path to erl_nif.h
can be specified, thanks to Luke Bakken.
Version 3.21.0
2016-May-17
* Add support for map fields, ie fields of type
map<KeyType,ValueType>. Only scalars (but not enums) and strings
(not bytes) are allowed as keys. Any type, except maps, is
allowed as value. Map fields are about to make it into Google
protobuf 3.0.0, which as of this writing is still in beta. It
appears it will be available in 3.0.0 for both proto2 and proto3
syntaxes. (So far, gpb does not support proto3 at all.) Map fields
have been tested with Google protobuf 3.0.0-beta2.
The erlang-internal representation of a map<_,_> field is a list
of 2-tuples---the order is undefined on decoding---or an Erlang map
if the maps option is used.
* Some option texts have been improved for the "protoc-erl --help"
command.
* With the maps option specified, the generated verifier now produces
a more helpful error if any non-optional fields are missing from
the map.
* The descriptor proto has been updated (the -descr option).
* The README has been updated.
Version 3.20.3
2016-May-04
* Encode negative int32 values using 64 bits, for interop with
other implementations. On decoding, assume either 32 or 64 bit
encodings can appear. This is what Google's protobuf (C++) does.
The same goes for negative enums. Thanks to YeJun Su for
reporting.
Version 3.20.2
2016-Apr-08
* Don't try to generate default values for maps. Thanks to
Louis-Philippe Gauthier.
* Accept the syntax="proto2"; statement, but so far only "proto2".
Thanks to Louis-Philippe Gauthier for suggesting support of the
syntax statement.
Version 3.20.1
2016-Mar-17
* Bugfix the generated NIF code: if the .proto file specifies
package, then any enums must be specified with namespace. Thanks
to vesperusiak for reporting.
Version 3.20.0
2016-Mar-01
* Add an option {erlc_compile_options,Str} (-erlc_compile_options Str)
for inserting a -compile(Str) option into the generated code.
Thanks to Guilherme Andrade.
Version 3.19.0
2016-Feb-04
* Add an option msg_name_to_lower (Cmdline: -msgtolower) for
changing all message name to lower case. Thanks to Roowe.
Version 3.18.10
2015-Nov-27
* Fix bug with extend inside a message body. Thanks to Michael
Ries.
Version 3.18.9
2015-Nov-17
* Support extend inside a message body. Thanks to Michael Ries.
Version 3.18.8
2015-Jun-24
* Fix another decoding/merging bug for maps with the option
maps_unset_optional=omitted, this time for oneof with sub messages
to be merged. This bug, too, was found with the quickcheck and
gpb-eqc.
Version 3.18.7
2015-Jun-17
* Fix typos in comments and texts. Thanks to Giacomo Olgeni for
spotting and fixing many.
Version 3.18.6
2015-Jun-10
* Implement support for maps in NIFs. As part of this, rework the
eunit tests to run the NIFs in a separate erlang vm, for stability.
Version 3.18.5
2015-May-29
* Fix a few decoding/merging bugs for maps with option
maps_unset_optional set to omitted. The bugs were found with the
help of quickcheck and the gpb-eqc.
* The gpb_compile_descr module was forgotten in the gpb.app.src
file, now it is included.
Version 3.18.4
2015-May-09
* Include also the build in the hex.pm package. Thanks to Tilman
Holschuh for finding it out.
Version 3.18.3
2015-May-08
* Include the protoc-erl in the hex.pm package. Thanks to Tilman
Holschuh for finding it out.
Version 3.18.2
2015-May-08
* Bugfix the version tag in the hex.pm package. Thanks to Tilman
Holschuh.
* Bugfix decoding, for fields with optional submessages, for maps,
generated with the option maps_unset_optional set to omitted.
Version 3.18.1
2015-Apr-29
* Bugfix the helper/package-for-hex.pm about the file name change
rebar.config -> rebar.config.script
Version 3.18.0
2015-Apr-29
* Add an option, maps_unset_optional, for omitting optional
values, for maps. With this option, there can now be an enumerator
value that is 'undefined' without any confusion if it is
optional. Thanks to Brett Bethke for prompting this to get
implemented.
* Test the generated code also for maps. This is ifdef-protected,
so it still works with older Erlang versions, but maps are not
tested then, of course. Due to this, the rebar.config has now
turned into rebar.config.script.
* Update the benchmarks to newer software versions and newer
hardware.
Version 3.17.13
2015-Apr-16
* Bugfix verification of strings with the strings_as_binary
(-strbin) option. Thanks to Tilman Holschuh for fixing and to Luis
Rascão for adding a test for it.
Version 3.17.12
2015-Mar-08
* Bugfix exported types for CamelCase message names. Thanks to
Louis-Philippe Gauthier for fixing and to Luis Rascão for adding a
test for it.
Version 3.17.11
2015-Feb-23
* When generating typespecs, generate types for messages, and
export those types. Thanks to Luis Rascão.
Version 3.17.10
2015-Feb-17
* Fix Issues Building on Windows/Cygwin. Thanks to Brett Bethke.
Version 3.17.9
2015-Jan-30
* When generating typespecs, generate types for enums, and export
those types. Thanks to Luis Rascão.
Version 3.17.8
2015-Jan-25
* Add support for the enum "option allow_alias = true;" which
allows more than one enum to have the same numerical value. Gpb
will decode to the first defined enum symbol. Gpb no longer
supports allow_alias = false. This option appeared in Google
Protobuf version 2.5.0. Thanks to bb4242 for reporting.
Version 3.17.7
2015-Jan-07
* Bugfix type specs for strings when using the strings_as_binaries
option. Thanks to Luis Rascão.
Version 3.17.6
2014-Dec-30
* Bugfix NIF linking in eunit tests on Mac. Thanks to Luis
Rascão.
Version 3.17.5
2014-Dec-15
* Bugfix generated NIF code for with the -strbin option: the
utf8_to_uint32 function was unused, as was (mostly) the
utf8_count_codepoints. Thanks to Louis-Philippe Gauthier for
reporting.
Version 3.17.4
2014-Dec-12
* Bugfix generated NIF code for enums defined within
messages. Thanks to Louis-Philippe Gauthier for reporting and
providing an initial solution.
* Bugfix generated NIF code for strings with the -strbin (or
strings_as_binaries) option. Thanks to Louis-Philippe Gauthier for
reporting and providing a solution.
Version 3.17.3
2014-Dec-02
* Bugfix parsing of files that specify a package, and import other
files that also specify a(nother) package. Thanks to Wang Chao for
asking the question prompting me to fix this.
* Add a -pkgs command line option, for use_packages.
Version 3.17.2
2014-Nov-13
* Rework the option parsing. No functional changes.
* in helpers/git-hooks/pre-push, allow push of non-tagged
non-master branches to github.
Version 3.17.1
2014-Oct-29
* Bugfix decoding oneof when for sub messages, in the data-driven
decoder in gpb. When the same oneof sub message appeared twice,
the oneof field was overwritten instead of merged. This did not
affect generated code. It only affected the gpb:decode_msg/3.
Version 3.17.0
2014-Oct-26
* Support oneof fields. It appeared in protobuf 2.6.0, and is
essentially several optional fields sharing the same record
position (memory in the C++ alternative).
* Make the name of the two records for fields and rpcs
configurable. They ought to have been prefixed with gpb_ long ago,
but that was not done. At least now, it is possible to redefine
the record names, in case of clashes.
* Handle services in descriptors.
* Bugfix compilation for descriptors.
* Add an option `warnings_as_errors' along with command line
options -Werror, -Wall, -W1, -W0 and -W, that mimimcs the options
to erlc. This also adds a new return value for failures: error.
Version 3.16.0
2014-Oct-13
* When generating NIF code, also do the encoding in the
NIF. Previously, the encoding was still done using plain Erlang,
only decoding was in the NIF. Now the NIF does both encoding and
decoding.
* Fix potential memory leak when decoding, for odd/unusual error
cases.
Version 3.15.0
2014-Oct-13
* Specify that the NIF should run in a cpu-bound dirty scheduler
when supported. This currently requires Erlang 17.3 built with
--enable-dirty-schedulers. Thanks to Louis-Philippe Gauthier for
asking the question, prompting me get it done.
Version 3.14.0
2014-Oct-01
* In the Makefile, allow ERL and ERLC to be overridden via
environment variables, thanks to Graham Crowe.
* Avoid, and attempt to handle, unicode output in compilation
errors in eunit tests.
Version 3.13.0
2014-Sep-17
* New way to invoke the compiler: bin/protoc-erl. Thanks to Luis
Rascão for the implementation.
Version 3.12.2
2014-Sep-16
* Fix a race condition in the Makefile between all and doc
* Elide falsely failing nif tests with 17 on 32 bits with an
erlang vm compiled with gcc 4.9.0 or newer.
Version 3.12.1
2014-Aug-12
* Update the README, with info on meta data for services. Thanks
to Luis Rascão.
Version 3.12.0
2014-Aug-12
* Add support for retrieving meta data for services. Rename
gpb_compile:msg_defs/2,3 into gpb_compile:proto_defs/2,3, but
retain the old function name and option names for backwards
compatibility. Thanks to Luis Rascão for the implementation.
Version 3.11.0
2014-Jul-20
* Add helpers for packaging to hex.pm. Thanks to Dylan Lukes and
Paul Schoenfelder for prompting this.
* Version numbers revisited, the version on github is now intended
to always be reltools compliant, ie: to always consist of only
integers and dots. Thanks to Volodymyr Kyrychenko
for taking the initiative to this.
Version 3.10
2014-Jun-26
* Bugfix verification of optional sub message fields, thanks to
Klas Johansson.
* Fix compilation warnings with Erlang/OTP 17.0
* Improve/bugfix eunit tests in gpb_codegen_tests and
gpb_compile_tests (compilation warning and nif include path issue,
respectively)
Version 3.9
2014-Feb-04
* Avoid single field map access---ie expressions on the form
X#{key}---since neither the maps pre-release, nor the rc1 of R17
supports it. Use matching to access such fields instead. This
applies to records as well as maps. Performance is unaltered.
Version 3.8
2014-Feb-01
* Bugfix generated code when there are no messages defined.
Thanks to Graham Crowe for reporting.
* Add possibility to suffix message/record and names and module
names.
Version 3.7.1
2013-Dec-14
* Bugfix a race condition in the Makefile. Thanks to Graham Crowe
for fruitful discussions.
* Rework the workaround for the bug in the syntax_tools in R16B03,
so that the code that uses the parse transform need not change.
Handle the odd case entirely in the parse transform.
Version 3.7
2013-Dec-13
* Add a (GNU) Makefile, for projects that prefer to build this
way. Thanks to Graham Crowe for suggestions and ideas.
* Rework/fix the substitution in gpb_version.hrl.
* Add support for Erlang/OTP R16B03, by working around a
bug in syntax_tools (reversion of local implicit funs).
* Change the months in this file, from numeric to 3-letters, to
avoid ambiguities with different ways of writing dates in various
parts of the world.
Version 3.6
2013-Nov-13
* Add nif support for the strings_as_binaries (-strbin) option,
thanks to Louis-Philippe Gauthier for reporting this.
* Add an is_binary guard to the top-level generated decode_msg/2
function. Thanks to Klas Johansson for suggesting this.
Version 3.5
2013-Oct-27
* Licence change: from LGPL 2 to LGPL 2.1
Version 3.4
2013-Oct-27
* Licence modification/clarification: clarify that the licence (in
the file COPYING.LIB) does not cover code generated with gpb.
Version 3.3
2013-Oct-27
* Fix several errors in the gpb.app.src so that it works with
Elixir and Relex, thanks to Paulo Almeida.
* When decoding, reject messages with invalid varints.
Invalid varints are encoded with too many bits. Previously,
decoding a varint with very many bits (ie: with very many leading
bytes > 128) would cause the Erlang VM to construct a very large
number when decoding the varint. This would cause the Erlang VM to
use excessive cpu resources and could eventually cause the Erlang
VM to run out of memory. Now parsing fails immediately reading too
many varint bits.
* Fix a bug when generating code for maps.
* Teach the benchmarks to do maps, and also improve
various other benchmark related things.
Version 3.2
2013-Sep-16
* Add preliminary support for maps, for generating code that
encodes from and decodes to maps, as well as merges and verifies
maps. The maps support is experimental.
* Bugfix verification of integers: the wrong error reason could be
generated for integers out of range.
* Bugfix various dialyzer issues.
Version 3.1
2013-Sep-05
* Bugfix compilation of several files (only the first file
was actually compiled, even if several files were specified)
* Add possibility to generate and encode a descriptor, which is a
self-describing byte-blob according to descriptor.proto.
* Add possibility to make the generated code compile-time
independent of gpb by generating the introspection information to
proplists instead of to #field{} records. The latter required
including gpb.hrl at compile time. (There's no run-time dependency)
* Add possibility to prefix message/record and names and module
names to avoid name collisions.
* Add -type to the command line options, thanks to Louis-Philippe
Gauthier. Previously it existed only as an Erlang API option.
Version 3.0
2013-Aug-24
* Improve decoding performance by roughly 8--19%
* Completely rewrite the code generator. Use a parse-transform
instead of formatting and assembling strings.
* Minor improvement in the generated code for version_as_list.
Version 2.3
2013-Aug-18
* Fix Rebar compile on non-GNU systems, such as Mac OS X, thanks
to Everton Ribeiro.
* Bugfix (mostly) rare compilation breakage: depending on the
date/time of generation, a new-line was inserted, causing a
compilation error.
* Ignore non-version-like tags
Version 2.2
2013-Jul-13
* Wrap generated skip-functions with quotes. Thanks to jesse-ad.
* Experimental support for calling protoc code via a NIF
* Empty lists are now default values for repeated fields. Thanks
to Martin Donath.
* New option, use_packages for prepending the package name found
in the proto file, to the message names. Thanks to Martin Donath.
* New option: strings_as_binaries (-strbin), for returning strings
as binaries. Thanks to Lars Thorsen for suggesting this option.
* New option: {o_erl,Dir} (-o-erl Dir), {o_hrl,Dir} (-o-hrl Dir)
and {o_nif_cc,Dir} (-o-nif-cc Dir) to specify destination
directory by file type. Thanks to Patrik Sandahl for suggesting
those options.
* New option: include_as_lib (-il) to include gpb.hrl as a
library. This makes it easier to integrate with rebar. Thanks to
Martin Donath.
* Generate introspection functions for enum conversions:
M:enum_symbol_by_value/2, M:enum_value_by_symbol/2,
M:enum_symbol_by_value_<Enum>/1, M:enum_value_by_symbol_<Enum>/1;
thanks to Patrik Sandahl for suggesting those functions.
* Bugfix name resolution. Thanks to Heiner Bunjes for reporting
the bug. This prompted a major rewrite of the name resolution code
that was originally a quick patch-work, and not in very good shape.
* Handle C-style comments. Thanks to Patrik Sandahl for reporting
this bug.
* Add a section to the README.md showing rebar integration, thanks
to Bin Wang for asking the question that prompted me to write it
up.
* Bugfix command line option parsing using the -extra alternative.
* Benchmark code improvements.
* Build: version number: defined format and enforced/verified
consistency between gpb_version.hrl and src/gpb.app.src: using the
git tag as the source of information.
Version 2.1
2011-Oct-31 Tomas Abrahamsson <tomas.abrahamsson@gmail.com>
* Package names are dotted rather than with underscores
* New generated introspection function: M:get_package_name/0.
Version 2.0
2011-Jul-10 Tomas Abrahamsson <tab@lysator.liu.se>
* First public version