]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
build: Bump Boost version to 1.79 46554/head
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 7 Mar 2022 22:14:50 +0000 (17:14 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 22 Jul 2022 15:04:43 +0000 (11:04 -0400)
Also remove bind_allocator, as Boost.Asio now provides this function.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
CMakeLists.txt
cmake/modules/BuildBoost.cmake
install-deps.sh
make-dist
src/common/async/bind_allocator.h [deleted file]
src/common/async/bind_like.h
win32_deps_build.sh

index 629f0286b1a8345ec03f4e407ad8b3eefa295905..59626058bbb4c54eaebe0d89b966fde1089e764b 100644 (file)
@@ -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=<n>
   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})
index 5fdb6a38ef4cf78ffbfc53ca71c6eb92bb1441d0..3ea725a8b7d94ed173e510246b2f77039076ea3f 100644 (file)
@@ -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}
index 1302d2d3fe6f0c960fd998ed5153150b7725c3ff..19a861e72e6146373964900ebc327eed9ea4073e 100755 (executable)
@@ -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 \
index ffb3b2f60852a07ad7d10151c1e720756683108a..2fe9c8d3e4a0a7e8bd91812caf97b7feb139b1b3 100755 (executable)
--- 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 (file)
index 0e4b82f..0000000
+++ /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 <boost/asio/associated_executor.hpp>
-#include <boost/asio/associated_allocator.hpp>
-#include <boost/asio/async_result.hpp>
-#include <boost/asio/execution_context.hpp>
-
-#include "include/uses_allocator.h"
-
-namespace ceph::async {
-namespace detail {
-template<typename T>
-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<typename T, typename Allocator, bool UsesAllocator>
-class allocator_binder_base;
-
-template<typename T, typename Allocator>
-class allocator_binder_base<T, Allocator, true>
-  : protected Allocator
-{
-protected:
-  template<typename A, typename U>
-  allocator_binder_base(A&& a, U&& u)
-    : Allocator(std::forward<A>(a),
-               target(ceph::make_obj_using_allocator(*this,
-                                                     std::forward<U>(u)))) {}
-
-  T target;
-};
-
-template <typename T, typename Allocator>
-class allocator_binder_base<T, Allocator, false>
-  : protected Allocator
-
-{
-protected:
-  template<typename A, typename U>
-  allocator_binder_base(A&& a, U&& u)
-    : Allocator(std::forward<A>(a)),
-      target(std::forward<U>(u)) {}
-
-  T target;
-};
-
-// Helper to enable SFINAE on zero-argument operator() below.
-
-template<typename T, typename = void>
-struct allocator_binder_result_of0
-{
-  using type = void;
-};
-
-template<typename T>
-struct allocator_binder_result_of0<
-  T, typename allocator_binder_check<std::result_of_t<T()>>::type>
-{
-  using type = typename std::result_of_t<T()>;
-};
-} // namespace detail
-
-/// A call wrapper type to bind an allocator of type @c Allocator to
-/// an object of type @c T.
-template<typename T, typename Allocator>
-class allocator_binder
-  : private detail::allocator_binder_base<T, Allocator,
-                                         std::uses_allocator<T, Allocator>
-                                         ::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<typename U>
-  allocator_binder(std::allocator_arg_t, const allocator_type& a,
-                  U&& u)
-    : base_type(a, std::forward<U>(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<typename U, typename OtherAllocator>
-  allocator_binder(const allocator_binder<U, OtherAllocator>& 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<typename U, typename OtherAllocator>
-  allocator_binder(std::allocator_arg_t, const allocator_type& a,
-                  const allocator_binder<U, OtherAllocator>& 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<typename U, typename OtherAllocator>
-  allocator_binder(allocator_binder<U, OtherAllocator>&& 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<typename U, typename OtherAllocator>
-  allocator_binder(std::allocator_arg_t, const allocator_type& a,
-                  allocator_binder<U, OtherAllocator>&& 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<const Allocator&>(*this);
-  }
-
-  /// Forwarding function call operator.
-  template<typename... Args>
-  decltype(auto) operator()(Args&&... args) {
-    return this->target(std::forward<Args>(args)...);
-  }
-
-  /// Forwarding function call operator.
-  template<typename... Args>
-  decltype(auto) operator()(Args&&... args) const {
-    return this->target(std::forward<Args>(args)...);
-  }
-
-
-private:
-  using base_type =
-    detail::allocator_binder_base<T, Allocator,
-                                 std::uses_allocator_v<T, Allocator>>;
-};
-
-/// Associate an object of type @c T with an allocator of type @c Allocator.
-template<typename Allocator, typename T>
-inline allocator_binder<typename std::decay_t<T>, Allocator>
-bind_allocator(const Allocator& a, T&& t)
-{
-  return allocator_binder<std::decay_t<T>, Allocator>(std::allocator_arg_t(),
-                                                     a, std::forward<T>(t));
-}
-} // namespace ceph::async
-
-// Since we have an allocator_type member we shouldn't need a
-// uses_allocator specialization.
-
-namespace boost::asio {
-template<typename T, typename Allocator, typename Signature>
-class async_result<ceph::async::allocator_binder<T, Allocator>, Signature>
-{
-public:
-  using completion_handler_type =
-    ceph::async::allocator_binder<
-  typename async_result<T, Signature>::completion_handler_type, Allocator>;
-
-  using return_type = typename async_result<T, Signature>::return_type;
-
-  explicit async_result(ceph::async::allocator_binder<T, Allocator>& 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<T, Signature> target;
-};
-
-template<typename T, typename Allocator, typename Executor>
-struct associated_executor<ceph::async::allocator_binder<T, Allocator>,
-                          Executor>
-{
-  using type = typename associated_executor<T, Executor>::type;
-
-  static type get(const ceph::async::allocator_binder<T, Allocator>& b,
-                 Executor ex = {}) noexcept {
-    return get_associated_executor(b.get(), ex);
-  }
-};
-} // namespace boost::asio
index a7fdbb869c9e62ad8fc5493165db8b9d2ea4ca66..c360eac0aad8b8a0a3077354749136a11972489b 100644 (file)
 
 #include <boost/asio/associated_allocator.hpp>
 #include <boost/asio/associated_executor.hpp>
+#include <boost/asio/bind_allocator.hpp>
 #include <boost/asio/bind_executor.hpp>
 
-#include "common/async/bind_allocator.h"
-
 namespace ceph::async {
 template<typename Executor, typename Allocator, typename Completion>
 auto bind_ea(const Executor& executor, const Allocator& allocator,
index 19e7b02db3d278707bf421d38e101ebd60d3b2a9..dbcbc1dba5c615e8c7cd57e61199cc4dfbc84a5a 100755 (executable)
@@ -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"