Skip to content

Commit

Permalink
serde/proto: seastar friendly protobuf parser
Browse files Browse the repository at this point in the history
TODO explain yourself
  • Loading branch information
rockwotj committed Aug 6, 2024
1 parent e4d7617 commit 7780c8e
Show file tree
Hide file tree
Showing 13 changed files with 1,617 additions and 38 deletions.
3 changes: 2 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
bazel_dep(name = "liburing", version = "2.5")
bazel_dep(name = "lz4", version = "1.9.4")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "protobuf", version = "24.4")
bazel_dep(name = "protobuf", version = "27.3")
bazel_dep(name = "re2", version = "2023-09-01")
bazel_dep(name = "rules_foreign_cc", version = "0.10.1")
bazel_dep(name = "rules_go", version = "0.49.0")
Expand Down Expand Up @@ -71,6 +71,7 @@ use_repo(non_module_dependencies, "hwloc")
use_repo(non_module_dependencies, "jsoncons")
use_repo(non_module_dependencies, "krb5")
use_repo(non_module_dependencies, "libpciaccess")
use_repo(non_module_dependencies, "libprotobuf_mutator")
use_repo(non_module_dependencies, "libxml2")
use_repo(non_module_dependencies, "lksctp")
use_repo(non_module_dependencies, "numactl")
Expand Down
93 changes: 56 additions & 37 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ def data_dependency():
url = "https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/archive/2ec2576cabefef1eaa5dd9307c97de2e887fc347/libpciaccess-2ec2576cabefef1eaa5dd9307c97de2e887fc347.tar.gz",
)

http_archive(
name = "libprotobuf_mutator",
build_file = "//bazel/thirdparty:libprotobuf-mutator.BUILD",
integrity = "sha256-KWUbFgNpDJtAO6Kr0eTo1v6iczEOta72jSle9oivFhg=",
strip_prefix = "libprotobuf-mutator-b922c8ab9004ef9944982e4f165e2747b13223fa",
url = "/~https://github.com/google/libprotobuf-mutator/archive/b922c8ab9004ef9944982e4f165e2747b13223fa.zip",
)

http_archive(
name = "libxml2",
build_file = "//bazel/thirdparty:libxml2.BUILD",
Expand Down
25 changes: 25 additions & 0 deletions bazel/thirdparty/libprotobuf-mutator.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See google/libprotobuf-mutator#91

cc_library(
name = "libprotobuf_mutator",
testonly = 1,
srcs = glob(
[
"src/*.cc",
"src/*.h",
],
exclude = [
"**/*_test.cc",
"src/mutator.h",
],
) + [
"port/protobuf.h",
],
hdrs = [
"src/mutator.h",
],
include_prefix = "protobuf_mutator",
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = ["@protobuf"],
)
21 changes: 21 additions & 0 deletions src/v/serde/protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
load("//bazel:build.bzl", "redpanda_cc_library")

redpanda_cc_library(
name = "protobuf",
srcs = [
"parser.cc",
],
hdrs = [
"parser.h",
],
include_prefix = "serde/protobuf",
visibility = ["//visibility:public"],
deps = [
"//src/v/bytes:iobuf",
"//src/v/bytes:iobuf_parser",
"//src/v/utils:vint",
"//src/v/container:chunked_hash_map",
"//src/v/container:fragmented_vector",
"@protobuf",
],
)
Empty file added src/v/serde/protobuf/README.md
Empty file.
Loading

0 comments on commit 7780c8e

Please sign in to comment.