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 5, 2024
1 parent e4d7617 commit dcb1104
Show file tree
Hide file tree
Showing 13 changed files with 1,622 additions and 2 deletions.
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
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
82 changes: 80 additions & 2 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
24 changes: 24 additions & 0 deletions bazel/thirdparty/libprotobuf-mutator.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See google/libprotobuf-mutator#91

cc_library(
name = "libprotobuf_mutator",
srcs = glob(
[
"src/*.cc",
"src/*.h",
"port/protobuf.h",
],
exclude = [
"**/*_test.cc",
"src/mutator.h",
],
),
hdrs = [
"src/mutator.h",
],
testonly = 1,
include_prefix = "protobuf_mutator",
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = ["@protobuf"],
)
20 changes: 20 additions & 0 deletions src/v/serde/protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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/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 dcb1104

Please sign in to comment.