From c3fae06e819ed8b93e31b150387dce4864758643 Mon Sep 17 00:00:00 2001 From: Vertexwahn Date: Sat, 13 Aug 2022 22:01:42 +0200 Subject: [PATCH] Bump Boost to version 1.80.0 (#258) --- .circleci/config.yml | 4 +- 0001-json-array-erase-relocate.patch | 49 ----------------------- BUILD => BUILD.bazel | 0 BUILD.boost | 58 ++++++++++++++++------------ WORKSPACE => WORKSPACE.bazel | 0 boost/boost.bzl | 7 ++-- src/{BUILD => BUILD.bazel} | 0 test/{BUILD => BUILD.bazel} | 1 + test/{WORKSPACE => WORKSPACE.bazel} | 0 9 files changed, 40 insertions(+), 79 deletions(-) delete mode 100644 0001-json-array-erase-relocate.patch rename BUILD => BUILD.bazel (100%) rename WORKSPACE => WORKSPACE.bazel (100%) rename src/{BUILD => BUILD.bazel} (100%) rename test/{BUILD => BUILD.bazel} (99%) rename test/{WORKSPACE => WORKSPACE.bazel} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index ccb81d061..41978aa2a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,7 +12,7 @@ jobs: - run: apt-get update && apt-get -y install pkg-config zip g++ zlib1g-dev unzip python curl ocl-icd-opencl-dev opencl-headers - run: cd /tmp/ && - curl -LO https://github.com/bazelbuild/bazel/releases/download/5.1.1/bazel-5.1.1-installer-linux-x86_64.sh && - bash /tmp/bazel-5.1.1-installer-linux-x86_64.sh + curl -LO https://github.com/bazelbuild/bazel/releases/download/5.2.0/bazel-5.2.0-installer-linux-x86_64.sh && + bash /tmp/bazel-5.2.0-installer-linux-x86_64.sh - run: cd test && cp .bazelrc.ci .bazelrc - run: cd test && bazel test --test_output=errors //... diff --git a/0001-json-array-erase-relocate.patch b/0001-json-array-erase-relocate.patch deleted file mode 100644 index d322b64f4..000000000 --- a/0001-json-array-erase-relocate.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff -ur boost/json/impl/array.ipp boost/json/impl/array.ipp ---- boost/json/impl/array.ipp 2022-04-06 17:02:43.000000000 -0400 -+++ boost/json/impl/array.ipp 2022-04-13 20:55:20.464359478 -0400 -@@ -491,8 +491,11 @@ - auto const p = &(*t_)[0] + - (pos - &(*t_)[0]); - destroy(p, p + 1); -- relocate(p, p + 1, 1); - --t_->size; -+ if(t_->size > 0) -+ relocate(p, p + 1, -+ t_->size - (p - -+ &(*t_)[0])); - return p; - } - -diff -ur libs/json/test/array.cpp libs/json/test/array.cpp ---- libs/json/test/array.cpp 2022-04-06 17:02:43.000000000 -0400 -+++ libs/json/test/array.cpp 2022-04-13 20:53:32.671782680 -0400 -@@ -1270,6 +1270,21 @@ - } - - void -+ testIssue692() -+ { -+ array a; -+ object obj; -+ obj["test1"] = "hello"; -+ a.push_back(obj); -+ a.push_back(obj); -+ a.push_back(obj); -+ a.push_back(obj); -+ a.push_back(obj); -+ while(a.size()) -+ a.erase(a.begin()); -+ } -+ -+ void - run() - { - testDestroy(); -@@ -1283,6 +1298,7 @@ - testExceptions(); - testEquality(); - testHash(); -+ testIssue692(); - } - }; - diff --git a/BUILD b/BUILD.bazel similarity index 100% rename from BUILD rename to BUILD.bazel diff --git a/BUILD.boost b/BUILD.boost index 012245c5f..3988a39ca 100644 --- a/BUILD.boost +++ b/BUILD.boost @@ -116,7 +116,7 @@ BOOST_CTX_ASM_SOURCES = selects.with_or({ "libs/context/src/asm/make_x86_64_sysv_elf_gas.S", "libs/context/src/asm/ontop_x86_64_sysv_elf_gas.S", ], - ("@platforms//os:osx", "@platforms//os:ios", "@platforms//os:watchos", "@platforms//os:tvos") : ["apple_ctx_asm_sources"], + ("@platforms//os:osx", "@platforms//os:ios", "@platforms//os:watchos", "@platforms//os:tvos"): ["apple_ctx_asm_sources"], ":windows_x86_64": [ "libs/context/src/asm/make_x86_64_ms_pe_masm.S", "libs/context/src/asm/jump_x86_64_ms_pe_masm.S", @@ -143,7 +143,7 @@ filegroup( "libs/context/src/asm/make_x86_64_sysv_macho_gas.S", "libs/context/src/asm/ontop_x86_64_sysv_macho_gas.S", ], - }) + }), ) boost_library( @@ -157,15 +157,15 @@ boost_library( ], "//conditions:default": [], }), - local_defines = select({ - ":windows_x86_64": ["BOOST_CONTEXT_EXPORT="], - "//conditions:default": [], - }), exclude_src = [ "libs/context/src/fiber.cpp", "libs/context/src/untested.cpp", "libs/context/src/continuation.cpp", ], + local_defines = select({ + ":windows_x86_64": ["BOOST_CONTEXT_EXPORT="], + "//conditions:default": [], + }), visibility = ["//visibility:public"], deps = [ ":assert", @@ -563,7 +563,7 @@ boost_library( # OpenCL (required for Boost.Compute) is deprecated on macOS and not supported on other Apple OSs. # This will at least produce the right error message, indicating that OpenCL is not present ("@platforms//os:osx", "@platforms//os:ios", "@platforms//os:watchos", "@platforms//os:tvos"): [ - "-framework OpenCL", + "-framework OpenCL", ], "//conditions:default": [ "-lOpenCL", @@ -821,7 +821,12 @@ boost_library( copts = _w_no_deprecated, defines = [ "BOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF", - ], + ] + select({ + "@platforms//os:linux": [ + "BOOST_FILESYSTEM_HAS_POSIX_AT_APIS", + ], + "//conditions:default": [], + }), deps = [ ":atomic", ":config", @@ -1141,35 +1146,35 @@ boost_library( BOOST_LOCALE_COMMON_SOURCES = glob( [ - "libs/locale/src/encoding/*.cpp", - "libs/locale/src/encoding/*.hpp", - "libs/locale/src/encoding/*.ipp", - "libs/locale/src/shared/*.cpp", - "libs/locale/src/shared/*.hpp", - "libs/locale/src/std/*.cpp", - "libs/locale/src/std/*.hpp", - "libs/locale/src/util/*.cpp", - "libs/locale/src/util/*.hpp", + "libs/locale/src/boost/locale/encoding/*.cpp", + "libs/locale/src/boost/locale/encoding/*.hpp", + "libs/locale/src/boost/locale/encoding/*.ipp", + "libs/locale/src/boost/locale/shared/*.cpp", + "libs/locale/src/boost/locale/shared/*.hpp", + "libs/locale/src/boost/locale/std/*.cpp", + "libs/locale/src/boost/locale/std/*.hpp", + "libs/locale/src/boost/locale/util/*.cpp", + "libs/locale/src/boost/locale/util/*.hpp", ], exclude = [ - "libs/locale/src/util/iconv.hpp", + "libs/locale/src/boost/locale/util/iconv.hpp", ], ) BOOST_LOCALE_STD_SOURCES = BOOST_LOCALE_COMMON_SOURCES + [ - "libs/locale/src/util/iconv.hpp", + "libs/locale/src/boost/locale/util/iconv.hpp", ] BOOST_LOCALE_POSIX_SOURCES = BOOST_LOCALE_COMMON_SOURCES + [ - "libs/locale/src/util/iconv.hpp", + "libs/locale/src/boost/locale/util/iconv.hpp", ] + glob([ - "libs/locale/src/posix/*.cpp", - "libs/locale/src/posix/*.hpp", + "libs/locale/src/boost/locale/posix/*.cpp", + "libs/locale/src/boost/locale/posix/*.hpp", ]) BOOST_LOCALE_WIN32_SOURCES = BOOST_LOCALE_COMMON_SOURCES + glob([ - "libs/locale/src/win32/*.cpp", - "libs/locale/src/win32/*.hpp", + "libs/locale/src/boost/locale/win32/*.cpp", + "libs/locale/src/boost/locale/win32/*.hpp", ]) BOST_LOCALE_STD_COPTS = [ @@ -1199,6 +1204,7 @@ boost_library( ("@platforms//os:linux", "@platforms//os:osx", "@platforms//os:ios", "@platforms//os:watchos", "@platforms//os:tvos"): BOOST_LOCALE_POSIX_COPTS, ":windows_x86_64": BOOST_LOCALE_WIN32_COPTS, }) + _w_no_deprecated, + includes = ["libs/locale/src/"], deps = [ ":assert", ":config", @@ -2093,6 +2099,9 @@ boost_library( boost_library( name = "unordered", + srcs = glob([ + "boost/unordered_map/**/*.hpp", + ]), hdrs = [ "boost/unordered_map.hpp", "boost/unordered_set.hpp", @@ -2106,6 +2115,7 @@ boost_library( ":iterator", ":limits", ":move", + ":mp11", ":preprocessor", ":smart_ptr", ":swap", diff --git a/WORKSPACE b/WORKSPACE.bazel similarity index 100% rename from WORKSPACE rename to WORKSPACE.bazel diff --git a/boost/boost.bzl b/boost/boost.bzl index ff1630fef..7bcad9133 100644 --- a/boost/boost.bzl +++ b/boost/boost.bzl @@ -209,13 +209,12 @@ def boost_deps(): http_archive, name = "boost", build_file = "@com_github_nelhage_rules_boost//:BUILD.boost", - patches = ["@com_github_nelhage_rules_boost//:0001-json-array-erase-relocate.patch"], patch_cmds = ["rm -f doc/pdf/BUILD"], patch_cmds_win = ["Remove-Item -Force doc/pdf/BUILD"], - sha256 = "273f1be93238a068aba4f9735a4a2b003019af067b9c183ed227780b8f36062c", - strip_prefix = "boost_1_79_0", + sha256 = "4b2136f98bdd1f5857f1c3dea9ac2018effe65286cf251534b6ae20cc45e1847", + strip_prefix = "boost_1_80_0", urls = [ - "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz", + "https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz", ], ) diff --git a/src/BUILD b/src/BUILD.bazel similarity index 100% rename from src/BUILD rename to src/BUILD.bazel diff --git a/test/BUILD b/test/BUILD.bazel similarity index 99% rename from test/BUILD rename to test/BUILD.bazel index e3560628e..01bedf4b6 100644 --- a/test/BUILD +++ b/test/BUILD.bazel @@ -221,6 +221,7 @@ cc_test( srcs = ["gil_test.cc"], deps = [ "@boost//:gil", + "@boost//:functional" ], ) diff --git a/test/WORKSPACE b/test/WORKSPACE.bazel similarity index 100% rename from test/WORKSPACE rename to test/WORKSPACE.bazel