summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-08-15 18:03:45 +0100
committerSam James <sam@gentoo.org>2022-08-15 18:08:31 +0100
commite7152c19b5530badc728b6b303a4140814ae2d7c (patch)
treeb6f520713a6448285db0c5d9546c4800a0f5bb8f /dev-cpp/folly
parenttoolchain.eclass: extend GCC 12 workaround for older GCCs (diff)
downloadgentoo-e7152c19b5530badc728b6b303a4140814ae2d7c.tar.gz
gentoo-e7152c19b5530badc728b6b303a4140814ae2d7c.tar.bz2
gentoo-e7152c19b5530badc728b6b303a4140814ae2d7c.zip
dev-cpp/folly: add 2022.08.15.00
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-cpp/folly')
-rw-r--r--dev-cpp/folly/Manifest1
-rw-r--r--dev-cpp/folly/files/folly-2022.08.15.00-liburing-headers.patch102
-rw-r--r--dev-cpp/folly/folly-2022.08.15.00.ebuild99
3 files changed, 202 insertions, 0 deletions
diff --git a/dev-cpp/folly/Manifest b/dev-cpp/folly/Manifest
index 23c3b4d7dca4..94ae8e64d336 100644
--- a/dev-cpp/folly/Manifest
+++ b/dev-cpp/folly/Manifest
@@ -2,3 +2,4 @@ DIST folly-2022.03.28.00.tar.gz 3616507 BLAKE2B da003701abe599f20ac87a2785fe9a4c
DIST folly-2022.04.11.00.tar.gz 3632587 BLAKE2B 13820f6dc600727fa97603181be97a568cc8b3c713659717592853827dac050d5f1f6d98178e3054871233b48ac18f713589bf43b36ea29445cad557ce13bacf SHA512 7aa0be95d6f8b21aaa88558cf5921c526ab5a8c8121b858eb6e7ea19946d7a82dff06d90b7a365cef5c56a43d8d57af8d01b8b11b27262fbed9ee8c9e701b5ac
DIST folly-v2022.07.04.00.tar.gz 3647988 BLAKE2B ab8916ff4be1468d44dc0892126448682554ea95ce879166f457b621c3157cb22d0292fe2c58744494efe0fbabbf77732184335cd22244724c740910cf3a8303 SHA512 11fc32768539d8d42c7396eeac522238450617c8dde302b45c64bb93fd6ceaef7bb193b897802962782e8211c3931d31bf8df68e06741ce855d9725510677d7a
DIST folly-v2022.08.08.00.tar.gz 3684846 BLAKE2B 462c183effea452ca706a7a14ebba820f377bc5ba6fd1475b15ca10e3c21df60a16b529b6599cf5dd5df2913b1fbd0432a3c411ab0aa400a9c84bb6aecd2f70f SHA512 f44dbf96f42a86d44cad46129750ae2bc0abb6702e148de10def4b241a3c7afa62ad19acca96609e8a9bfdfeeb7eda3f19d8eb161b5e41702c943ca87a75c88e
+DIST folly-v2022.08.15.00.tar.gz 3691439 BLAKE2B 96ba34a18b51ea91aacd2bbcdbfef855a8924004850534ef342799d1c36d6ece04b77100b8901053fd3d0a997d1764ffdfd5bcd60928b4a4f8c9480f5a6d8ee6 SHA512 72d8d29a1f26f5af33d13e1d2f7ed5ce439bc7345daecc3ed1d30e33b802e0aa4f1ca59fae16db25079e55da14f60cd6a548f0f31eef48abad49b71baa6e6307
diff --git a/dev-cpp/folly/files/folly-2022.08.15.00-liburing-headers.patch b/dev-cpp/folly/files/folly-2022.08.15.00-liburing-headers.patch
new file mode 100644
index 000000000000..f485ee2175fc
--- /dev/null
+++ b/dev-cpp/folly/files/folly-2022.08.15.00-liburing-headers.patch
@@ -0,0 +1,102 @@
+Fix build w/ older kernel headers.
+
+https://github.com/facebook/folly/commit/ae20efa9fa8cea81079df519d93dcbd1523c8dc3
+
+From ae20efa9fa8cea81079df519d93dcbd1523c8dc3 Mon Sep 17 00:00:00 2001
+From: Dylan Yudaken <dylany@fb.com>
+Date: Mon, 15 Aug 2022 08:32:53 -0700
+Subject: [PATCH] io_uring: support older versions of liburing
+
+Summary: Some #if to support older versions of liburing as reported here; https://github.com/facebook/folly/issues/1832
+
+Reviewed By: Orvid
+
+Differential Revision: D38650359
+
+fbshipit-source-id: eb78a7607eaaf151dc394cef72df3826c83fdfbc
+--- a/folly/experimental/io/IoUringBackend.cpp
++++ b/folly/experimental/io/IoUringBackend.cpp
+@@ -40,6 +40,16 @@ extern "C" FOLLY_ATTR_WEAK void eb_poll_loop_pre_hook(uint64_t* call_time);
+ extern "C" FOLLY_ATTR_WEAK void eb_poll_loop_post_hook(
+ uint64_t call_time, int ret);
+
++// there is no builtin macro we can use in liburing to tell what version we are
++// on or if features are supported. We will try and get this into the next
++// release but for now in the latest release there was also added multishot
++// accept - and so we can use it's pressence to suggest that we can safely use
++// newer features
++#if defined(IORING_ACCEPT_MULTISHOT)
++#define FOLLY_IO_URING_UP_TO_DATE 1
++#else
++#define FOLLY_IO_URING_UP_TO_DATE 0
++#endif
+ namespace folly {
+
+ namespace {
+@@ -296,11 +306,7 @@ std::chrono::time_point<std::chrono::steady_clock> getTimerExpireTime(
+ return now + us;
+ }
+
+-// there is no builtin macro we can use in liburing to tell if buffer rings are
+-// supported. However in the release that added them, there was also added
+-// multishot accept - and so we can use it's pressence to suggest that we can
+-// safely use provided buffer rings
+-#if defined(IORING_ACCEPT_MULTISHOT)
++#if FOLLY_IO_URING_UP_TO_DATE
+
+ class ProvidedBuffersBuffer {
+ public:
+@@ -738,7 +744,11 @@ IoUringBackend::IoUringBackend(Options options)
+ params_.flags |= IORING_SETUP_CQSIZE;
+ params_.cq_entries = options.capacity;
+ if (options_.taskRunCoop) {
++#if FOLLY_IO_URING_UP_TO_DATE
+ params_.flags |= IORING_SETUP_COOP_TASKRUN;
++#else
++ // this has no functional change so just leave it
++#endif
+ }
+
+ // poll SQ options
+@@ -1237,9 +1247,12 @@ int IoUringBackend::eb_event_base_loop(int flags) {
+ }
+
+ if (options_.registerRingFd) {
++ // registering just has some perf impact, so no need to fall back
++#if FOLLY_IO_URING_UP_TO_DATE
+ if (io_uring_register_ring_fd(&ioRing_) < 0) {
+ LOG(ERROR) << "unable to register io_uring ring fd";
+ }
++#endif
+ }
+ }
+
+@@ -1496,9 +1509,11 @@ void IoUringBackend::cancel(IoSqeBase* ioSqe) {
+ auto* sqe = get_sqe();
+ io_uring_prep_cancel64(sqe, (uint64_t)ioSqe, 0);
+ io_uring_sqe_set_data(sqe, (void*)&ioSqeNop); // just need something unique
++#if FOLLY_IO_URING_UP_TO_DATE
+ if (params_.features & IORING_FEAT_CQE_SKIP) {
+ sqe->flags |= IOSQE_CQE_SKIP_SUCCESS;
+ }
++#endif
+ }
+
+ int IoUringBackend::cancelOne(IoSqe* ioSqe) {
+@@ -1848,9 +1863,15 @@ void IoUringBackend::processFileOp(IoSqe* sqe, int64_t res) noexcept {
+ }
+
+ bool IoUringBackend::kernelHasNonBlockWriteFixes() const {
++#if FOLLY_IO_URING_UP_TO_DATE
+ // this was fixed in 5.18, which introduced linked file
+ // fixed in "io_uring: only wake when the correct events are set"
+ return params_.features & IORING_FEAT_LINKED_FILE;
++#else
++ // this indicates that sockets have to manually remove O_NONBLOCK
++ // which is a bit slower but shouldnt cause any functional changes
++ return false;
++#endif
+ }
+
+ namespace {
+
diff --git a/dev-cpp/folly/folly-2022.08.15.00.ebuild b/dev-cpp/folly/folly-2022.08.15.00.ebuild
new file mode 100644
index 000000000000..573667cf38a4
--- /dev/null
+++ b/dev-cpp/folly/folly-2022.08.15.00.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# These must be bumped together:
+# dev-cpp/edencommon
+# dev-cpp/folly
+# dev-util/watchman
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="An open-source C++ library developed and used at Facebook"
+HOMEPAGE="https://github.com/facebook/folly"
+SRC_URI="https://github.com/facebook/folly/releases/download/v${PV}/${PN}-v${PV}.tar.gz"
+S="${WORKDIR}"
+
+LICENSE="Apache-2.0"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="llvm-libunwind test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="app-arch/bzip2
+ app-arch/lz4:=
+ app-arch/snappy:=
+ app-arch/xz-utils
+ app-arch/zstd:=
+ dev-cpp/gflags:=
+ dev-cpp/glog:=[gflags]
+ dev-libs/boost:=[context,threads(+)]
+ dev-libs/double-conversion:=
+ dev-libs/libaio
+ dev-libs/libevent:=
+ dev-libs/libfmt:=
+ dev-libs/libsodium:=
+ dev-libs/openssl:=
+ sys-libs/liburing:=
+ sys-libs/zlib
+ llvm-libunwind? ( sys-libs/llvm-libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )"
+# libiberty is linked statically
+DEPEND="${RDEPEND}
+ sys-libs/binutils-libs
+ test? ( dev-cpp/gtest )"
+BDEPEND="test? ( sys-devel/clang )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2022.07.04.00-musl-fix.patch
+ "${FILESDIR}"/${P}-liburing-headers.patch
+)
+
+pkg_setup() {
+ [[ ${BUILD_TYPE} == binary ]] && return
+
+ if use test && ! tc-is-clang ; then
+ # Always build w/ Clang for now to avoid gcc ICE
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106230
+ #if [[ $(gcc-major-version) -eq 12 ]] ; then
+ # return
+ #fi
+
+ ## Only older GCC 11 is broken
+ #if [[ $(gcc-major-version) -eq 11 && $(gcc-minor-version) -ge 3 && $(gcc-micro-version) -ge 1 ]] ; then
+ # return
+ #fi
+
+ ewarn "Forcing build with Clang due to GCC bug (because tests are enabled)"
+ #ewarn "(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008)"
+
+ export CC=${CHOST}-clang
+ export CXX=${CHOST}-clang++
+ fi
+}
+
+src_configure() {
+ # TODO: liburing could in theory be optional but fails to link
+
+ local mycmakeargs=(
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+
+ -DBUILD_TESTS=$(usex test)
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ local myctestargs=(
+ # - timeseries_histogram_test.TimeseriesHistogram.Percentile|HHWheelTimerTest
+ # Long-standing known test failure
+ # TODO: report upstream
+ # - HHWheelTimerTest.HHWheelTimerTest.CancelTimeout
+ # Timeouts are fragile
+ -E "(timeseries_histogram_test.TimeseriesHistogram.Percentile|HHWheelTimerTest.HHWheelTimerTest.CancelTimeout)"
+ )
+
+ cmake_src_test
+}