Skip to content

librdkafka-devel: find_dependency(LZ4) fails because lz4 ships no cmake config #1007

Description

@woqidaideshi

Package name

librdkafka-devel

openRuyi version

2.14.1-3.5

Describe the bug

find_package(RdKafka CONFIG) fails with:

CMake Error at /usr/lib64/cmake/RdKafka/RdKafkaConfig.cmake:65 (find_dependency):
  Could not find a package configuration file provided by "LZ4" with any of
  the following names:
    LZ4.cps
    lz4.cps
    LZ4Config.cmake
    lz4-config.cmake

RdKafkaConfig.cmake line 65 calls find_dependency(LZ4) which requires lz4 to provide a cmake config file. However, lz4 is built with autotools and does not ship any .cmake files.

Steps to reproduce

dnf install -y librdkafka-devel cmake gcc lz4-devel
mkdir -p /tmp/test && cd /tmp/test
cat > CMakeLists.txt << 'EOF'
cmake_minimum_required(VERSION 3.13.4)
project(cmake_verify
  VERSION "0.1"
  LANGUAGES C CXX)

find_package(RdKafka REQUIRED CONFIG)

message(STATUS "find_package(RdKafka) succeeded")
EOF
cmake -S . -B build

Expected behaviour

  • LZ4 found
  • Configuring done

Screenshots

No response

Relevant log output

:: [ 22:30:30 ] :: [   INFO   ] :: Verifying find_package(RdKafka CONFIG) ...
:: [ 22:30:30 ] :: [  BEGIN   ] :: cmake configuration (find_package RdKafka CONFIG) :: actually running 'cmake -S /tmp/tmp.PhknJAv7aG -B /tmp/tmp.PhknJAv7aG/build_0'
-- The C compiler identification is GNU 16.1.0
-- The CXX compiler identification is GNU 16.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/sbin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/sbin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib64/libz.so (found version "1.3.1")
-- Found CURL: /usr/lib64/libcurl.so (found version "8.20.0")
-- Found ZSTD: /usr/lib64/libzstd.so
-- Found OpenSSL: /usr/lib64/libcrypto.so (found version "3.6.3")
CMake Error at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:93 (find_package):
  By not providing "FindLZ4.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "LZ4", but
  CMake did not find one.

  Could not find a package configuration file provided by "LZ4" with any of
  the following names:

    LZ4.cps
    lz4.cps
    LZ4Config.cmake
    lz4-config.cmake

  Add the installation prefix of "LZ4" to CMAKE_PREFIX_PATH or set "LZ4_DIR"
  to a directory containing one of the above files.  If "LZ4" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:125 (__find_dependency_common)
  /usr/lib64/cmake/RdKafka/RdKafkaConfig.cmake:65 (find_dependency)
  CMakeLists.txt:6 (find_package)


-- Configuring incomplete, errors occurred!
:: [ 22:30:32 ] :: [   FAIL   ] :: cmake configuration (find_package RdKafka CONFIG) (Expected 0, got 1)
:: [ 22:30:32 ] :: [   FAIL   ] :: find_package(RdKafka CONFIG) verification failed

Additional context

No response

I assert that this issue is relevant for openRuyi

  • I assert that this is a bug and not a support request.
  • I assert that this is not a duplicate of an existing issue.
  • I assert that I have read the openRuyi Code of Conduct and agree to abide by it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Target: RollingTargeting rolling/current branch.Type: BugIssues related to incorrect behavior or failures that need fixing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions