Skip to content

Commit

Permalink
Merge pull request #18105 from dotnwat/rpc-module-new-style
Browse files Browse the repository at this point in the history
[CORE-2062] rpc: convert rpc module to new-style module
  • Loading branch information
dotnwat authored Apr 26, 2024
2 parents e4b9c9c + 94809ac commit 6f02ffb
Show file tree
Hide file tree
Showing 29 changed files with 19 additions and 14 deletions.
3 changes: 2 additions & 1 deletion cmake/rpcgen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
2 changes: 1 addition & 1 deletion src/v/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/v/migrations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ v_cc_library(
v::model
v::config
v::compression
v::net
v::rpc
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/v/rpc/test/cycling_service.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"namespace": "cycling",
"service_name": "team_movistar",
"includes": [
"rpc/test/rpc_gen_types.h"
"rpc_gen_types.h"
],
"methods": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/v/rpc/test/echo_service.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"namespace": "echo",
"service_name": "echo",
"includes": [
"rpc/test/rpc_gen_types.h"
"rpc_gen_types.h"
],
"methods": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/v/rpc/test/echo_v2_service.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"namespace": "echo_v2",
"service_name": "echo",
"includes": [
"rpc/test/rpc_gen_types.h"
"rpc_gen_types.h"
],
"methods": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/v/rpc/test/netbuf_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <seastar/testing/thread_test_case.hh>

// utils
#include "rpc/test/test_types.h"
#include "test_types.h"

#include <fmt/ostream.h>

Expand Down
2 changes: 1 addition & 1 deletion src/v/rpc/test/roundtrip_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <seastar/core/thread.hh>
#include <seastar/testing/thread_test_case.hh>
// utils
#include "rpc/test/test_types.h"
#include "test_types.h"

SEASTAR_THREAD_TEST_CASE(roundtrip_pod) {
auto expected = reflection::adl<pod>{}.from(reflection::to_iobuf(pod{}));
Expand Down
4 changes: 2 additions & 2 deletions src/v/rpc/test/rpc_gen_cycling_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/v/rpc/test/rpc_gen_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static_assert(rpc::is_rpc_adl_exempt<echo_resp_serde_only>);
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.
///
Expand Down
2 changes: 1 addition & 1 deletion src/v/rpc/test/serialization_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <seastar/testing/thread_test_case.hh>

Expand Down
2 changes: 1 addition & 1 deletion src/v/rpc/test/test_definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"namespace": "cycling",
"service_name": "team_movistar",
"includes": [
"rpc/test/rpc_gen_types.h"
"rpc_gen_types.h"
],
"methods": [
{
Expand Down
1 change: 1 addition & 0 deletions src/v/security/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tools/lint-includes
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 6f02ffb

Please sign in to comment.