userver-framework / userver

Production-ready C++ Asynchronous Framework with rich functionality
https://userver.tech
Apache License 2.0
2.37k stars 275 forks source link

"No such file or directory" for chaotic gen in docker #664

Open ybairamgalin opened 1 month ago

ybairamgalin commented 1 month ago

Adding these lines of code from docs

include(ChaoticGen)

file(GLOB_RECURSE SCHEMAS ${CMAKE_CURRENT_SOURCE_DIR}/schemas/*.yaml)
userver_target_generate_chaotic(${PROJECT_NAME}-chgen
        ARGS
        # Map '/components/schemas/*' JSONSchema types to C++ types in 'samples::hello' namespace
        -n "/components/schemas/([^/]*)/=samples::hello::{0}"
        -f "(.*)={0}"
        # Don't call clang-format
        --clang-format=
        # Generate serializers for responses
        --generate-serializers
        OUTPUT_DIR
        ${CMAKE_CURRENT_BINARY_DIR}/src
        SCHEMAS
        ${SCHEMAS}
        RELATIVE_TO
        ${CMAKE_CURRENT_SOURCE_DIR}
)
target_link_libraries(${PROJECT_NAME}_objs ${PROJECT_NAME}-chgen)

to the CMakeLists.txt makes docker toolchain build fail with error

CMake Error at /usr/lib/cmake/userver/UserverVenv.cmake:31 (file):
  file failed to open for reading (No such file or directory):

    /usr/lib/cmake/scripts/chaotic/requirements.txt

Looks like requirements.txt file is located at /usr/lib/cmake/userver/chaotic, not /usr/lib/cmake/scripts/chaotic.