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

Fix C++ client cannot be built with Boost <=1.53 #10307

Merged

Conversation

BewareMyPower
Copy link
Contributor

Motivation

CentOS 7 is a wide-used Linux system though its softwares of yum source are usually very old. The default Boost version is 1.53 on CentOS 7. However, currently C++ client cannot be built with Boost 1.53 or lower versions.

First, the boost::asio::ssl::context was constructed with a std::shared_ptr<io_service> as its first argument when the Boost version is < 1.54. However, it accepts a io_service& argument. This code error was not exposed because we use higher version Boost when cpp tests were performed.

Second, for Boost < 1.55, there's no boost/predef.h header. The header is used for detecting the byte order of OS and the architecture of CPU.

Modifications

  • Fix the wrong construction of boost::asio::ssl::context for Boost < 1.54
  • Use conditional macro to exclude the boost/predef.h and use boost/detail/endian.hpp to check byte order. As for the architecture, just use the common case.
  • Add a docker build to CI, which builds a docker image with dependencies based on CentOS 7 and build C++ client after it.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Add a CI to build C++ client on CentOS and dependencies from its default source.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)
  • The rest endpoints: (yes / no)
  • The admin cli options: (yes / no)
  • Anything that affects deployment: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@merlimat merlimat merged commit 2650a36 into apache:master Apr 21, 2021
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-boost-1.53-cpp-build branch April 22, 2021 00:02
@eolivelli
Copy link
Contributor

This patch cannot be ported to branch-2.7, as it requires CI changes.
CI changed a lot between 2.7 and 2.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants