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

Add options to use system abseil, lz4 and cityhash #168

Closed

Conversation

DavidKeller
Copy link
Contributor

@DavidKeller DavidKeller commented Apr 6, 2022

This change closes #86, and closes #99.

Furthermore, it eases Conan packaging, as Conan already provides abseil, lz4 and cityhash.

Signed-off-by: David Keller [email protected]

@DavidKeller
Copy link
Contributor Author

Hi,

CI is broken on master due to SSL error, hence I can't verify that my changes aren't causing regression.

See other MRs

Would you be kind enough to have a look at the SSL issue ?

@CLAassistant
Copy link

CLAassistant commented Apr 11, 2022

CLA assistant check
All committers have signed the CLA.

@filimonov
Copy link
Collaborator

Would you be kind enough to have a look at the SSL issue ?

Should be fixed in #170

BTW - maybe that should be also added to a build matrix? I.e. build with system libs, similar to

- ssl: ssl_ON
INSTALL_SSL: libssl-dev
EXTRA_CMAKE_FLAGS: -DWITH_OPENSSL=ON

@Enmk
Copy link
Collaborator

Enmk commented Apr 13, 2022

BTW - maybe that should be also added to a build matrix? I.e. build with system libs, similar to

We DEFINITELY need to add at least 1 variant to the build matrix for each platform: build with system libs (i.e. -DUSE_SYSTEM_CITYHASH=ON -DUSE_SYSTEM_ABSEIL=ON -DUSE_SYSTEM_LZ4=ON)

@Enmk
Copy link
Collaborator

Enmk commented Apr 13, 2022

@DavidKeller Tnak you for a PR, few more steps to get it merged:

  • sign a CLA
  • update the build matrix
  • Please also explain why would you need to move third-parties one level deeper? E.g. why contrib/absl/absl istead of just contrib/absl, etc?

CMakeLists.txt Outdated Show resolved Hide resolved
@DavidKeller DavidKeller force-pushed the feature/opt-dependencies branch 2 times, most recently from 4a2fd8f to c6354b1 Compare April 13, 2022 09:29
@DavidKeller
Copy link
Contributor Author

  • Please also explain why would you need to move third-parties one level deeper?
    E.g. why contrib/absl/absl istead of just contrib/absl, etc?

In the previous layout, It user wants to use the contrib absl, the build system would have to include

    INCLUDE_DIRECTORIES (contrib)

But that would include other dependencies as well, even if the user prefers to rely on the system lz4 or cityhash.

The extra level allow to add only absl to the include path, i.e.:

    INCLUDE_DIRECTORIES (contrib/absl)

@DavidKeller DavidKeller force-pushed the feature/opt-dependencies branch from c6354b1 to 16ef205 Compare April 13, 2022 09:50
@DavidKeller
Copy link
Contributor Author

We DEFINITELY need to add at least 1 variant to the build matrix for each platform: build with system libs

I've done this for linux & osx.

Regarding windows (mingw & msvc), it may be more tricky as:

@DavidKeller DavidKeller force-pushed the feature/opt-dependencies branch from 16ef205 to b0cd98c Compare April 13, 2022 13:20
CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Collaborator

@Enmk Enmk left a comment

Choose a reason for hiding this comment

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

Please fix the workflows, and it will be good to merge.

@DavidKeller DavidKeller force-pushed the feature/opt-dependencies branch from b0cd98c to 7fe1e84 Compare April 21, 2022 10:16
@DavidKeller
Copy link
Contributor Author

DavidKeller commented Apr 21, 2022

Gentlemen,

I've fought quite a bit in order to test dependencies across all platforms.
Installing each dependency using platform's package manager when available was getting more and more complex.

So I've switched to conan, as it eases dependencies management.

Pro

  • Having the clickhouse-client library within Conan Center would certainly ease adoption.
  • A build using LLVM's using libc++ (instead of libstdc++) has been added to the Linux matrix.

Con

I'm running out of time to solve these, but I'm pushing the current state to have your feeling on this work, I may resume later.

@DavidKeller DavidKeller force-pushed the feature/opt-dependencies branch from 7fe1e84 to d34cd97 Compare April 21, 2022 12:41
@Enmk
Copy link
Collaborator

Enmk commented May 3, 2022

I've fought quite a bit in order to test dependencies across all platforms. Installing each dependency using platform's package manager when available was getting more and more complex.

So I've switched to conan, as it eases dependencies management.

Ok, so could you please reduce the scope of this PR to just system-provided third-parties. I do believe that if it is hard to obtain a library on certain OS, then we can safely omit corresponding CI/CD job type. So you don't need to test system third-parties against all possible combinations, only for those that make sense.

Also, if possible, you may want to hard-code third-parties version installed to avoid accidental breakage in the future.

As for Conan: this is an interesting idea, but could we please move it to another PR?
(@DavidKeller ^^)

@Enmk
Copy link
Collaborator

Enmk commented Jul 22, 2022

@DavidKeller ping?

@DavidKeller
Copy link
Contributor Author

Hi, will try to split the MR and provide separate MR with conan by the end of the week.

@DavidKeller DavidKeller force-pushed the feature/opt-dependencies branch 9 times, most recently from edd6451 to 5cc154b Compare July 28, 2022 11:01
@DavidKeller DavidKeller force-pushed the feature/opt-dependencies branch 3 times, most recently from 5feafbc to eeeb4b9 Compare July 28, 2022 11:42
@DavidKeller
Copy link
Contributor Author

Here is the current state:

  • On OSX & Win, nothing has changed, the libary is still using the builtin dependencies.
  • On ubuntu-latest (aka ubuntu-20.04), nothing has changed as well.
  • A new ubuntun-22.04 build has been created, which uses the system abseil & lz4 and gcc.

Some remarks:

  1. It doesn't make sense to me to use system libraries with a different compiler (and libstdc++/libc++) than the one provided by the system, used to build these system libraries.
  2. Can't find a cityhash package (unmaintained since Ubuntu 13.0), but as cityhash is not a public dependency, I decided to rely on the builtin version, so the current build doesn't test the WITH_SYSTEM_CITYHASH switch :-(
    The alternative would be to build the cityhash package and install it locally prior the clickhouse build step.

What's your opinion on these remarks ?

Copy link
Collaborator

@Enmk Enmk left a comment

Choose a reason for hiding this comment

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

Hi @DavidKeller sorry for a late reply. Looks nice, could you please resolve the merge issues?

@DavidKeller DavidKeller force-pushed the feature/opt-dependencies branch from eeeb4b9 to 04abf44 Compare November 23, 2022 11:40
@DavidKeller
Copy link
Contributor Author

Rebased.

@xakod
Copy link
Contributor

xakod commented Dec 22, 2022

@Enmk sorry for ping. Are there any chances for this pr?

@Enmk
Copy link
Collaborator

Enmk commented Dec 28, 2022

@Enmk sorry for ping. Are there any chances for this pr?

Sure, just need to rebase and verify that it does what it advertizes.

@DavidKeller
Copy link
Contributor Author

@Enmk sorry for ping. Are there any chances for this pr?

Sure, just need to rebase and verify that it does what it advertizes.

We're no longer using clickhouse, so I'm afraid I won't spend more time rebasing it again.

@Jihadist, feel free to complete this MR.

I believe the power move here would be - once this get merged - to rely on conan to build everything and retrieve dependencies. See d34cd97

@xakod
Copy link
Contributor

xakod commented Dec 31, 2022

@DavidKeller thank you for this pr and for conanfile especially. I'll try to continue your ideas. Looks like we do not need to rebase it again because no one changed cmake files since last rebasing.

@Enmk
Copy link
Collaborator

Enmk commented Feb 1, 2023

Hi @DavidKeller ! Thank you for your contribution, I think this is a good start for proper Conan support for clickhouse-cpp. Sorry if the review process wasn't smooth for you

@xakod
Copy link
Contributor

xakod commented Feb 6, 2023

@Enmk this can be closed

@Enmk Enmk closed this Apr 17, 2023
@xakod xakod mentioned this pull request Apr 24, 2023
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.

Current setup with absl is dangerous relative import error
6 participants