Skip to content

Commit 5f4d12f

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 1c92c86 commit 5f4d12f

File tree

4 files changed

+158
-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

+158
-0
lines changed
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: "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+
build: [
19+
["dune" "subst"] {pinned}
20+
[
21+
"dune"
22+
"build"
23+
"-p"
24+
name
25+
"-j"
26+
jobs
27+
"@install"
28+
"@runtest" {with-test}
29+
"@doc" {with-doc}
30+
]
31+
]
32+
dev-repo: "git+https://github.com/mransan/ocaml-protoc.git"
33+
url {
34+
src:
35+
"https://github.com/mransan/ocaml-protoc/releases/download/v4.0/ocaml-protoc-4.0.tbz"
36+
checksum: [
37+
"sha256=c387d2a7ff2e9c5ba94855ec8e13caa7c5bc70a0c544c0ae82672a2c4f9a8f76"
38+
"sha512=b3e1b2f48ed9ff0c37fd33843b2db6894dca45a27222808782c4a06156420f51fd652c0f300765d4be38ef284343cb1806f95373daad590ba85f9e0b20231c27"
39+
]
40+
}
41+
x-commit-hash: "0ad7e970bf73da1eb439d8677004f2042fb0499e"

packages/pbrt/pbrt.4.0/opam

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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"] {pinned}
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+
url {
32+
src:
33+
"https://github.com/mransan/ocaml-protoc/releases/download/v4.0/ocaml-protoc-4.0.tbz"
34+
checksum: [
35+
"sha256=c387d2a7ff2e9c5ba94855ec8e13caa7c5bc70a0c544c0ae82672a2c4f9a8f76"
36+
"sha512=b3e1b2f48ed9ff0c37fd33843b2db6894dca45a27222808782c4a06156420f51fd652c0f300765d4be38ef284343cb1806f95373daad590ba85f9e0b20231c27"
37+
]
38+
}
39+
x-commit-hash: "0ad7e970bf73da1eb439d8677004f2042fb0499e"
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"] {pinned}
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+
]
30+
url {
31+
src:
32+
"https://github.com/mransan/ocaml-protoc/releases/download/v4.0/ocaml-protoc-4.0.tbz"
33+
checksum: [
34+
"sha256=c387d2a7ff2e9c5ba94855ec8e13caa7c5bc70a0c544c0ae82672a2c4f9a8f76"
35+
"sha512=b3e1b2f48ed9ff0c37fd33843b2db6894dca45a27222808782c4a06156420f51fd652c0f300765d4be38ef284343cb1806f95373daad590ba85f9e0b20231c27"
36+
]
37+
}
38+
x-commit-hash: "0ad7e970bf73da1eb439d8677004f2042fb0499e"
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:
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"] {pinned}
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+
url {
33+
src:
34+
"https://github.com/mransan/ocaml-protoc/releases/download/v4.0/ocaml-protoc-4.0.tbz"
35+
checksum: [
36+
"sha256=c387d2a7ff2e9c5ba94855ec8e13caa7c5bc70a0c544c0ae82672a2c4f9a8f76"
37+
"sha512=b3e1b2f48ed9ff0c37fd33843b2db6894dca45a27222808782c4a06156420f51fd652c0f300765d4be38ef284343cb1806f95373daad590ba85f9e0b20231c27"
38+
]
39+
}
40+
x-commit-hash: "0ad7e970bf73da1eb439d8677004f2042fb0499e"

0 commit comments

Comments
 (0)