Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librdkafka: add 1.9.2 + modernize #12022

Merged

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Aug 3, 2022

  • restore cmake_find_package in generators, since find modules have precedence over config files (important for zlib, openssl and libcurl).
  • drop CONAN_PKG:: logic in old patches, to prepare for conan v2 transition
  • robust link of zstd targets (zstd::zstd won't exist in CMakeDeps generator, it's either zstd::libzstd_shared or zstd::libzstd_static)

- restore cmake_find_package usage, since find modules have precedence over config files (important for zlib, openssl and libcurl).
- drop CONAN_PKG:: logic in old patches, to prepare for conan v2 transition
- robust link of zstd targets (zstd::zstd won't exist in CMakeDeps generator, it's either zstd::libzstd_shared or zstd::libzstd_static)
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

uilianries
uilianries previously approved these changes Aug 3, 2022
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

seems that PKG_CONFIG_PATH is not automatically set to generators folder in conan v2 yet
@SpaceIm SpaceIm changed the title librdkafka: restore robust dependencies handling for zlib, openssl & libcurl librdkafka: modernize Aug 3, 2022
@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Aug 3, 2022

[HOOK - conan-center.py] post_package_info(): ERROR: [LIBRARY DOES NOT EXIST (KB-H054)] Component librdkafka::rdkafka library 'rdkafka' is listed in the recipe, but not found installed at self.cpp_info.libdirs. Make sure you compiled the library correctly. If so, then the library name should probably be fixed. Otherwise, then the component should be removed. (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H054) 
[HOOK - conan-center.py] post_package_info(): ERROR: [LIBRARY DOES NOT EXIST (KB-H054)] Component librdkafka::rdkafka++ library 'rdkafka++' is listed in the recipe, but not found installed at self.cpp_info.libdirs. Make sure you compiled the library correctly. If so, then the library name should probably be fixed. Otherwise, then the component should be removed. (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H054) 
ERROR: 
	ConanException: [HOOK - conan-center.py] post_package_info(): Some checks failed running the hook, check the output

What? conan create just works fine for me, so I guess hook is wrong.

We can see that libs are properly installed in the log:

-- Install configuration: "Debug"
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/lib/cmake/RdKafka/RdKafkaConfig.cmake
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/lib/cmake/RdKafka/RdKafkaConfigVersion.cmake
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/lib/cmake/RdKafka/FindLZ4.cmake
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/lib/cmake/RdKafka/RdKafkaTargets.cmake
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/lib/cmake/RdKafka/RdKafkaTargets-debug.cmake
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/share/licenses/librdkafka/LICENSES.txt
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/lib/pkgconfig/rdkafka-static.pc
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/lib/librdkafka.a
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/include/librdkafka/rdkafka.h
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/include/librdkafka/rdkafka_mock.h
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/lib/pkgconfig/rdkafka++-static.pc
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/lib/librdkafka++.a
-- Installing: /home/conan/w/prod/BuildSingleReference/.conan/data/librdkafka/1.7.0/_/_/package/3a49829021dbd8cab367338443324cfec3b7a070/include/librdkafka/rdkafkacpp.h

@SpaceIm SpaceIm closed this Aug 3, 2022
@SpaceIm SpaceIm reopened this Aug 3, 2022
@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Aug 3, 2022

Can't reproduce locally with latest hooks. I'm running conan 1.51.0, it's conan 1.49.0 in CI?
EDIT: ok, I see a workaround in fmt recipe, it's indeed an issue of conan < 1.50.0

@SpaceIm SpaceIm changed the title librdkafka: modernize librdkafka: add 1.9.2 + modernize Aug 3, 2022
@SpaceIm SpaceIm closed this Aug 3, 2022
@SpaceIm SpaceIm reopened this Aug 3, 2022
@conan-center-bot

This comment has been minimized.

Copy link
Contributor

@prince-chrismc prince-chrismc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks super duper good 👍

One tiny question

Comment on lines 81 to 82
self.folders.source = "src"
self.folders.build = "build"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be the defaults 🤔 were they explicitly required?

Copy link
Contributor Author

@SpaceIm SpaceIm Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question

signature of cmake_layout is cmake_layout(conanfile, generator=None, src_folder=".")

So the default layout of cmake_layout:

def layout(self):
    cmake_layout(self)
build/
  <package_id>/
    build/
      <build_type>/
        build_artifacts_1
        ...
        build_artifacts_n
        generators/
    patches/
    source_code_file_1
    ...
    source_code_file_n
source/
  patches/
  source_code_file_1
  ...
  source_code_file_n
  • source code and patches folder are mixed up, as well as build folder and source code (not a fully out of source build).
  • and less important: build/<build_type> is unnecessarily long (might lead to path length issue on Windows). Though, default value of cmake_layout is "build" for multi config generators.

So I propose instead this layout:

def layout(self):
    cmake_layout(self, src_folder="src")
    self.folders.build = "build"
build/
  <package_id>/
    build/
      build_artifacts_1
      ...
      build_artifacts_n
      generators/
    patches/
    src/
      source_code_file_1
      ...
      source_code_file_n
source/
  patches/
  src/
    source_code_file_1
    ...
    source_code_file_n

It would even be better with generators folder outside of build folder:

def layout(self):
    cmake_layout(self, src_folder="src")
    self.folders.build = "build"
    self.folders.generators = "generators"
build/
  <package_id>/
    build/
      build_artifacts_1
      ...
      build_artifacts_n
    generators/
    patches/
    src/
      source_code_file_1
      ...
      source_code_file_n
source/
  patches/
  src/
    source_code_file_1
    ...
    source_code_file_n

@SpaceIm SpaceIm closed this Aug 4, 2022
@SpaceIm SpaceIm reopened this Aug 4, 2022
@conan-center-bot
Copy link
Collaborator

All green in build 22 (1b94cc518d75220caabf9fcd0883f6bf21bce96f):

  • librdkafka/1.8.2@:
    All packages built successfully! (All logs)

  • librdkafka/1.8.0@:
    All packages built successfully! (All logs)

  • librdkafka/1.9.2@:
    All packages built successfully! (All logs)

  • librdkafka/1.9.1@:
    All packages built successfully! (All logs)

  • librdkafka/1.6.1@:
    All packages built successfully! (All logs)

  • librdkafka/1.5.3@:
    All packages built successfully! (All logs)

  • librdkafka/1.6.0@:
    All packages built successfully! (All logs)

  • librdkafka/1.7.0@:
    All packages built successfully! (All logs)

@conan-center-bot conan-center-bot merged commit 3bb4667 into conan-io:master Aug 6, 2022
@SpaceIm SpaceIm deleted the fix/librdkafka-robust-deps-handling branch August 6, 2022 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants