diff --git a/CMakeLists.txt b/CMakeLists.txt index 629f0286b1a..59626058bbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -629,7 +629,7 @@ if(WITH_SYSTEM_BOOST) if(BOOST_ROOT AND CMAKE_LIBRARY_ARCHITECTURE) set(BOOST_LIBRARYDIR "${BOOST_ROOT}/lib/${CMAKE_LIBRARY_ARCHITECTURE}") endif() - find_package(Boost 1.73 COMPONENTS ${BOOST_COMPONENTS} REQUIRED) + find_package(Boost 1.79 COMPONENTS ${BOOST_COMPONENTS} REQUIRED) if(NOT ENABLE_SHARED) set_property(TARGET Boost::iostreams APPEND PROPERTY INTERFACE_LINK_LIBRARIES ZLIB::ZLIB) @@ -639,7 +639,7 @@ else() "max jobs for Boost build") # override w/-DBOOST_J= set(Boost_USE_STATIC_LIBS ON) include(BuildBoost) - build_boost(1.75 + build_boost(1.79 COMPONENTS ${BOOST_COMPONENTS} ${BOOST_HEADER_COMPONENTS}) endif() include_directories(BEFORE SYSTEM ${Boost_INCLUDE_DIRS}) diff --git a/cmake/modules/BuildBoost.cmake b/cmake/modules/BuildBoost.cmake index 5fdb6a38ef4..3ea725a8b7d 100644 --- a/cmake/modules/BuildBoost.cmake +++ b/cmake/modules/BuildBoost.cmake @@ -147,18 +147,17 @@ function(do_build_boost root_dir version) check_boost_version("${PROJECT_SOURCE_DIR}/src/boost" ${version}) set(source_dir SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/boost") - elseif(version VERSION_GREATER 1.75) + elseif(version VERSION_GREATER 1.79) 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.75.0) - set(boost_sha256 953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb) + set(boost_version 1.79.0) + set(boost_sha256 475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39) string(REPLACE "." "_" boost_version_underscore ${boost_version} ) string(JOIN " " boost_url https://boostorg.jfrog.io/artifactory/main/release/${boost_version}/source/boost_${boost_version_underscore}.tar.bz2 - https://downloads.sourceforge.net/project/boost/boost/${boost_version}/boost_${boost_version_underscore}.tar.bz2 https://download.ceph.com/qa/boost_${boost_version_underscore}.tar.bz2) set(source_dir URL ${boost_url} diff --git a/install-deps.sh b/install-deps.sh index 1302d2d3fe6..19a861e72e6 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -168,7 +168,7 @@ function install_pkg_on_ubuntu { function install_boost_on_ubuntu { in_jenkins && echo "CI_DEBUG: Running install_boost_on_ubuntu() in install-deps.sh" - local ver=1.75 + local ver=1.79 local installed_ver=$(apt -qq list --installed ceph-libboost*-dev 2>/dev/null | grep -e 'libboost[0-9].[0-9]\+-dev' | cut -d' ' -f2 | @@ -183,7 +183,7 @@ function install_boost_on_ubuntu { fi local codename=$1 local project=libboost - local sha1=7aba8a1882670522ee1d1ee1bba0ea170b292dec + local sha1=892ab89e76b91b505ffbf083f6fb7f2a666d4132 install_pkg_on_ubuntu \ $project \ $sha1 \ diff --git a/make-dist b/make-dist index ffb3b2f6085..2fe9c8d3e4a 100755 --- a/make-dist +++ b/make-dist @@ -51,7 +51,7 @@ download_from() { url_base=$1 shift if [ -z $url_base ]; then - echo "Error: failed to download $name." + echo "Error: failed to download $fname." exit fi url=$url_base/$fname @@ -59,7 +59,7 @@ download_from() { if [ $? != 0 -o ! -e $fname ]; then echo "Download of $url failed" elif [ $(sha256sum $fname | awk '{print $1}') != $sha256 ]; then - echo "Error: failed to download $name: SHA256 mismatch." + echo "Error: failed to download $fname: SHA256 mismatch." else break fi @@ -178,10 +178,9 @@ ln -s . $outfile tar cvf $outfile.version.tar $outfile/src/.git_version $outfile/ceph.spec # 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.75.0 -download_boost $boost_version 953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb \ +boost_version=1.79.0 +download_boost $boost_version 475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39 \ https://boostorg.jfrog.io/artifactory/main/release/$boost_version/source \ - https://downloads.sourceforge.net/project/boost/boost/$boost_version \ https://download.ceph.com/qa download_liburing 0.7 8e2842cfe947f3a443af301bdd6d034455536c38a455c7a700d0c1ad165a7543 \ https://github.com/axboe/liburing/archive \ diff --git a/src/common/async/bind_allocator.h b/src/common/async/bind_allocator.h deleted file mode 100644 index 0e4b82f4126..00000000000 --- a/src/common/async/bind_allocator.h +++ /dev/null @@ -1,244 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab - -#pragma once - -// Based on bind_executor.h from Boost.Asio which is Copyright (c) -// 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#include -#include -#include -#include - -#include "include/uses_allocator.h" - -namespace ceph::async { -namespace detail { -template -struct allocator_binder_check -{ - typedef void type; -}; - -// Helper to: -// - Apply the empty base optimization to the allocator. -// - Perform uses_allocator construction of the target type, if required. - -template -class allocator_binder_base; - -template -class allocator_binder_base - : protected Allocator -{ -protected: - template - allocator_binder_base(A&& a, U&& u) - : Allocator(std::forward(a), - target(ceph::make_obj_using_allocator(*this, - std::forward(u)))) {} - - T target; -}; - -template -class allocator_binder_base - : protected Allocator - -{ -protected: - template - allocator_binder_base(A&& a, U&& u) - : Allocator(std::forward(a)), - target(std::forward(u)) {} - - T target; -}; - -// Helper to enable SFINAE on zero-argument operator() below. - -template -struct allocator_binder_result_of0 -{ - using type = void; -}; - -template -struct allocator_binder_result_of0< - T, typename allocator_binder_check>::type> -{ - using type = typename std::result_of_t; -}; -} // namespace detail - -/// A call wrapper type to bind an allocator of type @c Allocator to -/// an object of type @c T. -template -class allocator_binder - : private detail::allocator_binder_base - ::value> -{ -public: - /// The type of the target object. - using target_type = T; - - /// The type of the associated allocator. - using allocator_type = Allocator; - - /// Construct an allocator wrapper for the specified object. - /** - * This constructor is only valid if the type @c T is constructible from type - * @c U. - */ - template - allocator_binder(std::allocator_arg_t, const allocator_type& a, - U&& u) - : base_type(a, std::forward(u)) {} - - /// Copy constructor. - allocator_binder(const allocator_binder& other) - : base_type(other.get_allocator(), other.get()) {} - - /// Construct a copy, but specify a different allocator. - allocator_binder(std::allocator_arg_t, const allocator_type& e, - const allocator_binder& other) - : base_type(e, other.get()) {} - - /// Construct a copy of a different allocator wrapper type. - /** - * This constructor is only valid if the @c Allocator type is - * constructible from type @c OtherAllocator, and the type @c T is - * constructible from type @c U. - */ - template - allocator_binder(const allocator_binder& other) - : base_type(other.get_allocator(), other.get()) {} - - /// Construct a copy of a different allocator wrapper type, but specify a - /// different allocator. - /** - * This constructor is only valid if the type @c T is constructible from type - * @c U. - */ - template - allocator_binder(std::allocator_arg_t, const allocator_type& a, - const allocator_binder& other) - : base_type(a, other.get()) {} - - /// Move constructor. - allocator_binder(allocator_binder&& other) - : base_type(std::move(other.get_allocator()), - std::move(other.get())) {} - - /// Move construct the target object, but specify a different allocator. - allocator_binder(std::allocator_arg_t, const allocator_type& e, - allocator_binder&& other) - : base_type(e, std::move(other.get())) {} - - /// Move construct from a different allocator wrapper type. - template - allocator_binder(allocator_binder&& other) - : base_type(std::move(other.get_allocator()), std::move(other.get())) {} - - /// Move construct from a different allocator wrapper type, but specify a - /// different allocator. - template - allocator_binder(std::allocator_arg_t, const allocator_type& a, - allocator_binder&& other) - : base_type(a, std::move(other.get())) {} - - /// Destructor. - ~allocator_binder() = default; - - /// Obtain a reference to the target object. - target_type& get() noexcept - { - return this->target; - } - - /// Obtain a reference to the target object. - const target_type& get() const noexcept - { - return this->target; - } - - /// Obtain the associated allocator. - allocator_type get_allocator() const noexcept { - return static_cast(*this); - } - - /// Forwarding function call operator. - template - decltype(auto) operator()(Args&&... args) { - return this->target(std::forward(args)...); - } - - /// Forwarding function call operator. - template - decltype(auto) operator()(Args&&... args) const { - return this->target(std::forward(args)...); - } - - -private: - using base_type = - detail::allocator_binder_base>; -}; - -/// Associate an object of type @c T with an allocator of type @c Allocator. -template -inline allocator_binder, Allocator> -bind_allocator(const Allocator& a, T&& t) -{ - return allocator_binder, Allocator>(std::allocator_arg_t(), - a, std::forward(t)); -} -} // namespace ceph::async - -// Since we have an allocator_type member we shouldn't need a -// uses_allocator specialization. - -namespace boost::asio { -template -class async_result, Signature> -{ -public: - using completion_handler_type = - ceph::async::allocator_binder< - typename async_result::completion_handler_type, Allocator>; - - using return_type = typename async_result::return_type; - - explicit async_result(ceph::async::allocator_binder& b) - : target(b.get()) {} - - return_type get() { - return target.get(); - } - -private: - async_result(const async_result&) = delete; - async_result& operator=(const async_result&) = delete; - - async_result target; -}; - -template -struct associated_executor, - Executor> -{ - using type = typename associated_executor::type; - - static type get(const ceph::async::allocator_binder& b, - Executor ex = {}) noexcept { - return get_associated_executor(b.get(), ex); - } -}; -} // namespace boost::asio diff --git a/src/common/async/bind_like.h b/src/common/async/bind_like.h index a7fdbb869c9..c360eac0aad 100644 --- a/src/common/async/bind_like.h +++ b/src/common/async/bind_like.h @@ -15,10 +15,9 @@ #include #include +#include #include -#include "common/async/bind_allocator.h" - namespace ceph::async { template auto bind_ea(const Executor& executor, const Allocator& allocator, diff --git a/win32_deps_build.sh b/win32_deps_build.sh index 19e7b02db3d..dbcbc1dba5c 100755 --- a/win32_deps_build.sh +++ b/win32_deps_build.sh @@ -24,8 +24,8 @@ curlSrcDir="${depsSrcDir}/curl" curlDir="${depsToolsetDir}/curl" # For now, we'll keep the version number within the file path when not using git. -boostUrl="https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz" -boostSrcDir="${depsSrcDir}/boost_1_75_0" +boostUrl="https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz" +boostSrcDir="${depsSrcDir}/boost_1_79_0" boostDir="${depsToolsetDir}/boost" zlibDir="${depsToolsetDir}/zlib" zlibSrcDir="${depsSrcDir}/zlib"