Skip to content

Conversation

wer14
Copy link
Contributor

@wer14 wer14 commented Oct 5, 2020

Specify library name and version: cassandra-cpp-driver/2.15.3

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

@CLAassistant
Copy link

CLAassistant commented Oct 5, 2020

CLA assistant check
All committers have signed the CLA.

@conan-center-bot
Copy link
Contributor

Some configurations of 'cassandra-cpp-driver/2.15.3' failed in build 1 (e8e7032be7d21aa354fcc2436ee2fda6fa136ab6):

@conan-center-bot
Copy link
Contributor

All green in build 2 (8aee6f6269ddc4625b7f58de4a57266369e1c897)! 😊

  • cassandra-cpp-driver/2.15.3: Generated 124 packages (+ 12 invalid config from build()). All logs here

Comment on lines 47 to 48
if self.settings.os == "Macos":
raise ConanInvalidConfiguration("Macos is unsuported")
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be moved to configure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 51 to 55
# Compilation error on Linux with clang
# cmake.definitions["CASS_USE_BOOST_ATOMIC"] = True
# cmake.definitions["CASS_USE_STD_ATOMIC"] = False
raise ConanInvalidConfiguration(
"Boost.Atomic is not supported at the moment")
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it work for gcc@Linux?
If so, you can move the throw to configure (and only if use_atomic=True and compiler=clang) and set the cmake definitions here unconditionally.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think. Bincrafters has a similar recipe, Linux is excluded: https://github.com/bincrafters/conan-cassandra-driver

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tested with GCC and Clang on Linux - compilation failed. Boost.Atomic is switched off for Linux. But I switched it on for Windows.
Done at

Comment on lines 63 to 64
cmake.definitions["CASS_USE_OPENSSL"] = self.options.with_openssl
cmake.definitions["CASS_USE_ZLIB"] = self.options.with_zlib
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this indentation correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not.
Fixed at

Comment on lines 15 to 19
-project(cassandra C CXX)
+# project(cassandra C CXX)
+
+# include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
+# conan_basic_setup()
Copy link
Contributor

@madebr madebr Oct 5, 2020

Choose a reason for hiding this comment

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

I think these lines are harmless. Or aren't they?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are.
Fixed

Comment on lines 27 to 33
-option(CASS_BUILD_EXAMPLES "Build examples" OFF)
-option(CASS_BUILD_INTEGRATION_TESTS "Build integration tests" OFF)
-option(CASS_BUILD_SHARED "Build shared library" ON)
-option(CASS_BUILD_STATIC "Build static library" OFF)
-option(CASS_BUILD_TESTS "Build tests" OFF)
-option(CASS_BUILD_UNIT_TESTS "Build unit tests" OFF)
-option(CASS_DEBUG_CUSTOM_ALLOC "Debug custom allocator" OFF)
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of removing these options and carrying a heavy patch,
I think you can set the definitions in the conanfile.
e.g.

cmake.definitions["CASS_BUILD_EXAMPLES"] = False

Copy link
Contributor

Choose a reason for hiding this comment

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

Setting it this way will make the patch much lighter, I think.
Because you don't have to re-do the add_library for shared/static thing.

Copy link
Contributor Author

@wer14 wer14 Oct 8, 2020

Choose a reason for hiding this comment

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

Fixed at

Please notice: I did not revert the part where I can choose which lib to build shared/static.

+
+if(WIN32)
+ target_link_libraries(${PROJECT_LIB_NAME_TARGET}
+ iphlpapi
Copy link
Contributor

Choose a reason for hiding this comment

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

These system libraries should also be added to the conanfile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

diff --git a/src/third_party/minizip/CMakeLists.txt b/src/third_party/minizip/CMakeLists.txt
index 569bf91f6..b2e189360 100644
--- a/src/third_party/minizip/CMakeLists.txt
+++ b/src/third_party/minizip/CMakeLists.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the minizip from conan instead of the vendored minizip here?
This will avoid a linker error when linking to a static minizip recipe and cassandra-cpp-driver.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we can
Fixed at

--- a/src/third_party/http-parser/CMakeLists.txt
+++ b/src/third_party/http-parser/CMakeLists.txt
@@ -3,15 +3,8 @@ file(GLOB SOURCES http_parser.c http_parser.h)
source_group("Source Files\\" REGULAR_EXPRESSION ".*\\.c(pp)?")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use a conan http-parser?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we can
Fixed at

--- a/src/third_party/hdr_histogram/CMakeLists.txt
+++ b/src/third_party/hdr_histogram/CMakeLists.txt
@@ -3,15 +3,8 @@ file(GLOB SOURCES *.cpp *.hpp)
source_group("Source Files\\" REGULAR_EXPRESSION ".*\\.c(pp)?")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use a conan hdr_histogram?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No we can not. Cassandra uses patched hdr_histogram version.

--- a/src/third_party/curl/CMakeLists.txt
+++ b/src/third_party/curl/CMakeLists.txt
@@ -3,16 +3,8 @@ file(GLOB SOURCES *.cpp *.hpp)
source_group("Source Files\\" REGULAR_EXPRESSION ".*\\.c(pp)?")
Copy link
Contributor

Choose a reason for hiding this comment

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

We should really use the conan curl recipe/package.

(unless this directory only contains the code to use curl instead of the curl source tree itself)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately curl implementation that uses Cassandra represents a private piece of code from original sources.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does replacing these sources with a link to CONAN_PKG::libcurl work?
If libcurl is built as a static library, all symbols are visible.

Copy link
Contributor

Choose a reason for hiding this comment

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

@madebr But what about headers? https://github.com/curl/curl/blob/master/lib/hostcheck.h seems to be private as well. Anyway, such breaking through the public library API looks tricky to me.

Copy link
Contributor

@madebr madebr Oct 8, 2020

Choose a reason for hiding this comment

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

Indeed, you're right. No hostcheck.h is installed by cci's libcurl.

Can you try the following?
Add libcurl/7.72.0 to the requirements of the test_package and see whether libcurl and cassandra cause problems.

Either way, you cannot use cci's libcurl.
But this may cause a static libcurl being incompatible with cassandra-cpp-driver.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you talking about violating of ODR for Curl_cert_hostcheck?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, symbol of static libcurl.a <-> this one.

Copy link
Contributor

Choose a reason for hiding this comment

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

So, it seems that the code of cassandra driver needs to be patched, but is this a good way to solve this problem? In comparison to adding a package to CCI with some usage limitations.

Copy link
Contributor

Choose a reason for hiding this comment

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

@vaerizk
Limitations are totally fine.
We're still in the process of determining what those limitations are.
If a patch can fix the issues, maybe these can be upstreamed and others can benefit from them.

Copy link
Contributor

@Nipheris Nipheris Oct 15, 2020

Choose a reason for hiding this comment

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

@madebr We have tested the test_package with cassandra-cpp-driver and libcurl dependencies included at the same time. Seems it works by good fortune 😄 .

We have included the following examples, using SSL - this one for cassandra driver, and this one for libcurl - into one executable to make sure both Curl_cert_hostcheck-s are invoked and preserved into final executable after linking. The package with test executable is built using -o shared=false to use static variants of dependencies and -s build_type=Debug to keep readable names in the output PE binary.

And now we have two symbols in the executable:

@SSE4 SSE4 requested review from danimtb and uilianries October 6, 2020 08:42
wer14 and others added 2 commits October 8, 2020 18:19
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
@conan-center-bot
Copy link
Contributor

All green in build 14 (f5323c04bd98f589318cd02bd551127129007a91)! 😊

  • cassandra-cpp-driver/2.15.3: Generated 124 packages. All logs here

prince-chrismc
prince-chrismc previously approved these changes Oct 14, 2020
@wer14
Copy link
Contributor Author

wer14 commented Oct 26, 2020

@madebr, @Croydon Hi! It's been a while since your last message. Just checking is everything Okay?

Comment on lines 7 to 9
- base_path: "source_subfolder"
patch_file: "patches/2.15.3/fix-rapidjson.patch"
patch_file: "patches/2.15.3/fix-cmake.patch"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- base_path: "source_subfolder"
patch_file: "patches/2.15.3/fix-rapidjson.patch"
patch_file: "patches/2.15.3/fix-cmake.patch"
- base_path: "source_subfolder"
patch_file: "patches/2.15.3/fix-rapidjson.patch"
- base_path: "source_subfolder"
patch_file: "patches/2.15.3/fix-cmake.patch"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@wer14 wer14 Nov 3, 2020

Choose a reason for hiding this comment

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

"fPIC": [True, False],
"install_header_in_subdir": [True, False],
"use_atomic": [None, "boost", "std"],
"with_openssl": [True, False],
Copy link
Contributor

@madebr madebr Oct 27, 2020

Choose a reason for hiding this comment

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

Is openssl the only tls provider?
Some packages offer wolfssl/libretls/... support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep openssl is the only tls provider in this package.

@madebr
Copy link
Contributor

madebr commented Oct 27, 2020

@madebr, @Croydon Hi! It's been a while since your last message. Just checking is everything Okay?

Thanks for asking! I'm fine! How are you? 🤣

re this pr: can you check my suggestion + question?
I think these are my last questions before approval.

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
@conan-center-bot
Copy link
Contributor

Some configurations of 'cassandra-cpp-driver/2.15.3' failed in build 15 (8e6c1555ecaa29380ed45954bae935ae1fc8aeab):

@conan-center-bot
Copy link
Contributor

Some configurations of 'cassandra-cpp-driver/2.15.3' failed in build 16 (3b91907e1bf34c3304e28d9d7abe973e933f3692):

@conan-center-bot
Copy link
Contributor

All green in build 17 (1b19c9edc1bf41a1a930b229f53ffdf2a8ec1981)! 😊

  • cassandra-cpp-driver/2.15.3: Generated 124 packages. All logs here

madebr
madebr previously approved these changes Nov 4, 2020
prince-chrismc
prince-chrismc previously approved these changes Nov 4, 2020
self._cmake.definitions["CASS_USE_ZLIB"] = self.options.with_zlib
self._cmake.definitions["CASS_USE_LIBSSH2"] = False

# FIXME
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
# FIXME
# FIXME

FIXME what? Please, add more detail on that tag.

Copy link
Contributor Author

@wer14 wer14 Nov 5, 2020

Choose a reason for hiding this comment

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

@wer14 wer14 dismissed stale reviews from prince-chrismc and madebr via 79bf53e November 5, 2020 14:34
@conan-center-bot
Copy link
Contributor

All green in build 18 (79bf53e48310fa3a088ca65ab170ef510bf0caa8)! 😊

  • cassandra-cpp-driver/2.15.3: Generated 124 packages. All logs here

@conan-center-bot
Copy link
Contributor

All green in build 19 (2415f1cdd30fabff475d83777795321a10c57c5c)! 😊

  • cassandra-cpp-driver/2.15.3: Generated 124 packages. All logs here

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.

9 participants