diff --git a/cmake/rpcgen.cmake b/cmake/rpcgen.cmake index 9910cdaee6c15..b0dccb16ce5eb 100644 --- a/cmake/rpcgen.cmake +++ b/cmake/rpcgen.cmake @@ -14,7 +14,8 @@ function(rpcgen) add_library(${args_TARGET} STATIC ${args_OUT_FILE}) set_target_properties(${args_TARGET} PROPERTIES LINKER_LANGUAGE CXX) - target_include_directories(${args_TARGET} PUBLIC ${args_INCLUDES}) + target_include_directories(${args_TARGET} PUBLIC ${args_INCLUDES} + ${CMAKE_CURRENT_LIST_DIR}) target_link_libraries(${args_TARGET} PUBLIC v::rpc) set(${args_OUT_FILE} ${args_TARGET} PARENT_SCOPE) endfunction () diff --git a/src/v/CMakeLists.txt b/src/v/CMakeLists.txt index 3ef6148f3d608..3bbac61e5f709 100644 --- a/src/v/CMakeLists.txt +++ b/src/v/CMakeLists.txt @@ -102,12 +102,12 @@ add_subdirectory(ssx) add_subdirectory(wasm) add_subdirectory(transform) add_subdirectory(net) +add_subdirectory(rpc) # libraries add_subdirectory(test_utils) add_subdirectory(finjector) add_subdirectory(utils) -add_subdirectory(rpc) add_subdirectory(metrics) add_subdirectory(model) add_subdirectory(json) diff --git a/src/v/migrations/CMakeLists.txt b/src/v/migrations/CMakeLists.txt index 1c9bb43bd1b29..a65dad65f81b9 100644 --- a/src/v/migrations/CMakeLists.txt +++ b/src/v/migrations/CMakeLists.txt @@ -9,5 +9,5 @@ v_cc_library( v::model v::config v::compression - v::net + v::rpc ) diff --git a/src/v/rpc/backoff_policy.h b/src/v/rpc/include/rpc/backoff_policy.h similarity index 100% rename from src/v/rpc/backoff_policy.h rename to src/v/rpc/include/rpc/backoff_policy.h diff --git a/src/v/rpc/connection_cache.h b/src/v/rpc/include/rpc/connection_cache.h similarity index 100% rename from src/v/rpc/connection_cache.h rename to src/v/rpc/include/rpc/connection_cache.h diff --git a/src/v/rpc/connection_set.h b/src/v/rpc/include/rpc/connection_set.h similarity index 100% rename from src/v/rpc/connection_set.h rename to src/v/rpc/include/rpc/connection_set.h diff --git a/src/v/rpc/errc.h b/src/v/rpc/include/rpc/errc.h similarity index 100% rename from src/v/rpc/errc.h rename to src/v/rpc/include/rpc/errc.h diff --git a/src/v/rpc/exceptions.h b/src/v/rpc/include/rpc/exceptions.h similarity index 100% rename from src/v/rpc/exceptions.h rename to src/v/rpc/include/rpc/exceptions.h diff --git a/src/v/rpc/fwd.h b/src/v/rpc/include/rpc/fwd.h similarity index 100% rename from src/v/rpc/fwd.h rename to src/v/rpc/include/rpc/fwd.h diff --git a/src/v/rpc/logger.h b/src/v/rpc/include/rpc/logger.h similarity index 100% rename from src/v/rpc/logger.h rename to src/v/rpc/include/rpc/logger.h diff --git a/src/v/rpc/parse_utils.h b/src/v/rpc/include/rpc/parse_utils.h similarity index 100% rename from src/v/rpc/parse_utils.h rename to src/v/rpc/include/rpc/parse_utils.h diff --git a/src/v/rpc/reconnect_transport.h b/src/v/rpc/include/rpc/reconnect_transport.h similarity index 100% rename from src/v/rpc/reconnect_transport.h rename to src/v/rpc/include/rpc/reconnect_transport.h diff --git a/src/v/rpc/response_handler.h b/src/v/rpc/include/rpc/response_handler.h similarity index 100% rename from src/v/rpc/response_handler.h rename to src/v/rpc/include/rpc/response_handler.h diff --git a/src/v/rpc/rpc_server.h b/src/v/rpc/include/rpc/rpc_server.h similarity index 100% rename from src/v/rpc/rpc_server.h rename to src/v/rpc/include/rpc/rpc_server.h diff --git a/src/v/rpc/rpc_utils.h b/src/v/rpc/include/rpc/rpc_utils.h similarity index 100% rename from src/v/rpc/rpc_utils.h rename to src/v/rpc/include/rpc/rpc_utils.h diff --git a/src/v/rpc/service.h b/src/v/rpc/include/rpc/service.h similarity index 100% rename from src/v/rpc/service.h rename to src/v/rpc/include/rpc/service.h diff --git a/src/v/rpc/transport.h b/src/v/rpc/include/rpc/transport.h similarity index 100% rename from src/v/rpc/transport.h rename to src/v/rpc/include/rpc/transport.h diff --git a/src/v/rpc/types.h b/src/v/rpc/include/rpc/types.h similarity index 100% rename from src/v/rpc/types.h rename to src/v/rpc/include/rpc/types.h diff --git a/src/v/rpc/test/cycling_service.json b/src/v/rpc/test/cycling_service.json index ce47533c05c9f..3921be13bdbfe 100644 --- a/src/v/rpc/test/cycling_service.json +++ b/src/v/rpc/test/cycling_service.json @@ -2,7 +2,7 @@ "namespace": "cycling", "service_name": "team_movistar", "includes": [ - "rpc/test/rpc_gen_types.h" + "rpc_gen_types.h" ], "methods": [ { diff --git a/src/v/rpc/test/echo_service.json b/src/v/rpc/test/echo_service.json index b73f8eb669f11..cde1d3e5e817f 100644 --- a/src/v/rpc/test/echo_service.json +++ b/src/v/rpc/test/echo_service.json @@ -2,7 +2,7 @@ "namespace": "echo", "service_name": "echo", "includes": [ - "rpc/test/rpc_gen_types.h" + "rpc_gen_types.h" ], "methods": [ { diff --git a/src/v/rpc/test/echo_v2_service.json b/src/v/rpc/test/echo_v2_service.json index 2d77c67af0d94..288d9829c4a7c 100644 --- a/src/v/rpc/test/echo_v2_service.json +++ b/src/v/rpc/test/echo_v2_service.json @@ -2,7 +2,7 @@ "namespace": "echo_v2", "service_name": "echo", "includes": [ - "rpc/test/rpc_gen_types.h" + "rpc_gen_types.h" ], "methods": [ { diff --git a/src/v/rpc/test/netbuf_tests.cc b/src/v/rpc/test/netbuf_tests.cc index cffa131a9cdac..e6a50c4dee009 100644 --- a/src/v/rpc/test/netbuf_tests.cc +++ b/src/v/rpc/test/netbuf_tests.cc @@ -13,7 +13,7 @@ #include // utils -#include "rpc/test/test_types.h" +#include "test_types.h" #include diff --git a/src/v/rpc/test/roundtrip_tests.cc b/src/v/rpc/test/roundtrip_tests.cc index 86cf463b5ec32..c4d5d8dd68225 100644 --- a/src/v/rpc/test/roundtrip_tests.cc +++ b/src/v/rpc/test/roundtrip_tests.cc @@ -12,7 +12,7 @@ #include #include // utils -#include "rpc/test/test_types.h" +#include "test_types.h" SEASTAR_THREAD_TEST_CASE(roundtrip_pod) { auto expected = reflection::adl{}.from(reflection::to_iobuf(pod{})); diff --git a/src/v/rpc/test/rpc_gen_cycling_test.cc b/src/v/rpc/test/rpc_gen_cycling_test.cc index aedeba355964a..5588ed58ecf29 100644 --- a/src/v/rpc/test/rpc_gen_cycling_test.cc +++ b/src/v/rpc/test/rpc_gen_cycling_test.cc @@ -18,9 +18,9 @@ #include "rpc/test/cycling_service.h" #include "rpc/test/echo_service.h" #include "rpc/test/echo_v2_service.h" -#include "rpc/test/rpc_gen_types.h" -#include "rpc/test/rpc_integration_fixture.h" #include "rpc/types.h" +#include "rpc_gen_types.h" +#include "rpc_integration_fixture.h" #include "test_utils/async.h" #include "test_utils/fixture.h" diff --git a/src/v/rpc/test/rpc_gen_types.h b/src/v/rpc/test/rpc_gen_types.h index d6fd5682f9b7f..7ca9debccd716 100644 --- a/src/v/rpc/test/rpc_gen_types.h +++ b/src/v/rpc/test/rpc_gen_types.h @@ -145,7 +145,7 @@ static_assert(rpc::is_rpc_adl_exempt); namespace echo_v2 { /// This type is meant to be the evolution of the echo_req_serde_only type -/// defined in `rpc/test/rpc_gen_types.h`, the issue being that a redefinition +/// defined in `rpc_gen_types.h`, the issue being that a redefinition /// of a new type with a different parent class and new fields cannot be done /// within the same binary/library. /// diff --git a/src/v/rpc/test/serialization_test.cc b/src/v/rpc/test/serialization_test.cc index db58ffaf439e6..4e76c485f1b66 100644 --- a/src/v/rpc/test/serialization_test.cc +++ b/src/v/rpc/test/serialization_test.cc @@ -10,7 +10,7 @@ #include "bytes/iobuf.h" #include "reflection/adl.h" #include "reflection/arity.h" -#include "rpc/test/test_types.h" +#include "test_types.h" #include diff --git a/src/v/rpc/test/test_definition.json b/src/v/rpc/test/test_definition.json index f7e8cbc0dcffd..e277f1e095c32 100644 --- a/src/v/rpc/test/test_definition.json +++ b/src/v/rpc/test/test_definition.json @@ -2,7 +2,7 @@ "namespace": "cycling", "service_name": "team_movistar", "includes": [ - "rpc/test/rpc_gen_types.h" + "rpc_gen_types.h" ], "methods": [ { diff --git a/src/v/security/CMakeLists.txt b/src/v/security/CMakeLists.txt index f6c5a5405a1c3..405ec27b79a28 100644 --- a/src/v/security/CMakeLists.txt +++ b/src/v/security/CMakeLists.txt @@ -38,6 +38,7 @@ v_cc_library( v::random v::version v::bytes_random + v::rpc absl::flat_hash_map absl::flat_hash_set cryptopp diff --git a/tools/lint-includes b/tools/lint-includes index 896823721002a..3c9a0928724fc 100755 --- a/tools/lint-includes +++ b/tools/lint-includes @@ -18,7 +18,10 @@ import re # but since there is no file on the filesystem, we need to teach # this script that the file is there. GENERATED_CODE = { - pathlib.Path("transform/rpc/rpc_service.h") + pathlib.Path("transform/rpc/rpc_service.h"), + pathlib.Path("rpc/test/cycling_service.h"), + pathlib.Path("rpc/test/echo_service.h"), + pathlib.Path("rpc/test/echo_v2_service.h"), } def get_modules(root):