-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[new release] ocaml-protoc (4 packages) (3.0.0) #24863
Conversation
This is going to require a lot of new upper bounds on other packages ( |
9715af9
to
70bda27
Compare
CHANGES: Major version that breaks code for every user. Sorry! ### Breaking - Generated code now always fits into 2 files: code for `foo.proto` is produced in `foo.ml` and `foo.mli`. This follows a fairly large internal refactor that enables a plugin architecture internally (which facilitated codegen for services). All encoder/decoder functions also have a new name now, so that they don't collide inside the same file. - CLI flags now use `--this-style` rather than `-this-style` - Bump minimal OCaml version to 4.08 ### Performance - encode probotufs backward, which means we can write directly into a single buffer (which is not possible in a forward mode because sub-messages require an unknown amount of prefix space to write their size as a varint) - add C stubs for pbrt - use Bytes functions to read/write fixed size integers - inlining annotations - more benchmarks, helping optimization overall - reduce allocations drastically, by having the generated code create fewer closures ### Services - add `pbrt_services` runtime library - generate code for `service` statements. This is a big feature for users who want to implement RPC systems using protobuf. The generated code is agnostic to whatever RPC implementation will use it, it only packs together RPC method names and path with the relevant encoders/decoders. Services require both JSON and binary encoders/decoders to be present. ### JSON - migrate `pbrt_yojson` into the main ocaml-protoc repo - JSON runtime support for empty messages - Add support for bytes in JSON encoding - Add support for encoding and decoding maps in JSON ### Other features and fixes - add `--make` flag to generate `make` functions that take fewer optional arguments. This helps preventing the user from forgetting important arguments when they're encoding to protobuf. Arguments actually marked as `optional` in the .proto file are still optional. - Support maps/lists in options - add Pbrt.Decoder.of_substring - Allow options to be named like `(validate.rules).message.required` - support code generation for empty messages - Empty proto file is a valid proto as well ### Testing - expect-style tests for parser - Tests for option parsing - Test demonstrating parse error printing
70bda27
to
9c18c1a
Compare
maybe this will do it: c-cube#1 |
Ah, this looks a lot better! |
Is there a way to mark this as incompatible with 32 bit archs? |
you probably also need a lower bound for |
Co-authored-by: Haochen M. Kotoi-Xie <hx@kxc.inc>
I don't know what the kinetic client is, truthfully. Could it instead be a dependency on a recent dune? |
Related: ocaml/opam#4633 |
Ah, I see now that it's just a revdep of your packages. Since it's not directly related to this PR, I don't think you need to bother about it. I can update them later. Once the CI for the other packages comes green, I think this PR is good to be merged. |
Now the only relevant failure is with ppc64. You are free to investigate or simply mark it as unavailable on ppc
|
Co-authored-by: Haochen M. Kotoi-Xie <hx@kxc.inc>
Seems like all remaining failures are unrelated! |
Thanks! |
Thank you! |
Pure OCaml compiler for .proto files
CHANGES:
Major version that breaks code for every user. Sorry!
Breaking
for
foo.proto
is produced infoo.ml
andfoo.mli
.This follows a fairly large internal refactor that enables
a plugin architecture internally (which facilitated codegen for
services).
All encoder/decoder functions also have a new name now,
so that they don't collide inside the same file.
--this-style
rather than-this-style
Performance
into a single buffer (which is not possible in a forward mode
because sub-messages require an unknown amount of prefix space
to write their size as a varint)
create fewer closures
Services
pbrt_services
runtime libraryservice
statements. This is a big featurefor users who want to implement RPC systems using protobuf.
The generated code is agnostic to whatever RPC implementation
will use it, it only packs together RPC method names and path
with the relevant encoders/decoders. Services require
both JSON and binary encoders/decoders to be present.
JSON
pbrt_yojson
into the main ocaml-protoc repoOther features and fixes
--make
flag to generatemake
functions that take feweroptional arguments. This helps preventing the user from
forgetting important arguments when they're encoding to protobuf.
Arguments actually marked as
optional
in the .proto fileare still optional.
(validate.rules).message.required
Testing