From nobody Sun Feb 26 08:58:34 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPcx66qm1z3t5fv; Sun, 26 Feb 2023 08:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PPcx66L1Kz4KDh; Sun, 26 Feb 2023 08:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677401914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q3OEukUrI/I3uYn8MUSNZWEwJ3SPqTDaznRR76oxXHU=; b=nCPevT6Z2csq3TxZSjU4BnfxHhbF/v7rck7lsGhWE4osD56ofjJBT681aLrpPhU8byzjU/ FzMAzsv7NwLtuI6PVQY8u3J3DvZ1fl6cP9pzghns9oOCUTcmUfBwYRt9p2AwMXDCdo2BRR Lgy880oRD7ObPjSVMLiEMNykdZJqs/BcZr7fa4XsBW3H+7P5ryyZxUvtwYXDIYMYU7MBj7 mUUg3rxSrB/Nb9ESCuY9WWpB+vnKZ/OLnnT2B6R7aBxi/7PGlZSKM35+M/N2UKqgl5PlW/ G+ca2n2om6KfD9YEKMzg4/nLEQ/kPZaEje9oqBobxkTSLNi83kBYdTqnl+aOnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677401914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=q3OEukUrI/I3uYn8MUSNZWEwJ3SPqTDaznRR76oxXHU=; b=iQlc2M8LIP18jHFa/t15gzmsNPQ4oFc7Rrj8rmCLr8tVyelYu01XQu98qHdDI0q3Vf8xnx BZIyoiax3f2lQCgEidynSreuJSuMGuQzbhOFqvzotMOj1auZ1aIqAiB6VI7D1WM/EeVd7F AmO9LaKABarupr6BmQzctoTgLTwIfR27Z86aCYYcGZZEPtlwqkX3+Lt0GMHxDlvD3UP0me YN1MBcBk3/3OsLcFiZYjQLadYCs2f9iuCxTiAC6xNO8C3xO8aOW7FAXea92PMJs/D6DdqU oo89bcEEGQG3UzJtMsFYpOy8R1WCzwG7nx6569JU35OhwyGeC3JB7LeDZTGgRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677401914; a=rsa-sha256; cv=none; b=LLFLNMGTZe+41aGWWDcQnZCwcDlsW8p02TWXky9jSqwYcdfK1PhauvmGorWuYXOATJ+Ccd xZeTFhqJvflf3q241oAwfANmfiACR0zEz7OJycSjtHjTdllVinSre77k+qAi141ap39/G0 +99Yb46+c9TdTMLA3YeH2QSbXuJ7XCdOAoCbg7RyQ0qmal0Y9/C3SyE9t3jtA5IPyA+GVj e9KTRwkWmsvXf+z1E6XVruzdodXQdleT/aW7pyu3J/poY5xtfil8j5JMXykkmGu9Ahj7a9 uGKSMIh76dbPuNRHUMzP+DXg8bpHbz6vaHL1mgvEaR7jN1wgS6PoPWUdLw5VGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPcx65R1QzfTw; Sun, 26 Feb 2023 08:58:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31Q8wYrw050535; Sun, 26 Feb 2023 08:58:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31Q8wYV7050534; Sun, 26 Feb 2023 08:58:34 GMT (envelope-from git) Date: Sun, 26 Feb 2023 08:58:34 GMT Message-Id: <202302260858.31Q8wYV7050534@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Eugene Grosbein Subject: git: d06e12de9aec - main - databases/xtrabackup8: update to version 8.0.31-24 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d06e12de9aeccfddb388561466ef833a2906d39e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/ports/commit/?id=d06e12de9aeccfddb388561466ef833a2906d39e commit d06e12de9aeccfddb388561466ef833a2906d39e Author: Eugene Grosbein AuthorDate: 2023-02-26 08:50:17 +0000 Commit: Eugene Grosbein CommitDate: 2023-02-26 08:58:22 +0000 databases/xtrabackup8: update to version 8.0.31-24 This change includes files/patch-llvm-15, a copy of the patch fixing UB in MySQL Server 8.0.31 code included in xtrabackup8 and discovered with Clang 15: https://cgit.freebsd.org/ports/tree/databases/mysql80-server/files/patch-llvm15-fix?id=9f33a321916b The version 8.0.31-24 includes auto-tuning of its "use-memory" option that needs implementation of host_free_memory() but lacks one suitable for FreeBSD. This change adds simple implementation by me in files/patch-storage_innobase_xtrabackup_src_utils.cc that sums sysctls vm.stats.vm.v_free_count and vm.stats.vm.v_inactive_count assuming that FreeBSD VM subsystem frees Inactive pages as needed. This feature was tested by port maintainer Eugene Zheganin successfully performing backup of 730GB MySQL InnoDB that failed with previous xtrabackup8 version if used with defaults. Drop unused dependency on vim and explicitly disable online version update check. Force NDEBUG build as it fails otherwise. Pet portlint. Work-around a problem with ncurses-6.3 dependency that installs wrong libncurses.so file (ASCII text), so use libncurses.so.6 in LIB_DEPENDS instead. Tested by: Eugene Zheganin Approved by: Eugene Zheganin (maintainer) --- databases/xtrabackup8/Makefile | 54 ++++++++++++-------- databases/xtrabackup8/distinfo | 10 ++-- databases/xtrabackup8/files/patch-CMakeLists.txt | 22 +++++--- databases/xtrabackup8/files/patch-llvm-15 | 41 +++++++++++++++ databases/xtrabackup8/files/patch-procps | 15 ++++++ databases/xtrabackup8/files/patch-sql_binlog.cc | 24 --------- .../patch-storage_innobase_xtrabackup_src_utils.cc | 59 ++++++++++++++++++++++ 7 files changed, 168 insertions(+), 57 deletions(-) diff --git a/databases/xtrabackup8/Makefile b/databases/xtrabackup8/Makefile index a44d56c4e1b2..c38b83ce5ee1 100644 --- a/databases/xtrabackup8/Makefile +++ b/databases/xtrabackup8/Makefile @@ -1,13 +1,11 @@ PORTNAME= xtrabackup -PORTVERSION= 8.0.14 -PORTREVISION= 6 +PORTVERSION= 8.0.31 +DISTVERSIONSUFFIX= -24 CATEGORIES= databases -MASTER_SITES= https://www.percona.com/downloads/Percona-XtraBackup-${PORTVERSION:R}/Percona-XtraBackup-${PORTVERSION}/source/tarball/:precona \ - https://github.com/percona/percona-xtrabackup/archive/:percona \ +MASTER_SITES= https://github.com/percona/percona-xtrabackup/archive/:percona \ SF/boost/boost/${BOOST_VERSION}:boost PKGNAMESUFFIX= 8 -DISTNAME= percona-${PORTNAME}-${PORTVERSION} -DISTFILES= percona-${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}:percona \ +DISTFILES= ${PPORTNAME}-${DVERSION}${EXTRACT_SUFX}:percona \ boost_${BOOST_VERSION_UNDER}${EXTRACT_SUFX}:boost MAINTAINER= eugene@zhegan.in @@ -17,34 +15,47 @@ WWW= https://www.percona.com/doc/percona-xtrabackup/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE -BUILD_DEPENDS= xxd:editors/vim \ - protobuf>=3.0:devel/protobuf \ +BUILD_DEPENDS= protobuf>=3.0:devel/protobuf \ rapidjson>=1.1.0:devel/rapidjson \ - libevent>=2.1:devel/libevent + libevent>=2.1:devel/libevent \ + ncurses>=6.3:devel/ncurses LIB_DEPENDS= libcurl.so:ftp/curl \ libev.so:devel/libev \ libgcrypt.so:security/libgcrypt \ libgpg-error.so:security/libgpg-error \ libicudata.so:devel/icu \ + libncurses.so.6:devel/ncurses \ + libprotobuf-lite.so:devel/protobuf \ libunwind.so:devel/libunwind \ libzstd.so:archivers/zstd RUN_DEPENDS= qpress:archivers/qpress -CONFLICTS_INSTALL= ${PORTNAME} - USES= bison cmake compiler:c++14-lang cpe pkgconfig ssl CPE_VENDOR= percona -CMAKE_ARGS= -DBUILD_CONFIG:STRING=xtrabackup_release +CMAKE_ARGS= -DBUILD_CONFIG:STRING=xtrabackup_release \ + -DWITHOUT_COMPONENT_KEYRING_KMIP:STRING=yes \ + -DWITH_VERSION_CHECK=false + .for component in EDITLINE ICU LIBEVENT PROTOBUF RAPIDJSON ZSTD CMAKE_ARGS+= -DWITH_${component}:STRING=system .endfor +CONFLICTS_INSTALL= ${PORTNAME} + # Bundle last supported Boost release -BOOST_VERSION= 1.72.0 +BOOST_VERSION= 1.77.0 BOOST_VERSION_UNDER= ${BOOST_VERSION:C/\./_/g} CMAKE_ARGS+= -DWITH_BOOST=${WRKDIR}/boost_${BOOST_VERSION_UNDER} +# Build fails without NDEBUG, so force it +CFLAGS+= -DNDEBUG +CXXFLAGS+= -DNDEBUG + +DVERSION= ${PORTVERSION}${DISTVERSIONSUFFIX} +PPORTNAME= percona-${PORTNAME} +WRKSRC= ${WRKDIR}/${PPORTNAME}-${PPORTNAME}-${DVERSION} + .include # Since MySQL 8.0.20 InnoDB engine uses new memory alligned allocator @@ -54,15 +65,16 @@ CMAKE_ARGS+= -DWITH_BOOST=${WRKDIR}/boost_${BOOST_VERSION_UNDER} CMAKE_ARGS+= -DDISABLE_PSI_MEMORY=1 .endif -post-extract: -# Delete bundled components so we won't accidentally use them, except LZ4 -# which cannot be removed just yet - @${MV} ${WRKSRC}/extra/lz4 ${WRKSRC} - @${RM} -r ${WRKSRC}/extra/* - @${MV} ${WRKSRC}/lz4 ${WRKSRC}/extra +KEEP_EXTRA= lz4 robin-hood-hashing zlib -post-patch: - @${REINPLACE_CMD} -e 's,TRUE,true,' ${WRKSRC}/sql/mysqld.cc +pre-configure: +.for dir in ${KEEP_EXTRA} + @${MV} ${WRKSRC}/extra/${dir} ${WRKDIR} +.endfor + @${RM} -r ${WRKSRC}/extra/* +.for dir in ${KEEP_EXTRA} + @${MV} ${WRKDIR}/${dir} ${WRKSRC}/extra +.endfor post-stage: @${RM} -r ${STAGEDIR}${PREFIX}/docs diff --git a/databases/xtrabackup8/distinfo b/databases/xtrabackup8/distinfo index 6675fcff0dc8..d0cdcc263929 100644 --- a/databases/xtrabackup8/distinfo +++ b/databases/xtrabackup8/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1650736843 -SHA256 (percona-xtrabackup-8.0.14.tar.gz) = db8d6d2c6a6b016bf24b4942582ebdbd55c09253ccc78daa6911217bd5a73d5d -SIZE (percona-xtrabackup-8.0.14.tar.gz) = 285621091 -SHA256 (boost_1_72_0.tar.gz) = c66e88d5786f2ca4dbebb14e06b566fb642a1a6947ad8cc9091f9f445134143f -SIZE (boost_1_72_0.tar.gz) = 126580835 +TIMESTAMP = 1677255149 +SHA256 (percona-xtrabackup-8.0.31-24.tar.gz) = 0031a91501a98e09b8d3955d580552ae05ac28696143369ba461aa1fa04c5140 +SIZE (percona-xtrabackup-8.0.31-24.tar.gz) = 336261760 +SHA256 (boost_1_77_0.tar.gz) = 5347464af5b14ac54bb945dc68f1dd7c56f0dad7262816b956138fc53bcc0131 +SIZE (boost_1_77_0.tar.gz) = 130620992 diff --git a/databases/xtrabackup8/files/patch-CMakeLists.txt b/databases/xtrabackup8/files/patch-CMakeLists.txt index 15735641fee2..59e23aedca07 100644 --- a/databases/xtrabackup8/files/patch-CMakeLists.txt +++ b/databases/xtrabackup8/files/patch-CMakeLists.txt @@ -1,13 +1,21 @@ ---- CMakeLists.txt.orig 2020-08-28 21:02:32 UTC +--- CMakeLists.txt.orig 2023-01-30 13:34:34 UTC +++ CMakeLists.txt -@@ -1575,10 +1575,6 @@ IF(ENABLE_GCOV) - INCLUDE(fastcov) +@@ -2081,7 +2081,6 @@ ENDIF() + ENDIF() ENDIF() --IF(UNIX) -- ADD_SUBDIRECTORY(man) +-ADD_SUBDIRECTORY(extra/libkmip) + + # + # Setup maintainer mode options by the end. Platform checks are +@@ -2292,10 +2291,6 @@ IF(ENABLE_GCOV) + + IF(ENABLE_GCOV) + INCLUDE(fastcov) -ENDIF() - +-IF(UNIX) +- ADD_SUBDIRECTORY(man) + ENDIF() + IF(NOT WITHOUT_SERVER) - ADD_SUBDIRECTORY(packaging/rpm-common) - ADD_SUBDIRECTORY(packaging/rpm-oel) diff --git a/databases/xtrabackup8/files/patch-llvm-15 b/databases/xtrabackup8/files/patch-llvm-15 new file mode 100644 index 000000000000..95eba05846e8 --- /dev/null +++ b/databases/xtrabackup8/files/patch-llvm-15 @@ -0,0 +1,41 @@ +--- include/varlen_sort.h.orig 2023-01-30 20:34:34.000000000 +0700 ++++ include/varlen_sort.h 2023-02-25 15:15:11.238374000 +0700 +@@ -184,7 +184,9 @@ template <> + + // Required for Iterator. + template <> +-struct iterator_traits : iterator_traits {}; ++struct iterator_traits : iterator_traits { ++ using reference = varlen_element; ++}; + + } // namespace std + +--- storage/innobase/include/ddl0impl.h.orig 2023-01-30 20:34:34.000000000 +0700 ++++ storage/innobase/include/ddl0impl.h 2023-02-25 15:17:06.382636000 +0700 +@@ -118,14 +118,6 @@ struct Row { + + /** Physical row context. */ + struct Row { +- /** Constructor. */ +- Row() = default; +- +- Row(const Row &) = default; +- +- /** Destructor. */ +- ~Row() = default; +- + /** Build a row from a raw record. + @param[in,out] ctx DDL context. + @param[in,out] index Index the record belongs to. +--- unittest/gunit/mysys_my_rdtsc-t.cc.orig 2023-01-30 20:34:34.000000000 +0700 ++++ unittest/gunit/mysys_my_rdtsc-t.cc 2023-02-25 15:23:43.264080000 +0700 +@@ -113,7 +113,7 @@ TEST_F(RDTimeStampCounter, TestCycle) { + ulonglong t1 = my_timer_cycles(); + ulonglong t2; + int i; +- int backward = 0; ++ int backward [[maybe_unused]] = 0; + int nonzero = 0; + + for (i = 0; i < LOOP_COUNT; i++) { diff --git a/databases/xtrabackup8/files/patch-procps b/databases/xtrabackup8/files/patch-procps new file mode 100644 index 000000000000..3331e9140f8a --- /dev/null +++ b/databases/xtrabackup8/files/patch-procps @@ -0,0 +1,15 @@ +--- storage/innobase/xtrabackup/src/CMakeLists.txt.orig 2023-01-30 20:34:34.000000000 +0700 ++++ storage/innobase/xtrabackup/src/CMakeLists.txt 2023-02-25 17:34:58.412247000 +0700 +@@ -132,12 +132,6 @@ TARGET_LINK_LIBRARIES(xtrabackup + crc + ) + +-IF(NOT APPLE) +- TARGET_LINK_LIBRARIES(xtrabackup +- procps +- ) +-ENDIF() +- + # We depend on protobuf because of the mysqlx plugin and replication. + IF(UNIX_INSTALL_RPATH_ORIGIN_PRIV_LIBDIR) + ADD_INSTALL_RPATH_FOR_PROTOBUF(xtrabackup) diff --git a/databases/xtrabackup8/files/patch-sql_binlog.cc b/databases/xtrabackup8/files/patch-sql_binlog.cc deleted file mode 100644 index 2bae3d050d5a..000000000000 --- a/databases/xtrabackup8/files/patch-sql_binlog.cc +++ /dev/null @@ -1,24 +0,0 @@ ---- sql/binlog.cc.orig 2020-08-28 21:02:32 UTC -+++ sql/binlog.cc -@@ -9163,8 +9163,8 @@ void MYSQL_BIN_LOG::report_missing_purged_gtids( - - char *missing_gtids = NULL; - char *slave_executed_gtids = NULL; -- gtid_missing.to_string(&missing_gtids, NULL); -- slave_executed_gtid_set->to_string(&slave_executed_gtids, NULL); -+ gtid_missing.to_string(&missing_gtids, false); -+ slave_executed_gtid_set->to_string(&slave_executed_gtids, false); - - /* - Log the information about the missing purged GTIDs to the error log. -@@ -9217,8 +9217,8 @@ void MYSQL_BIN_LOG::report_missing_gtids( - Gtid_set gtid_missing(slave_executed_gtid_set->get_sid_map()); - gtid_missing.add_gtid_set(slave_executed_gtid_set); - gtid_missing.remove_gtid_set(previous_gtid_set); -- gtid_missing.to_string(&missing_gtids, NULL); -- slave_executed_gtid_set->to_string(&slave_executed_gtids, NULL); -+ gtid_missing.to_string(&missing_gtids, false); -+ slave_executed_gtid_set->to_string(&slave_executed_gtids, false); - - String tmp_uuid; - diff --git a/databases/xtrabackup8/files/patch-storage_innobase_xtrabackup_src_utils.cc b/databases/xtrabackup8/files/patch-storage_innobase_xtrabackup_src_utils.cc new file mode 100644 index 000000000000..34feee9867f6 --- /dev/null +++ b/databases/xtrabackup8/files/patch-storage_innobase_xtrabackup_src_utils.cc @@ -0,0 +1,59 @@ +--- storage/innobase/xtrabackup/src/utils.cc.orig 2023-01-30 20:34:34.000000000 +0700 ++++ storage/innobase/xtrabackup/src/utils.cc 2023-02-25 02:50:31.899561000 +0700 +@@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Bos + + #ifdef __APPLE__ + #include ++#endif ++#if defined(__APPLE__) || defined(__FreeBSD__) + #include + #else + #include +@@ -112,12 +114,14 @@ unsigned long get_version_number(std::string version_s + return major * 10000 + minor * 100 + version; + } + +-#ifdef __APPLE__ ++#if defined(__APPLE__) || defined(__FreeBSD__) + unsigned long host_total_memory() { + unsigned long total_mem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE); + return total_mem; + } ++#endif + ++#ifdef __APPLE__ + unsigned long host_free_memory() { + unsigned long total_mem = host_total_memory(); + int64_t used_mem; +@@ -138,6 +142,31 @@ unsigned long host_free_memory() { + return total_mem - (unsigned long)used_mem; + } + return 0; ++} ++#elif defined(__FreeBSD__) ++unsigned long host_free_memory() { ++ static int mib_free[2] = { -1, 0 }; ++ static int mib_inactive[2] = { -1, 0 }; ++ size_t miblen = sizeof(mib_free) / sizeof(mib_free[0]); ++ uint32_t free_pages, inactive_pages; ++ size_t sz = sizeof(free_pages); ++ ++ free_pages = inactive_pages = 0; ++ ++ if (mib_free[0] < 0 && ++ sysctlnametomib("vm.stats.vm.v_free_count", mib_free, &miblen) < 0) ++ mib_free[0] = 0; ++ if (mib_inactive[0] < 0 && ++ sysctlnametomib("vm.stats.vm.v_inactive_count", mib_inactive, &miblen) < 0) ++ mib_inactive[0] = 0; ++ ++ if (mib_free[0] && ++ sysctl(mib_free, 2, &free_pages, &sz, NULL, 0) < 0) ++ free_pages = 0; /* should not happen */ ++ if (mib_inactive[0] && sysctl(mib_inactive, 2, &inactive_pages, &sz, NULL, 0) < 0) ++ inactive_pages = 0; /* should not happen, too */ ++ ++ return (free_pages + inactive_pages) * sysconf(_SC_PAGESIZE); + } + #else + unsigned long host_total_memory() {