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

(#12358): NuRaft recipe #12360

Merged
merged 34 commits into from
Nov 25, 2022
Merged

(#12358): NuRaft recipe #12360

merged 34 commits into from
Nov 25, 2022

Conversation

szmyd
Copy link
Contributor

@szmyd szmyd commented Aug 18, 2022

Specify library name and version: nuraft/cci.20220801

A robust RAFT implementation in C++11 used throughout eBay storage services.

closes #12358

  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit 243c5ad
nuraft/cci.20220801
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libnuraft.so' links to system library 'm' but it is not in cpp_info.system_libs.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@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.

Couple small comments and questions

Overall it's super close

recipes/nuraft/all/conanfile.py Outdated Show resolved Hide resolved
recipes/nuraft/all/conanfile.py Outdated Show resolved Hide resolved
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pessimizing-move")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be managed by Conan

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I let it, then the shared library option does not include PIC and I end up with:

/usr/bin/ld: CMakeFiles/RAFT_CORE_OBJ.dir/src/handle_commit.cxx.o: relocation R_X86_64_TPOFF32 against `_ZZN6nuraft11raft_server11reconfigureERKSt10shared_ptrINS_14cluster_configEEE8temp_buf' can not be used when making a shared object; recompile with -fPIC

So it seems fPIC is needed regardless which conan is not managing correctly?

Copy link
Member

Choose a reason for hiding this comment

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

conan does not pass -fPIC, but the CMAKE_POSITION_INDEPENDENT_CODE definition

https://docs.conan.io/en/latest/reference/conanfile/tools/cmake/cmaketoolchain.html#cmaketoolchain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, and it seems to not be present with the shared option enabled (I’ll double check), so I had to leave the original author’s -fPIC flag in the cmake rules.

Copy link
Contributor

Choose a reason for hiding this comment

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

😕 by default CMake does the right thing https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE

So there must be some hackery in the build script tripping up the sensible default 🙈

-
- set(ASIO_INCLUDE_DIR ${BOOST_INCLUDE_PATH})
- set(LIBBOOST_SYSTEM "${BOOST_LIBRARY_PATH}/libboost_system.a")
-
-else ()
- # If not, ASIO standalone mode.
+ set(ASIO_DEP boost::boost)
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed this was replaced below 🤔

Should we not use the asio target?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is? If Boost_FOUND tests false I find the asio package and set ASIO_DEP to asio::asio and use ${ASIO_DEP} as the target_link_library. Am I missing the point?

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought there was Boost::asio but it's not official now that I double check https://cmake.org/cmake/help/latest/module/FindBoost.html#imported-targets

@conan-center-bot

This comment has been minimized.

raise ConanInvalidConfiguration("Building Shared Object for {} unsupported".format(self.info.settings.os))
if self.info.settings.compiler.cppstd:
check_min_cppstd(self, 11)

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def layout(self):
cmake_layout(self, src_folder="src")

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import copy, get, apply_conandata_patches
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout


def requirements(self):
if self.options.asio == "boost":
self.requires("boost/1.79.0")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.requires("boost/1.79.0")
self.requires("boost/1.80.0")

We have Boost 1.80.0 available on Conan Center.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it not better to target a lower MINOR since it won’t require recompile should someone want 1.80.0 as opposed to the reverse which would?

Copy link
Member

Choose a reason for hiding this comment

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

soon or later, all recipes will use 1.80.0, then your recipe will need to be updated too. Doing it now, it are just doing what should be done later.

Copy link
Contributor

Choose a reason for hiding this comment

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

In ConanCenter we always try to stay on latest to avoid conflicts... two recipes using boost should work together (hopefully)


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be the test for the new generators and this can be moved to test_v1_package/

SSE4
SSE4 previously approved these changes Oct 15, 2022
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.

@conan-center-bot conan-center-bot requested review from jcar87 and removed request for jgsogo October 19, 2022 11:58
@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline

All green in build 31 (f4798d4cb65770407c63b624be2b5a393c8030bc):

  • nuraft/2.0.0@:
    All packages built successfully! (All logs)

Copy link
Member

@danimtb danimtb left a comment

Choose a reason for hiding this comment

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

although there are still some comments to be resolved, I think there is a reasonable amount of work here to move the PR forward. So let's do it and keep the details for another one 👊

@conan-center-bot conan-center-bot merged commit 8740901 into conan-io:master Nov 25, 2022
@szmyd szmyd deleted the nuraft branch February 22, 2023 17:06
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.

[request] nuraft/cci.20220801
7 participants