Skip to content

Commit

Permalink
Merge pull request #19808 from cbodley/wip-boost-1.66
Browse files Browse the repository at this point in the history
cmake: update minimum boost version to 1.66

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
tchaikov committed Jan 6, 2018
2 parents d1ec523 + b589b73 commit 077351f
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Expand Up @@ -37,9 +37,6 @@
url = https://github.com/ceph/lua.git
branch = lua-5.3-ceph
ignore = dirty
[submodule "src/Beast"]
path = src/Beast
url = https://github.com/ceph/Beast.git
[submodule "src/dpdk"]
path = src/dpdk
url = https://github.com/ceph/dpdk
Expand Down
16 changes: 14 additions & 2 deletions CMakeLists.txt
Expand Up @@ -390,6 +390,11 @@ if(WITH_BLKIN)
include_directories(SYSTEM src/blkin/blkin-lib)
endif(WITH_BLKIN)

option(WITH_BOOST_CONTEXT "Enable boost::asio stackful coroutines" ON)
if(WITH_BOOST_CONTEXT)
set(HAVE_BOOST_CONTEXT ON)
endif()

#option for RGW
option(WITH_RADOSGW "Rados Gateway is enabled" ON)
option(WITH_RADOSGW_FCGI_FRONTEND "Rados Gateway's FCGI frontend is enabled" OFF)
Expand All @@ -399,6 +404,10 @@ if(WITH_RADOSGW)
if(WITH_RADOSGW_FCGI_FRONTEND)
find_package(fcgi REQUIRED)
endif()
if(WITH_RADOSGW_BEAST_FRONTEND AND NOT WITH_BOOST_CONTEXT)
message(WARNING "disabling WITH_RADOSGW_BEAST_FRONTEND, which depends on WITH_BOOST_CONTEXT")
set(WITH_RADOSGW_BEAST_FRONTEND OFF)
endif()
endif(WITH_RADOSGW)


Expand Down Expand Up @@ -570,6 +579,9 @@ set(BOOST_HEADER_COMPONENTS container)
if(WITH_MGR)
list(APPEND BOOST_COMPONENTS python)
endif()
if(WITH_BOOST_CONTEXT)
list(APPEND BOOST_COMPONENTS context coroutine)
endif()

set(Boost_USE_MULTITHREADED ON)
# require minimally the bundled version
Expand All @@ -579,13 +591,13 @@ if(WITH_SYSTEM_BOOST)
else()
set(Boost_USE_STATIC_LIBS ON)
endif()
find_package(Boost 1.61 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
find_package(Boost 1.66 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
else()
set(BOOST_J 1 CACHE STRING
"max jobs for Boost build") # override w/-DBOOST_J=<n>
set(Boost_USE_STATIC_LIBS ON)
include(BuildBoost)
build_boost(1.63
build_boost(1.66
COMPONENTS ${BOOST_COMPONENTS} ${BOOST_HEADER_COMPONENTS})
include_directories(BEFORE SYSTEM ${Boost_INCLUDE_DIRS})
endif()
Expand Down
4 changes: 2 additions & 2 deletions ceph.spec.in
Expand Up @@ -862,9 +862,9 @@ cmake .. \
-DWITH_OCF=ON \
%endif
%ifarch aarch64 armv7hl mips mipsel ppc ppc64 ppc64le %{ix86} x86_64
-DWITH_RADOSGW_BEAST_FRONTEND=ON \
-DWITH_BOOST_CONTEXT=ON \
%else
-DWITH_RADOSGW_BEAST_FRONTEND=OFF \
-DWITH_BOOST_CONTEXT=OFF \
%endif
-DBOOST_J=%{_smp_ncpus}

Expand Down
6 changes: 3 additions & 3 deletions cmake/modules/BuildBoost.cmake
Expand Up @@ -79,14 +79,14 @@ function(do_build_boost version)
message(STATUS "boost already in src")
set(source_dir
SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/boost")
elseif(version VERSION_GREATER 1.63)
elseif(version VERSION_GREATER 1.66)
message(FATAL_ERROR "Unknown BOOST_REQUESTED_VERSION: ${version}")
else()
message(STATUS "boost will be downloaded...")
# NOTE: If you change this version number make sure the package is available
# at the three URLs below (may involve uploading to download.ceph.com)
set(boost_version 1.63.0)
set(boost_md5 1c837ecd990bb022d07e7aab32b09847)
set(boost_version 1.66.0)
set(boost_md5 b2dfbd6c717be4a7bb2d88018eaccf75)
string(REPLACE "." "_" boost_version_underscore ${boost_version} )
set(boost_url
https://dl.bintray.com/boostorg/release/${boost_version}/source/boost_${boost_version_underscore}.tar.bz2)
Expand Down
6 changes: 3 additions & 3 deletions debian/rules
Expand Up @@ -17,10 +17,10 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

ifneq (,$(filter $(DEB_HOST_ARCH), arm armel armhf arm64 i386 amd64 mips mipsel powerpc ppc64))
# beast depends on libboost_context which only support the archs above
extraopts += -DWITH_RADOSGW_BEAST_FRONTEND=ON
# libboost_context only support the archs above
extraopts += -DWITH_BOOST_CONTEXT=ON
else
extraopts += -DWITH_RADOSGW_BEAST_FRONTEND=OFF
extraopts += -DWITH_BOOST_CONTEXT=OFF
endif

%:
Expand Down
4 changes: 2 additions & 2 deletions make-dist
Expand Up @@ -100,8 +100,8 @@ ln -s . $outfile
tar cvf $outfile.version.tar $outfile/src/.git_version $outfile/ceph.spec $outfile/alpine/APKBUILD
# NOTE: If you change this version number make sure the package is available
# at the three URLs referenced below (may involve uploading to download.ceph.com)
boost_version=1.63.0
download_boost $boost_version 1c837ecd990bb022d07e7aab32b09847 \
boost_version=1.66.0
download_boost $boost_version b2dfbd6c717be4a7bb2d88018eaccf75 \
https://dl.bintray.com/boostorg/release/$boost_version/source \
https://downloads.sourceforge.net/project/boost/boost/$boost_version \
https://download.ceph.com/qa
Expand Down
1 change: 0 additions & 1 deletion src/Beast
Submodule Beast deleted from 3fbbf2
3 changes: 3 additions & 0 deletions src/include/config-h.in.cmake
Expand Up @@ -330,4 +330,7 @@
/* Defined if getentropy() is available */
#cmakedefine HAVE_GETENTROPY

/* Defined if boost::context is available */
#cmakedefine HAVE_BOOST_CONTEXT

#endif /* CONFIG_H */
1 change: 0 additions & 1 deletion src/rgw/CMakeLists.txt
Expand Up @@ -143,7 +143,6 @@ add_library(rgw_a STATIC ${rgw_a_srcs})
add_dependencies(rgw_a civetweb_h)

target_include_directories(rgw_a SYSTEM PUBLIC
"../Beast/include"
${FCGI_INCLUDE_DIR}
"../rapidjson/include"
)
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_asio_client.cc
Expand Up @@ -171,7 +171,7 @@ size_t ClientIO::complete_header()
sent += txbuf.sputn(timestr, strlen(timestr));
}

if (parser.is_keep_alive()) {
if (parser.keep_alive()) {
constexpr char CONN_KEEP_ALIVE[] = "Connection: Keep-Alive\r\n";
sent += txbuf.sputn(CONN_KEEP_ALIVE, sizeof(CONN_KEEP_ALIVE) - 1);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/rgw/rgw_asio_frontend.cc
Expand Up @@ -64,7 +64,7 @@ namespace beast = boost::beast;

class Connection {
RGWProcessEnv& env;
boost::asio::strand strand;
boost::asio::io_service::strand strand;
tcp::socket socket;

// references are bound to callbacks for async operations. if a callback
Expand Down Expand Up @@ -169,7 +169,7 @@ class Connection {
process_request(env.store, env.rest, &req, env.uri_prefix,
*env.auth_registry, &client, env.olog);

if (parser->is_keep_alive()) {
if (parser->keep_alive()) {
// parse any unread bytes from the previous message (in case we replied
// before reading the entire body) before reading the next
discard_unread_message();
Expand Down

0 comments on commit 077351f

Please sign in to comment.