Skip to content

Commit 8e41857

Browse files
beryll1umrobot-piglet
authored andcommitted
fix kafka: add missing rdkafka_mock.h header
Causes build to fail, with a typical error message about the missing header. ```cmake cmake_minimum_required(VERSION 3.14) project(XXX LANGUAGES CXX) set(USERVER_PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/submodules/userver") if(EXISTS ${USERVER_PROJECT_DIR}) add_subdirectory(${USERVER_PROJECT_DIR}) else() message(FATAL_ERROR "Unable to locate userver in the submodules directory") endif() file(GLOB_RECURSE XXX_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") add_executable(${PROJECT_NAME} ${XXX_SRC_FILES}) target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23) userver_setup_environment() target_link_libraries(${PROJECT_NAME} PUBLIC userver::core userver::kafka) ``` ```cpp // src/main.cpp #include <userver/components/minimal_server_component_list.hpp> #include <userver/utils/daemon_run.hpp> int main(int argc, char* argv[]) { auto components_list = userver::components::MinimalServerComponentList(); return userver::utils::DaemonMain(argc, argv, components_list); } ``` ```sh cmake -B build -DUSERVER_FEATURE_UTEST=OFF -DUSERVER_FEATURE_STACKTRACE=OFF -DUSERVER_FEATURE_KAFKA=ON cmake --build build -- -j 16 ``` ``` submodules/userver/kafka/src/kafka/impl/holders.cpp:7:10: fatal error: librdkafka/rdkafka_mock.h: No such file or directory 7 | #include <librdkafka/rdkafka_mock.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. ``` 63de2c9 adds the include directive for this header, but the wrapper header `rdkafka_mock.h` itself was not provided. --- Pull Request resolved: #1060 commit_hash:c6252833a9b354bf2fad7d9d47d97ea5c23fd55b
1 parent 6218313 commit 8e41857

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

.mapping.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2605,6 +2605,7 @@
26052605
"kafka/utest/include/userver/kafka/utest/kafka_fixture.hpp":"taxi/uservices/userver/kafka/utest/include/userver/kafka/utest/kafka_fixture.hpp",
26062606
"kafka/utest/src/kafka/utest/kafka_fixture.cpp":"taxi/uservices/userver/kafka/utest/src/kafka/utest/kafka_fixture.cpp",
26072607
"kafka/wrapper/include/librdkafka/rdkafka.h":"taxi/uservices/userver/kafka/wrapper/include/librdkafka/rdkafka.h",
2608+
"kafka/wrapper/include/librdkafka/rdkafka_mock.h":"taxi/uservices/userver/kafka/wrapper/include/librdkafka/rdkafka_mock.h",
26082609
"libraries/CMakeLists.txt":"taxi/uservices/userver/libraries/CMakeLists.txt",
26092610
"libraries/easy/CMakeLists.txt":"taxi/uservices/userver/libraries/easy/CMakeLists.txt",
26102611
"libraries/easy/include/userver/easy.hpp":"taxi/uservices/userver/libraries/easy/include/userver/easy.hpp",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include <rdkafka_mock.h>

0 commit comments

Comments
 (0)