Skip to content

Commit e5fd09c

Browse files
committed
[new release] ocaml-protoc (4 packages) (4.0)
CHANGES: - better parsing of protobuf options - generation of validation code with `--pp_options` - feat: add `--encode-only` and `--decode-only` features - take presence semantics in account, to be closer to compliance with the official protobuf docs and implementation * use a bitfield to track presence for scalar fields * use options in more places * do not serialize non-present fields, to save space * always generate `make` builders, setters, presence checks - merge mutable and immutable types, only generate a single record per message type - feat codegen: use polyvariants for very large sum types - fix parser: handle `reserved` in enums - improved tests
1 parent 87196fa commit e5fd09c

File tree

4 files changed

+162
-0
lines changed
  • packages
    • ocaml-protoc/ocaml-protoc.4.0
    • pbrt_services/pbrt_services.4.0
    • pbrt_yojson/pbrt_yojson.4.0
    • pbrt/pbrt.4.0

4 files changed

+162
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
opam-version: "2.0"
2+
synopsis: "Pure OCaml compiler for .proto files"
3+
maintainer: ["Maxime Ransan <[email protected]>" "Simon Cruanes"]
4+
authors: ["Maxime Ransan <[email protected]>" "Simon Cruanes"]
5+
license: "MIT"
6+
tags: ["protoc" "protobuf" "codegen"]
7+
homepage: "https://github.com/mransan/ocaml-protoc"
8+
bug-reports: "https://github.com/mransan/ocaml-protoc/issues"
9+
depends: [
10+
"dune" {>= "2.0"}
11+
"odoc" {with-doc}
12+
"pbrt" {= version}
13+
"pbrt_yojson" {= version & with-test}
14+
"pbrt_services" {= version & with-test}
15+
"ppx_deriving" {with-test}
16+
"ocaml" {>= "4.08"}
17+
]
18+
dev-repo: "git+https://github.com/mransan/ocaml-protoc.git"
19+
build: [
20+
["dune" "subst"] {dev}
21+
[
22+
"dune"
23+
"build"
24+
"-p"
25+
name
26+
"-j"
27+
jobs
28+
"@install"
29+
"@src/examples/runtest" {with-test}
30+
"@src/tests/expectation/runtest" {with-test}
31+
"@doc" {with-doc}
32+
]
33+
]
34+
x-maintenance-intent: ["(latest)"]
35+
url {
36+
src:
37+
"https://github.com/mransan/ocaml-protoc/releases/download/v4.0/ocaml-protoc-4.0.tbz"
38+
checksum: [
39+
"sha256=88533848ee8ad662bfb063f34932286405977fa3810515b997119b06f05105e4"
40+
"sha512=df12c71f7181eafc94cd0fc400edf7f258cdd3740a5badafce097f771b7828fed9a9a9c0a457e7e118848a8b1ddd87fe3134a5bdf88d4adcb0d0e04ba6808c5f"
41+
]
42+
}
43+
x-commit-hash: "258b49144dbf3d17adefa7c051616468d03d0ee6"

packages/pbrt/pbrt.4.0/opam

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
opam-version: "2.0"
2+
synopsis: "Runtime library for Protobuf tooling"
3+
maintainer: ["Maxime Ransan <[email protected]>" "Simon Cruanes"]
4+
authors: ["Maxime Ransan <[email protected]>" "Simon Cruanes"]
5+
license: "MIT"
6+
tags: ["protobuf" "encode" "decode"]
7+
homepage: "https://github.com/mransan/ocaml-protoc"
8+
bug-reports: "https://github.com/mransan/ocaml-protoc/issues"
9+
depends: [
10+
"dune" {>= "2.0"}
11+
"stdlib-shims"
12+
"odoc" {with-doc}
13+
"ocaml" {>= "4.08"}
14+
]
15+
dev-repo: "git+https://github.com/mransan/ocaml-protoc.git"
16+
available: arch != "arm32" & arch != "x86_32" & arch != "ppc32" & arch != "ppc64"
17+
build: [
18+
["dune" "subst"] {dev}
19+
[
20+
"dune"
21+
"build"
22+
"-p"
23+
name
24+
"-j"
25+
jobs
26+
"@install"
27+
"@src/tests/unit-tests/pbrt/runtest" {with-test} # custom path
28+
"@doc" {with-doc}
29+
]
30+
]
31+
x-maintenance-intent: ["(latest)"]
32+
url {
33+
src:
34+
"https://github.com/mransan/ocaml-protoc/releases/download/v4.0/ocaml-protoc-4.0.tbz"
35+
checksum: [
36+
"sha256=88533848ee8ad662bfb063f34932286405977fa3810515b997119b06f05105e4"
37+
"sha512=df12c71f7181eafc94cd0fc400edf7f258cdd3740a5badafce097f771b7828fed9a9a9c0a457e7e118848a8b1ddd87fe3134a5bdf88d4adcb0d0e04ba6808c5f"
38+
]
39+
}
40+
x-commit-hash: "258b49144dbf3d17adefa7c051616468d03d0ee6"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
opam-version: "2.0"
2+
synopsis: "Runtime library for ocaml-protoc to support RPC services"
3+
maintainer: ["Maxime Ransan <[email protected]>" "Simon Cruanes"]
4+
authors: ["Maxime Ransan <[email protected]>" "Simon Cruanes"]
5+
license: "MIT"
6+
tags: ["protobuf" "encode" "decode" "services" "rpc"]
7+
homepage: "https://github.com/mransan/ocaml-protoc"
8+
bug-reports: "https://github.com/mransan/ocaml-protoc/issues"
9+
depends: [
10+
"dune" {>= "2.0"}
11+
"ocaml" {>= "4.08"}
12+
"pbrt" {= version}
13+
"pbrt_yojson" {= version}
14+
]
15+
dev-repo: "git+https://github.com/mransan/ocaml-protoc.git"
16+
build: [
17+
["dune" "subst"] {dev}
18+
[
19+
"dune"
20+
"build"
21+
"-p"
22+
name
23+
"-j"
24+
jobs
25+
"@install"
26+
# "@runtest" {with-test} # no tests
27+
"@doc" {with-doc}
28+
]
29+
]x-maintenance-intent: ["(latest)"]
30+
url {
31+
src:
32+
"https://github.com/mransan/ocaml-protoc/releases/download/v4.0/ocaml-protoc-4.0.tbz"
33+
checksum: [
34+
"sha256=88533848ee8ad662bfb063f34932286405977fa3810515b997119b06f05105e4"
35+
"sha512=df12c71f7181eafc94cd0fc400edf7f258cdd3740a5badafce097f771b7828fed9a9a9c0a457e7e118848a8b1ddd87fe3134a5bdf88d4adcb0d0e04ba6808c5f"
36+
]
37+
}
38+
x-commit-hash: "258b49144dbf3d17adefa7c051616468d03d0ee6"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
opam-version: "2.0"
2+
synopsis:
3+
"Runtime library for ocaml-protoc to support JSON encoding/decoding"
4+
maintainer: ["Maxime Ransan <[email protected]>" "Simon Cruanes"]
5+
authors: ["Maxime Ransan <[email protected]>" "Simon Cruanes"]
6+
license: "MIT"
7+
tags: ["protobuf" "encode" "decode"]
8+
homepage: "https://github.com/mransan/ocaml-protoc"
9+
bug-reports: "https://github.com/mransan/ocaml-protoc/issues"
10+
depends: [
11+
"dune" {>= "2.0"}
12+
"ocaml" {>= "4.08"}
13+
"odoc" {with-doc}
14+
"yojson" {>= "1.6"}
15+
"base64" {>= "3.0"}
16+
]
17+
dev-repo: "git+https://github.com/mransan/ocaml-protoc.git"
18+
build: [
19+
["dune" "subst"] {dev}
20+
[
21+
"dune"
22+
"build"
23+
"-p"
24+
name
25+
"-j"
26+
jobs
27+
"@install"
28+
"@src/tests/yojson/runtest" {with-test}
29+
"@doc" {with-doc}
30+
]
31+
]
32+
x-maintenance-intent: ["(latest)"]
33+
url {
34+
src:
35+
"https://github.com/mransan/ocaml-protoc/releases/download/v4.0/ocaml-protoc-4.0.tbz"
36+
checksum: [
37+
"sha256=88533848ee8ad662bfb063f34932286405977fa3810515b997119b06f05105e4"
38+
"sha512=df12c71f7181eafc94cd0fc400edf7f258cdd3740a5badafce097f771b7828fed9a9a9c0a457e7e118848a8b1ddd87fe3134a5bdf88d4adcb0d0e04ba6808c5f"
39+
]
40+
}
41+
x-commit-hash: "258b49144dbf3d17adefa7c051616468d03d0ee6"

0 commit comments

Comments
 (0)