Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove various build dependencies #18660

Merged
merged 18 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

#pragma once

#include <optional>
#include <type_traits>

namespace utils {
namespace base {

/**
* A utility for statically asserting false.
Expand All @@ -26,7 +27,7 @@ namespace utils {
* if constexpr (...) {
* // ...
* } else {
* static_assert(utils::unsupported_type<T>::value, "unsupported type");
* static_assert(base::unsupported_type<T>::value, "unsupported type");
* }
* }
*
Expand All @@ -50,11 +51,30 @@ struct unsupported_type : std::false_type {};
* } else if constexpr (value == foo::baz) {
* // ...
* } else {
* static_assert(utils::unsupported_value<value>::value, "supported foo");
* static_assert(base::unsupported_value<value>::value, "supported foo");
* }
* }
*/
template<auto V>
struct unsupported_value : std::false_type {};

} // namespace utils
} // namespace base

namespace detail {

template<typename T, template<typename...> class C>
struct is_specialization_of : std::false_type {};
template<template<typename...> class C, typename... Args>
struct is_specialization_of<C<Args...>, C> : std::true_type {};
template<typename T, template<typename...> class C>
inline constexpr bool is_specialization_of_v
= is_specialization_of<T, C>::value;

} // namespace detail

namespace reflection {

template<typename T>
concept is_std_optional = ::detail::is_specialization_of_v<T, std::optional>;

}
1 change: 1 addition & 0 deletions src/v/cloud_storage/partition_manifest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "model/fundamental.h"
#include "model/timestamp.h"
#include "reflection/to_tuple.h"
#include "reflection/type_traits.h"
#include "serde/envelope.h"
#include "serde/envelope_for_each_field.h"
#include "serde/serde.h"
Expand Down
1 change: 1 addition & 0 deletions src/v/cloud_storage_clients/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "cloud_storage_clients/client_probe.h"
#include "cloud_storage_clients/types.h"
#include "model/metadata.h"
#include "net/transport.h"
#include "net/types.h"

Expand Down
2 changes: 1 addition & 1 deletion src/v/cluster/tests/serialization_rt_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "storage/types.h"
#include "test_utils/randoms.h"
#include "test_utils/rpc.h"
#include "tristate.h"
#include "utils/tristate.h"
#include "v8_engine/data_policy.h"

#include <seastar/core/chunked_fifo.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/v/cluster/tx_topic_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "features/feature_table.h"
#include "model/namespace.h"
#include "ssx/future-util.h"
#include "tristate.h"
#include "utils/tristate.h"

#include <seastar/core/gate.hh>
#include <seastar/core/sleep.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/v/cluster/types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include "model/timestamp.h"
#include "reflection/adl.h"
#include "security/acl.h"
#include "tristate.h"
#include "utils/to_string.h"
#include "utils/tristate.h"

#include <seastar/core/chunked_fifo.hh>
#include <seastar/core/sstring.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/v/cluster/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "security/types.h"
#include "serde/envelope.h"
#include "storage/ntp_config.h"
#include "tristate.h"
#include "utils/tristate.h"
#include "v8_engine/data_policy.h"

#include <seastar/core/chunked_fifo.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/v/compression/include/compression/stream_zstd.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#pragma once
#include "bytes/iobuf.h"
#include "static_deleter_fn.h"
#include "utils/static_deleter_fn.h"

#include <memory>
#include <zstd.h>
Expand Down
2 changes: 1 addition & 1 deletion src/v/compression/internal/lz4_frame_compressor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "base/vassert.h"
#include "compression/lz4_decompression_buffers.h"
#include "static_deleter_fn.h"
#include "utils/static_deleter_fn.h"

#include <seastar/core/temporary_buffer.hh>

Expand Down
1 change: 0 additions & 1 deletion src/v/config/broker_authn_endpoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "config/broker_authn_endpoint.h"

#include "kafka/client/exceptions.h"
#include "model/metadata.h"
#include "strings/string_switch.h"

Expand Down
14 changes: 6 additions & 8 deletions src/v/config/configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@
#include "config/validators.h"
#include "model/metadata.h"
#include "model/namespace.h"
#include "pandaproxy/schema_registry/schema_id_validation.h"
#include "security/config.h"
#include "security/gssapi_principal_mapper.h"
#include "security/mtls.h"
#include "security/oidc_principal_mapping.h"
#include "security/oidc_url_parser.h"
#include "ssx/sformat.h"
#include "storage/chunk_cache.h"
#include "storage/segment_appender.h"
#include "utils/bottomless_token_bucket.h"
#include "storage/config.h"

#include <chrono>
#include <cstdint>
#include <optional>

Expand Down Expand Up @@ -1171,7 +1168,7 @@ configuration::configuration()
.example = "32768",
.visibility = visibility::tunable},
32_MiB,
storage::segment_appender::validate_fallocation_step)
storage::validate_fallocation_step)
, storage_target_replay_bytes(
*this,
"storage_target_replay_bytes",
Expand Down Expand Up @@ -2979,7 +2976,8 @@ configuration::configuration()
"balancer, in milliseconds",
{.needs_restart = needs_restart::no, .visibility = visibility::user},
5000ms,
{.min = 1ms, .max = bottomless_token_bucket::max_width})
{.min = 1ms,
.max = std::chrono::milliseconds(std::numeric_limits<int32_t>::max())})
, kafka_quota_balancer_node_period(
*this,
"kafka_quota_balancer_node_period_ms",
Expand Down
4 changes: 2 additions & 2 deletions src/v/config/property.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

#pragma once
#include "base/oncore.h"
#include "base/type_traits.h"
#include "config/base_property.h"
#include "config/rjson_serialization.h"
#include "container/intrusive_list_helpers.h"
#include "json/stringbuffer.h"
#include "json/writer.h"
#include "pandaproxy/schema_registry/schema_id_validation.h"
#include "reflection/type_traits.h"
#include "utils/to_string.h"

#include <seastar/util/noncopyable_function.hh>
Expand Down Expand Up @@ -653,7 +653,7 @@ consteval std::string_view property_type_name() {
return "recovery_validation_mode";
} else {
static_assert(
utils::unsupported_type<T>::value, "Type name not defined");
base::unsupported_type<T>::value, "Type name not defined");
}
}

Expand Down
1 change: 0 additions & 1 deletion src/v/config/rest_authn_endpoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "config/rest_authn_endpoint.h"

#include "kafka/client/exceptions.h"
#include "model/metadata.h"
#include "strings/string_switch.h"

Expand Down
2 changes: 1 addition & 1 deletion src/v/config/throughput_control_group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* by the Apache License, Version 2.0
*/

#include "throughput_control_group.h"
#include "config/throughput_control_group.h"

#include "config/convert.h"
#include "ssx/sformat.h"
Expand Down
4 changes: 2 additions & 2 deletions src/v/container/tests/bench_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* by the Apache License, Version 2.0
*/
#pragma once
#include "base/type_traits.h"
#include "random/generators.h"
#include "utils/functional.h"
#include "utils/type_traits.h"

#include <seastar/testing/perf_tests.hh>

Expand Down Expand Up @@ -56,6 +56,6 @@ static auto make_value() {
.okdone = random_generators::get_int<size_t>(),
};
} else {
static_assert(utils::unsupported_type<ValueT>::value, "unsupported");
static_assert(base::unsupported_type<ValueT>::value, "unsupported");
}
}
2 changes: 1 addition & 1 deletion src/v/container/tests/vector_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
* by the Apache License, Version 2.0
*/

#include "base/type_traits.h"
#include "container/fragmented_vector.h"
#include "container/tests/bench_utils.h"
#include "random/generators.h"
#include "utils/functional.h"
#include "utils/type_traits.h"

#include <seastar/testing/perf_tests.hh>

Expand Down
1 change: 1 addition & 0 deletions src/v/http/tests/http_client_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "http/client.h"
#include "http/logger.h"
#include "json/document.h"
#include "json/json.h"
#include "net/dns.h"
#include "net/transport.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ consteval describe_configs_type property_config_type() {
return describe_configs_type::list;
} else {
static_assert(
utils::unsupported_type<T>::value,
base::unsupported_type<T>::value,
"Type name is not supported in describe_configs_type");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/v/kafka/server/handlers/describe_configs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "kafka/server/handlers/describe_configs.h"

#include "base/type_traits.h"
#include "cluster/metadata_cache.h"
#include "cluster/types.h"
#include "config/configuration.h"
Expand All @@ -28,7 +29,6 @@
#include "reflection/type_traits.h"
#include "security/acl.h"
#include "ssx/sformat.h"
#include "utils/type_traits.h"

#include <seastar/core/do_with.hh>
#include <seastar/core/smp.hh>
Expand Down
2 changes: 1 addition & 1 deletion src/v/kafka/server/snc_quota_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "prometheus/prometheus_sanitize.h"
#include "ssx/future-util.h"
#include "ssx/sharded_ptr.h"
#include "tristate.h"
#include "utils/tristate.h"

#include <seastar/core/metrics.hh>

Expand Down
13 changes: 13 additions & 0 deletions src/v/metrics/metrics.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
/*
* Copyright 2024 Redpanda Data, Inc.
*
* Use of this software is governed by the Business Source License
* included in the file licenses/BSL.md
*
* As of the Change Date specified in that file, in accordance with
* the Business Source License, use of this software will be governed
* by the Apache License, Version 2.0
*/
#include "metrics.h"

#include "base/vassert.h"
#include "config/configuration.h"

namespace metrics {

internal_metric_groups& internal_metric_groups::add_group(
Expand Down
1 change: 0 additions & 1 deletion src/v/metrics/metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#pragma once

#include "config/configuration.h"
#include "metrics/metrics_registry.h"
#include "ssx/sformat.h"
#include "utils/hdr_hist.h"
Expand Down
2 changes: 1 addition & 1 deletion src/v/model/adl_serde.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "model/record.h"
#include "model/timeout_clock.h"
#include "reflection/adl.h"
#include "tristate.h"
#include "utils/tristate.h"

#include <seastar/net/inet_address.hh>
#include <seastar/net/ip.hh>
Expand Down
1 change: 1 addition & 0 deletions src/v/net/include/net/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <seastar/net/api.hh>
#include <seastar/net/socket_defs.hh>
#include <seastar/net/tls.hh>
#include <seastar/util/log.hh>

#include <boost/intrusive/list.hpp>

Expand Down
2 changes: 1 addition & 1 deletion src/v/pandaproxy/json/requests/produce.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "kafka/protocol/produce.h"
#include "pandaproxy/json/iobuf.h"
#include "pandaproxy/json/types.h"
#include "tristate.h"
#include "utils/tristate.h"

#include <seastar/core/sstring.hh>

Expand Down
1 change: 1 addition & 0 deletions src/v/raft/coordinated_recovery_throttle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "raft/coordinated_recovery_throttle.h"

#include "config/configuration.h"
#include "prometheus/prometheus_sanitize.h"
#include "raft/logger.h"

Expand Down
4 changes: 2 additions & 2 deletions src/v/redpanda/admin/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#pragma once

#include "base/seastarx.h"
#include "base/type_traits.h"
#include "cloud_storage/fwd.h"
#include "cluster/fwd.h"
#include "cluster/tx_gateway_frontend.h"
Expand All @@ -32,7 +33,6 @@
#include "security/types.h"
#include "storage/node.h"
#include "transform/fwd.h"
#include "utils/type_traits.h"

#include <seastar/core/do_with.hh>
#include <seastar/core/scheduling.hh>
Expand Down Expand Up @@ -172,7 +172,7 @@ class admin_server {
auth_state.pass();
} else {
static_assert(
utils::unsupported_value<required_auth>::value,
base::unsupported_value<required_auth>::value,
"Invalid auth_level");
}

Expand Down
Loading
Loading