Skip to content

Commit

Permalink
Merge pull request #21381 from dotnwat/bazel
Browse files Browse the repository at this point in the history
bazel: add build for various v::utils libraries
  • Loading branch information
dotnwat authored Jul 14, 2024
2 parents 5dceaef + b4aa62b commit fd5f4ca
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 44 deletions.
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ git_override(
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
archive_override(
module_name = "rules_boost",
integrity = "sha256-PcGxb6Ffi1CajH1PIqlAJ6mgqQ5/XW3NNL7TLZvlSBs=",
strip_prefix = "rules_boost-64bf4814222a6782fd0e7536532a257d7fdc9d80",
urls = "https://github.com/nelhage/rules_boost/archive/64bf4814222a6782fd0e7536532a257d7fdc9d80.tar.gz",
integrity = "sha256-Sk6Rjh7r4pUyRYQ4QO2qhgZYvdkWbyrLJTCl9oY6Z7I=",
strip_prefix = "rules_boost-21cd44506bd15e06db89aa2866b9be90002d8eec",
urls = "https://github.com/nelhage/rules_boost/archive/21cd44506bd15e06db89aa2866b9be90002d8eec.tar.gz",
)

non_module_boost_repositories = use_extension("@com_github_nelhage_rules_boost//:boost/repositories.bzl", "non_module_dependencies")
Expand Down
25 changes: 11 additions & 14 deletions MODULE.bazel.lock

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

84 changes: 60 additions & 24 deletions src/v/utils/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
load("//bazel:build.bzl", "redpanda_cc_library")

package(default_visibility = ["//visibility:public"])

redpanda_cc_library(
name = "auto_fmt",
hdrs = [
"auto_fmt.h",
],
include_prefix = "utils",
deps = [
"//src/v/reflection:to_tuple",
"@fmt",
],
)

redpanda_cc_library(
name = "moving_average",
hdrs = [
"moving_average.h",
],
include_prefix = "utils",
deps = [
":named_type",
"//src/v/base",
],
)

redpanda_cc_library(
name = "vint",
srcs = [
Expand All @@ -10,7 +36,6 @@ redpanda_cc_library(
"vint_iostream.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/bytes",
"//src/v/bytes:iostream",
Expand All @@ -24,7 +49,6 @@ redpanda_cc_library(
"functional.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
)

redpanda_cc_library(
Expand All @@ -33,7 +57,6 @@ redpanda_cc_library(
"inet_address_wrapper.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
)

redpanda_cc_library(
Expand All @@ -42,7 +65,6 @@ redpanda_cc_library(
"tristate.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
],
Expand All @@ -54,7 +76,6 @@ redpanda_cc_library(
"memory_data_source.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"@seastar",
Expand All @@ -67,7 +88,6 @@ redpanda_cc_library(
"mutex.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"//src/v/ssx:semaphore",
Expand All @@ -80,7 +100,6 @@ redpanda_cc_library(
"static_deleter_fn.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
)

redpanda_cc_library(
Expand All @@ -89,7 +108,6 @@ redpanda_cc_library(
"named_type.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"@fmt",
],
Expand All @@ -101,7 +119,6 @@ redpanda_cc_library(
"to_string.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"@fmt",
Expand All @@ -115,7 +132,6 @@ redpanda_cc_library(
"object_pool.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
],
Expand All @@ -130,20 +146,52 @@ redpanda_cc_library(
"human.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"@seastar",
],
)

redpanda_cc_library(
name = "file_io",
srcs = [
"file_io.cc",
],
hdrs = [
"file_io.h",
],
include_prefix = "utils",
deps = [
"//src/v/base",
"//src/v/bytes:iobuf",
"//src/v/bytes:iostream",
"@seastar",
],
)

redpanda_cc_library(
name = "tracking_allocator",
srcs = [
"tracking_allocator.cc",
],
hdrs = [
"tracking_allocator.h",
],
include_prefix = "utils",
deps = [
":human",
"//src/v/container:intrusive",
"//src/v/json",
"@seastar",
],
)

redpanda_cc_library(
name = "unresolved_address",
hdrs = [
"unresolved_address.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/serde",
],
Expand All @@ -159,7 +207,6 @@ redpanda_cc_library(
],
exclude_layering_check = True,
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
":human",
":static_deleter_fn",
Expand All @@ -181,7 +228,6 @@ redpanda_cc_library(
],
exclude_layering_check = True,
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/container:fragmented_vector",
"//src/v/reflection:adl",
Expand All @@ -197,7 +243,6 @@ redpanda_cc_library(
"uuid.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"//src/v/bytes",
Expand All @@ -218,7 +263,6 @@ redpanda_cc_library(
"xid.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"//src/v/bytes:iobuf_parser",
Expand All @@ -240,7 +284,6 @@ redpanda_cc_library(
],
exclude_layering_check = True,
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"//src/v/bytes",
Expand All @@ -259,7 +302,6 @@ redpanda_cc_library(
"directory_walker.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"@seastar",
Expand All @@ -272,7 +314,6 @@ redpanda_cc_library(
"expiring_promise.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"@seastar",
Expand All @@ -288,7 +329,6 @@ redpanda_cc_library(
"retry_chain_node.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"//src/v/random:fast_prng",
Expand All @@ -307,7 +347,6 @@ redpanda_cc_library(
"bottomless_token_bucket.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"@fmt",
Expand All @@ -321,7 +360,6 @@ redpanda_cc_library(
"move_canary.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
)

redpanda_cc_library(
Expand All @@ -330,7 +368,6 @@ redpanda_cc_library(
"exceptions.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"@seastar",
Expand All @@ -343,7 +380,6 @@ redpanda_cc_library(
"stable_iterator_adaptor.h",
],
include_prefix = "utils",
visibility = ["//visibility:public"],
deps = [
":exceptions",
"//src/v/base",
Expand Down
2 changes: 1 addition & 1 deletion src/v/utils/moving_average.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#pragma once
#include "base/likely.h"
#include "base/vassert.h"
#include "named_type.h"
#include "utils/named_type.h"

#include <array>
#include <chrono>
Expand Down
Loading

0 comments on commit fd5f4ca

Please sign in to comment.