-
Notifications
You must be signed in to change notification settings - Fork 153
/
ChangeLog
1657 lines (1245 loc) · 58.8 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-*- coding: utf-8; indent-tabs-mode: nil -*-
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