diff options
author | V3n3RiX <venerix@koprulu.sector> | 2025-03-10 01:49:12 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2025-03-10 01:49:12 +0000 |
commit | 7c5ebaf83da4c538dd11b56fdd5dfdf39dcbc096 (patch) | |
tree | 5cd412784dc4fb63a7f56eb252196ed9dd6980c4 /dev-db | |
parent | 0b832a429ecd6081aa9faa0eb262303b019d87ea (diff) |
gentoo auto-resync : 10:03:2025 - 01:49:12
Diffstat (limited to 'dev-db')
-rw-r--r-- | dev-db/Manifest.gz | bin | 16774 -> 16760 bytes | |||
-rw-r--r-- | dev-db/freetds/Manifest | 4 | ||||
-rw-r--r-- | dev-db/freetds/freetds-1.4.26.ebuild | 68 | ||||
-rw-r--r-- | dev-db/freetds/metadata.xml | 3 | ||||
-rw-r--r-- | dev-db/mysql-connector-c++/Manifest | 5 | ||||
-rw-r--r-- | dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-gcc-15-cstdint.patch | 16 | ||||
-rw-r--r-- | dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-hookup-tests.patch | 64 | ||||
-rw-r--r-- | dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-test-iomanip.patch | 15 | ||||
-rw-r--r-- | dev-db/mysql-connector-c++/mysql-connector-c++-9.2.0.ebuild | 184 | ||||
-rw-r--r-- | dev-db/mysql-connector-c/Manifest | 2 | ||||
-rw-r--r-- | dev-db/mysql-connector-c/mysql-connector-c-8.0.41.ebuild | 127 | ||||
-rw-r--r-- | dev-db/mysql-workbench/Manifest | 2 | ||||
-rw-r--r-- | dev-db/mysql-workbench/mysql-workbench-8.0.41.ebuild | 118 | ||||
-rw-r--r-- | dev-db/mysql/Manifest | 4 | ||||
-rw-r--r-- | dev-db/mysql/mysql-8.0.40.ebuild | 50 | ||||
-rw-r--r-- | dev-db/mysql/mysql-8.0.41.ebuild | 1310 |
16 files changed, 1956 insertions, 16 deletions
diff --git a/dev-db/Manifest.gz b/dev-db/Manifest.gz Binary files differindex b68c8730e6e8..50f66280c69f 100644 --- a/dev-db/Manifest.gz +++ b/dev-db/Manifest.gz diff --git a/dev-db/freetds/Manifest b/dev-db/freetds/Manifest index 55aa4e518786..7e80597b8f9f 100644 --- a/dev-db/freetds/Manifest +++ b/dev-db/freetds/Manifest @@ -1,3 +1,5 @@ DIST freetds-1.4.24.tar.bz2 2402973 BLAKE2B ba6f31fe117c11abc0e0365bf0d10061e793bb9313774a5e2d9b6766fef54abbec6c1c27480a875438008a592f6ab9942bd41a19a4dd7388ca3c2728bf1b2a65 SHA512 f564c81abaec28a6c55476121fff47e8957af654197ed679cfebdbeaa4dfe5d0f9d5f900cd03b4260efc3da3f9cd41ee370fadb6b59da9f41d9006760e9609d9 +DIST freetds-1.4.26.tar.bz2 2404182 BLAKE2B 9a15fb88fa8b34824861b4542a73e17cac6ada13889743487245504e7258b9db3def10bbc9a47402d76108b4571e07019f09b2eff3a951c2c95aea883e4be3f6 SHA512 19a9bf4ed3789bd3e9b8a182df1bf0fa373d3dd156a3e88256c350915a93a7505d48c9f50d8a6b6d2c6a3a01bf58ed4e7b2aa118df8180da7b01a4bef770387a EBUILD freetds-1.4.24.ebuild 1709 BLAKE2B 7d65d043aabf8a279078fb9289dce007be1e24f11135d10dc36b32de1b0252dcc2e649c7813d890e0405bedb309eabd26e17f00cd33c4b9580eb3b4227cc8ea4 SHA512 b32a2f90814bb85a0560ef6b978a07d1c84848b6814615288d6cf233e14bacbdbaf02745d66020ca0aef4d48178efc92640538eac669639eacd15041b32fb5bc -MISC metadata.xml 307 BLAKE2B ef2023a0b7e091f47fa6e6e8c225a905e7456cbcccedaab86c3c9aa237eeaf87e5cafed83650a6ca569b3cc70bcd14ad0badabd0e4bd1739b619dbd3c3877de4 SHA512 e5489d7a456f904586f31a9c1e4b51a83d6db0ad27a7964df0ddf5a2cf75d3ba1e22fd2765d25540987e35932005968aa321dee761b64550dab27620ab9be3d7 +EBUILD freetds-1.4.26.ebuild 1740 BLAKE2B 0512f336b5c07ccca67ba483bfa07a4628af3f58643688202a2261c0ee510514583f6d9cd36401585646cf266a51abb736e5596ad7d0b31c5a7c47fd8fbcb647 SHA512 36bc5250525eb0a7dbc97795197bf146eba538798a46b25a775efb4d95ab80cd677749b0e68f932b6eb59d37be44b0cf95133af71cf2b8c2e30f2cf63a67569d +MISC metadata.xml 497 BLAKE2B 61a5625cb9ba5c27423b5296f359fcbaec867b1cbcac63b160e4c68ff94f4ef2875a38082c3143e46848faf59030033efde9b10a25a8ee09ff35e229a1dca248 SHA512 67525810cf430907bbf63db81865b99c5d42c91bf7ad0f863d062ad5a0e78d1ec19d642ba93ef195e57297ee34d6e5102babdce1b5fb13567c6ce933502e811c diff --git a/dev-db/freetds/freetds-1.4.26.ebuild b/dev-db/freetds/freetds-1.4.26.ebuild new file mode 100644 index 000000000000..f70647b245a1 --- /dev/null +++ b/dev-db/freetds/freetds-1.4.26.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Tabular Datastream Library" +HOMEPAGE="https://www.freetds.org/" +SRC_URI="https://www.freetds.org/files/stable/${P}.tar.bz2" + +LICENSE="GPL-2+ LGPL-2+" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-macos" +IUSE="debug gnutls iconv kerberos mssql iodbc odbc ssl static-libs" +# iODBC and unixODBC are mutually-exclusive choices for +# the ODBC driver manager. Future versions of FreeTDS +# will throw an error if you specify both. +REQUIRED_USE="?? ( iodbc odbc )" +# Nearly wired up as of 1.4.26 but had link failures like +# all_types: hidden symbol `tds_convert' isn't defined +RESTRICT="test" + +DEPEND=" + gnutls? ( net-libs/gnutls:= ) + iconv? ( virtual/libiconv ) + iodbc? ( dev-db/libiodbc ) + kerberos? ( virtual/krb5 ) + odbc? ( dev-db/unixODBC ) + ssl? ( dev-libs/openssl:= ) +" +# bind-tools is needed because the osql script calls "host". +RDEPEND=" + ${DEPEND} + net-dns/bind +" + +DOCS=( {NEWS,README}.md ) + +src_configure() { + local myeconfargs=( + --enable-shared + $(use_enable debug) + $(use_enable iconv libiconv) + $(use_enable kerberos krb5) + $(use_enable mssql msdblib) + $(use_with gnutls) + $(use_with iodbc) + $(use_with iconv libiconv-prefix "${EPREFIX}/usr") + $(use_with odbc unixodbc "${EPREFIX}/usr") + $(use_with ssl openssl "${EPREFIX}/usr") + ) + econf "${myeconfargs[@]}" +} + +src_test() { + # These tests need a running database. + local XFAIL_TESTS=( + corrupt dataread dynamic1 nulls + t000{1..6} toodynamic utf8_{1..3} + ) + + emake check XFAIL_TESTS="${XFAIL_TESTS[*]}" +} + +src_install() { + default + + find "${D}" -type f -name '*.la' -delete || die +} diff --git a/dev-db/freetds/metadata.xml b/dev-db/freetds/metadata.xml index 778555752459..9c4e377a99c7 100644 --- a/dev-db/freetds/metadata.xml +++ b/dev-db/freetds/metadata.xml @@ -3,6 +3,9 @@ <pkgmetadata> <!-- maintainer-needed --> <upstream> + <bugs-to>https://github.com/FreeTDS/freetds/issues</bugs-to> + <changelog>https://github.com/FreeTDS/freetds/blob/master/NEWS.md</changelog> + <doc>https://www.freetds.org/docs.html</doc> <remote-id type="cpe">cpe:/a:freetds:freetds</remote-id> <remote-id type="github">FreeTDS/freetds</remote-id> </upstream> diff --git a/dev-db/mysql-connector-c++/Manifest b/dev-db/mysql-connector-c++/Manifest index b1ec9b808566..0d55653b0557 100644 --- a/dev-db/mysql-connector-c++/Manifest +++ b/dev-db/mysql-connector-c++/Manifest @@ -1,5 +1,10 @@ AUX mysql-connector-c++-8.0.27-mysqlclient_r.patch 1070 BLAKE2B 339951ae0df13467247168052a9928d2d0f72dca1c97f6d78eb604372e45ed1a14564a05f1bdd54e5848d669520ac43a2129b3c337c776a71a6670da09c74d04 SHA512 c141b81fc755ef4b586debe473b9bd0f903d4575314327a319ad584263a09281290bc5c95b683c11932fded730ca3962b8450be8a916db3c86391ad3edb52305 AUX mysql-connector-c++-8.0.33-jdbc.patch 265 BLAKE2B e421e01de9ca66f159c9000ebbbb1d5bc8a1755a9f982952ffe8c200e370ea24626c6bd2795af80425b58fa6efda502656a02967611014153fbab6a95eb1d025 SHA512 5a06851d0b2a8d86af0b1a0f102af5044e19ad3a1a277c898fb83a0bee546a7a36a17ec6af747d306428eeedffef5fd298dafd940151c6a1e26b35049eb2ed9f +AUX mysql-connector-c++-9.2.0-gcc-15-cstdint.patch 353 BLAKE2B b8f0a82fd456d3df45f33f99ae616f720bc228b90adfd245c84d361ca52502da829fb34570aea758516899b2ac692d2d91a837cefd1a2db99bd6337a567222ee SHA512 08fb86e998343ef25b860311559b9ac5154edbb970f73cec3bd7a604f9fe87c42f717bbf89c6dc94cf6c2678e4db2462c6a93613ede9a31b8131ebdfe41d06a1 +AUX mysql-connector-c++-9.2.0-hookup-tests.patch 1725 BLAKE2B 89987d1ab10386e66e1a03bd44d951b3a71604d6daa90fa4d0c8d85dc51f74b5450a7e47b8308759a0b8680a41d01718c64da11b4bb98bff36accaf0d0760cf3 SHA512 b7d17ad8d381fd9d961faa23a6525e3d141efb1673681c99386e2599fc019c619a217026ac1e737054f22506e96d15c0faa5cf486f12c9a7c73312924f06126b +AUX mysql-connector-c++-9.2.0-test-iomanip.patch 341 BLAKE2B a232c3e8caacde935f1cbf506e87d7e6948b5deb2e536b129a06b4d4183ff5f8e9762c09dc2be355ae924a97f0b7266cf786b1129dce26ac40e5cfbbbc06f925 SHA512 aba114f61f5d89c48d777e473c44b07969aad74f0efe80a3b9403d99e5903f1ab7795c0866829593e14d05a45ca6b55446a5118c409b22263b99336e3d2c537a DIST mysql-connector-c++-8.0.33-src.tar.gz 4531693 BLAKE2B b8f426742fa343ebc1f1da5ba1fbf7dfc0db39493bafd0f5d16e355d43277d78ff27b183edad31792a7591ac59bbfb4033f3498dc646883988cba189535a8ddf SHA512 a625a28f63161c97d727d90e7b1211273fe931ae1325c2fbeca16e770761e3159abdcaba1fb6eb1a557674fd817bf266875a089c8c2ea4d2dd1553e6fa887ef1 +DIST mysql-connector-c++-9.2.0-src.tar.gz 4784018 BLAKE2B 74ddf9d4d7bf6b679d8cbacae1de848c0957cb5ab196dfc1ed42927bff9924b12f73f6e58ceeb07b586fd60a79bd0313c395e21393c303ddaa0f525d7d8c5375 SHA512 bbd829ba426772702c8109e8706e5e542bc2a102dae6cddc0ba4f9f6d26952b4652210930d9a983cfadd3a72cf95ba430a401eeb100d766de69ddc2ec6eefa71 EBUILD mysql-connector-c++-8.0.33-r1.ebuild 1495 BLAKE2B 63c33ddbae99b67dfae008f5a84707c79d9100ebac6268dab63b8bb131bd3e685c3d2e7787edbab9198b3f3d5285d019881f92b96bafac5859b885643275ebe4 SHA512 ffccd040bf1974b014a96f52852cdf6f2d314dc02ce3f202fbb8ce6d8cf9e665f9670425ee489680cf7df5e11aae30a2ae80b89e3404daa375ae118c54d592fa +EBUILD mysql-connector-c++-9.2.0.ebuild 4986 BLAKE2B 22265e622b6c6d1c0e1293bfa9415e7c459e4ba1551669e49d8bf3a77fd4b2e04ecfa222cc23d804b596577b6435c9c6ee2bb614dd5127360e8d27b9310b58d1 SHA512 b30777928501f270ff890cc162c49c5beaecc4cff5c5f90dd3bad92b131af1b9610be4bdcd73915982f632744402ffc24824d10f135864f50959eda6c9934cfc MISC metadata.xml 427 BLAKE2B 6467a6f2f5b106904e37a7d305ef49d6d43a07ac94f958e4f02406ea6d118feb7ba6cb6a036226e419b5ee732500e9cfda2d332a41f8d3635eadd3d3f826c868 SHA512 dfc7271b8c49ad4bd9672c098c9ef29144488f2dd92caec9ab54d0f01a849b4507662c2d5788da102e373da31d8b33b55697ad9b22dfd64e1d9dfdc082e576a0 diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-gcc-15-cstdint.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-gcc-15-cstdint.patch new file mode 100644 index 000000000000..8e4bd1811f75 --- /dev/null +++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-gcc-15-cstdint.patch @@ -0,0 +1,16 @@ +https://bugs.gentoo.org/863188 + +diff --git a/include/mysqlx/common/value.h b/include/mysqlx/common/value.h +index 4f1b7a38..c30bbd0a 100644 +--- a/include/mysqlx/common/value.h ++++ b/include/mysqlx/common/value.h +@@ -39,7 +39,7 @@ + PUSH_SYS_WARNINGS + #include <string> + POP_SYS_WARNINGS +- ++#include <cstdint> + + namespace mysqlx { + MYSQLX_ABI_BEGIN(2,0) + diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-hookup-tests.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-hookup-tests.patch new file mode 100644 index 000000000000..ba3cb5aaf7c8 --- /dev/null +++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-hookup-tests.patch @@ -0,0 +1,64 @@ +From 8d344b6c4ebb1f0029aecaee9cb0b5522e7db27e Mon Sep 17 00:00:00 2001 +From: Alfred Wingate <parona@protonmail.com> +Date: Sat, 8 Mar 2025 00:05:15 +0200 +Subject: [PATCH] Build correctly against shared library gtest + +Not upstreamable as is. +--- a/cdk/cmake/gtest.cmake ++++ b/cdk/cmake/gtest.cmake +@@ -132,19 +132,8 @@ MESSAGE("gtest location: ${gtest_location}") + MESSAGE("gtest_main location: ${gtest_main_location}") + + +-add_library(gtest STATIC IMPORTED) +-add_library(gtest_main STATIC IMPORTED) +- +-set_target_properties(gtest PROPERTIES +- IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" +- IMPORTED_LOCATION "${gtest_location}" +-) +- +-set_target_properties(gtest_main PROPERTIES +- IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" +- IMPORTED_LINK_INTERFACE_LIBRARIES "gtest" +- IMPORTED_LOCATION "${gtest_main_location}" +-) ++add_library(gtest ALIAS GTest::gtest) ++add_library(gtest_main ALIAS GTest::gtest_main) + + # + # Setup configuration-specific locations for Win +@@ -193,11 +182,5 @@ IF(WIN32) + + ENDFOREACH(Config) + +-ELSE(WIN32) +- +- # On unix gtest depends on pthread library +- set_property(TARGET gtest APPEND PROPERTY INTERFACE_LINK_LIBRARIES pthread) +- set_property(TARGET gtest APPEND PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES pthread) +- + ENDIF(WIN32) + +-- +2.48.1 + +From 1d0f1fbb800517583029b6bc88d285bcb1245111 Mon Sep 17 00:00:00 2001 +From: Alfred Wingate <parona@protonmail.com> +Date: Sat, 8 Mar 2025 00:06:41 +0200 +Subject: [PATCH] Hook cdk unittests to ctest + +--- a/cdk/cmake/testing.cmake ++++ b/cdk/cmake/testing.cmake +@@ -370,6 +370,8 @@ IF(WITH_TESTS) + COMMENT "# Generating test group definitons." + ) + ++ gtest_discover_tests(${target_run_unit_tests}) ++ + ENDIF() + ENDMACRO(ADD_TEST_TARGET) + +-- +2.48.1 + diff --git a/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-test-iomanip.patch b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-test-iomanip.patch new file mode 100644 index 000000000000..ae9b58f519ea --- /dev/null +++ b/dev-db/mysql-connector-c++/files/mysql-connector-c++-9.2.0-test-iomanip.patch @@ -0,0 +1,15 @@ +Implicit requirement due to use of std::setw + +diff --git a/devapi/tests/session-t.cc b/devapi/tests/session-t.cc +index 758a0b8f..138cdcac 100644 +--- a/devapi/tests/session-t.cc ++++ b/devapi/tests/session-t.cc +@@ -35,6 +35,7 @@ + #include <thread> + #include <map> + #include <sstream> ++#include <iomanip> + + using std::cout; + using std::endl; + diff --git a/dev-db/mysql-connector-c++/mysql-connector-c++-9.2.0.ebuild b/dev-db/mysql-connector-c++/mysql-connector-c++-9.2.0.ebuild new file mode 100644 index 000000000000..64517a13b8e8 --- /dev/null +++ b/dev-db/mysql-connector-c++/mysql-connector-c++-9.2.0.ebuild @@ -0,0 +1,184 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +URI_DIR="Connector-C++" +DESCRIPTION="MySQL database connector for C++ (mimics JDBC 4.0 API)" +HOMEPAGE="https://dev.mysql.com/downloads/connector/cpp/" +SRC_URI=" + https://dev.mysql.com/get/Downloads/${URI_DIR}/${P}-src.tar.gz +" +S="${WORKDIR}/${P}-src" + +LICENSE="Artistic GPL-2" +# See ABI_VERSION(s) is version.cmake +SLOT="0/2.10" # ABI_VERSION_MAJOR/JDBC_ABI_VERSION_MAJOR +# -ppc, -sparc for bug #711940 +KEYWORDS="~amd64 ~arm ~arm64 -ppc ~ppc64 -sparc ~x86" +IUSE="+legacy test" + +RESTRICT="!test? ( test )" + +RDEPEND=" + app-arch/lz4:= + app-arch/zstd:= + dev-libs/openssl:= + sys-libs/zlib + legacy? ( + >=dev-db/mysql-connector-c-8.0.27:= + ) +" +DEPEND=" + ${RDEPEND} + test? ( + dev-cpp/gtest + ) +" +BDEPEND=" + test? ( + >=dev-db/mysql-8[server] + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-8.0.27-mysqlclient_r.patch + "${FILESDIR}"/${PN}-8.0.33-jdbc.patch + "${FILESDIR}"/${PN}-9.2.0-gcc-15-cstdint.patch + "${FILESDIR}"/${PN}-9.2.0-test-iomanip.patch + "${FILESDIR}"/${PN}-9.2.0-hookup-tests.patch +) + +src_prepare() { + cmake_src_prepare + + # ignores MAKEOPTS and runs recursive make -j$(nproc). Clobbers jobs badly + # enough that your system immediately freezes. + # + # https://bugs.gentoo.org/921309 + # https://bugs.mysql.com/bug.php?id=115734 + sed -i 's/prc_cnt AND NOT/FALSE AND NOT/' cdk/cmake/dependency.cmake || die +} + +src_configure() { + # sanity check subslot to kick would be drive by bumpers + local detected_abi + detected_abi="$(awk '$1 ~ "set.*ABI_VERSION_MAJOR" {printf("%s.",$2)}' version.cmake)" + detected_abi="${detected_abi%.}" + if [[ "${SLOT#0/}" != "${detected_abi}" ]]; then + die "Sub slot ${SLOT#0/} doesn't match upstream specified ABI ${detected_abi}." + fi + + local mycmakeargs=( + -DBUNDLE_DEPENDENCIES=OFF + # Cannot handle protobuf >23, bug #912797 + #-DWITH_PROTOBUF=system + -DWITH_LZ4=system + -DWITH_SSL=system + -DWITH_ZLIB=system + -DWITH_ZSTD=system + -DWITH_JDBC=$(usex legacy) + -DWITH_TESTS=$(usex test) + ) + + if use legacy ; then + mycmakeargs+=( + -DMYSQLCLIENT_STATIC_BINDING=0 + -DMYSQLCLIENT_STATIC_LINKING=0 + ) + fi + + cmake_src_configure +} + +# NOTE: Test failures in jdbc may be a sign of issues in mysql-connector-c. +src_test() { + local CMAKE_SKIP_TESTS=( + # Test that configures, builds and install a test project again. It gets caught on the install phase. + Link_test + # Only ipv4 will work as only the ipv4 local address is specified. A future task for someone... + # https://dev.mysql.com/doc/refman/8.4/en/x-plugin-options-system-variables.html#sysvar_mysqlx_bind_address + Sess.ipv6 + # FIXME: + # not ok 15 - preparedstatement::queryAttributes # assertEquals(int) failed in + # /var/tmp/portage/dev-db/mysql-connector-c++-9.2.0/work/mysql-connector-c++-9.2.0-src/jdbc/test/unit/classes/preparedstatement.cpp, + # line #1582 expecting '200' got '0' + jdbc_test_preparedstatement + ) + + local -x MYSQL_HOST="127.0.0.1" + local -x MYSQL_PORT="5555" + local -x MYSQL_USER="$(whoami)" + local -x MYSQL_PASSWORD="insecure" + local -x XPLUGIN_PORT="5556" + + einfo "Creating mysql test instance" + mkdir -p "${T}"/mysql || die + mysqld \ + --no-defaults \ + --initialize-insecure \ + --user root \ + --basedir="${EPREFIX}/usr" \ + --datadir="${T}"/mysql 1>"${T}"/mysqld_install.log || die + + einfo "Starting mysql test instance ..." + mysqld \ + --no-defaults \ + --character-set-server=utf8 \ + --bind-address=${MYSQL_HOST} \ + --port=${MYSQL_PORT} \ + --socket="${T}"/mysqld.sock \ + --mysqlx-bind-address=${MYSQL_HOST} \ + --mysqlx-port=${XPLUGIN_PORT} \ + --mysqlx-socket="${T}"/mysqlx.sock \ + --pid-file="${T}"/mysqld.pid \ + --datadir="${T}"/mysql 1>"${T}"/mysqld.log 2>&1 & + + # wait for it to start + local i + for (( i = 0; i < 10; i++ )); do + [[ -S ${T}/mysqld.sock ]] && break + sleep 1 + done + [[ ! -S ${T}/mysqld.sock ]] && die "mysqld failed to start" + + einfo "Configure mysql test instance ..." + # https://github.com/mysql/mysql-connector-cpp/blob/trunk/jdbc/test/CJUnitTestsPort/README + mysql -u root \ + -e "CREATE USER ${MYSQL_USER} IDENTIFIED BY '${MYSQL_PASSWORD}'; GRANT ALL PRIVILEGES ON *.* TO ${MYSQL_USER} WITH GRANT OPTION;" \ + -S "${T}/mysqld.sock" \ + -h ${MYSQL_HOST} \ + -P ${MYSQL_PORT} || die + mysql -u root \ + -S "${T}/mysqld.sock" \ + -h ${MYSQL_HOST} \ + -P ${MYSQL_PORT} < "${S}"/jdbc/test/CJUnitTestsPort/cts.sql || die + + # Do tests with one job for proper clean up in database tests. + nonfatal cmake_src_test -j1 + local ret=${?} + + einfo "Stopping mysql test instance ..." + pkill -F "${T}"/mysqld.pid || die + # wait for it to stop + local i + for (( i = 0; i < 10; i++ )); do + [[ -S ${T}/mysqld.sock ]] || break + sleep 1 + done + + rm -rf "${T}"/mysql || die + + [[ ${ret} -ne 0 ]] && die +} + +src_install() { + cmake_src_install + einstalldocs + + # cmake package config file appears to be broken in multiple ways + rm "${ED}/usr/mysql-concpp-config.cmake" || die + rm "${ED}/usr/mysql-concpp-config-version.cmake" || die +} diff --git a/dev-db/mysql-connector-c/Manifest b/dev-db/mysql-connector-c/Manifest index 5817a482d48e..5dbe04a1f846 100644 --- a/dev-db/mysql-connector-c/Manifest +++ b/dev-db/mysql-connector-c/Manifest @@ -2,5 +2,7 @@ AUX mysql-connector-c-8.0.19-do-not-install-comp_err.patch 307 BLAKE2B 864c07e9d AUX mysql-connector-c-8.0.27-res_n.patch 1635 BLAKE2B f75811958a6415bf45aa571a8da14c371500216a197602dec19b8b565bc219f98e8feb9bc660d81e32c4af7f39abb626af405d33a7f478617c8ee96c5b4453b8 SHA512 bb6315f0ac540d0723dffd9f8c2bdad9b9b1c0a3d706f80fd3bbdc9c7f276a8dda2754df94f6cb4ffecb0c3b0e65edc96c90b171eb0a4e5032fe6583e56ade85 AUX mysql-connector-c-8.0.36-always-build-decompress-utilities.patch 607 BLAKE2B 67196391d8d9a042087129cda2d7aa67903e73aa9446f32e831eef5b97d7c48cdf1c9774af19c814e82ee6a7524ae8ec481a8bb5a998f4e4fc67238b8cb89c14 SHA512 f020448bbe67d6ad262a444af4c36efc3b2dd7d1a2fa21145f1018e5dd20c1ab447e4171ad23536fbeb1ba3a1a2bdbc8e58c7bce9608ab858889e1f4e2426c64 DIST mysql-boost-8.0.36.tar.gz 438154682 BLAKE2B 066c9dd7f2804ad29808c3bfcf5eae53466f7c40cf1386a9c1f26a0b45dcc3eda8d9618de36e8008e5e4d58b726d6c8ca85aec8d1eda8981f5a49e495b32f046 SHA512 a6c1c009a322b7e7aa2aa607573060414c847c77d48f44a24058ffb89673621f2ebbcc1a4448fa841a87ff721159cc8eaf44a57721c7dc233c130691c16a9d4a +DIST mysql-boost-8.0.41.tar.gz 488749630 BLAKE2B 4d8c084ec9e95bb6d57573adbb998d4917d76fc77dc599c246b6f2ebbffccd2d2fd1ef8b615caa6bd7d4fa6646b55d5912f98f93d81f64fd4fc4162bf60aa9a2 SHA512 e5bb314082be6bf037808ea7a2130c8e2b44491a6c54bc3f611d823be5285021d05093afca71c3d33da6dece2bac3a8e24da5198080060407d8c4dbfeeea8a99 EBUILD mysql-connector-c-8.0.36.ebuild 3193 BLAKE2B d27adfacf052bfee9e17642b5b07c78c408be52f11b73f36bd213522c62d542e0708abb53c4f58cdb99df6be460354d749efb4b34f0e812536889c9a3ee8d5e1 SHA512 81d17293faa94dc938dc165caec455ec619efbaa73fd676e3ab20ef2ee7ea5174afcf47f65d5cb6c370f2d4fa1d912c4c940d02dc39f44dc260898b4822c202d +EBUILD mysql-connector-c-8.0.41.ebuild 3273 BLAKE2B d578815ef5edbda6707169993a9e4d2b907662d4a0e30547c327df0353db8f919da8852a9cd40794e2232dd3ab1654ad3cb7c830bfad1c06ac58fc43c9e28c38 SHA512 72530e0e83bffe2a663bc00d4aa8cdeab9ec1e528cc6229845fee2891b71ef255eb1b404842fe51f5417765c808ec7ad60e0e4827f63b4df78234eb46be6696a MISC metadata.xml 240 BLAKE2B cc93ae4da8408b221c296e092d9db6ae3879754ade669d81c1218d53a5f007c6b7717bda6f92dbb0af38ff9b5e45f44e91503b12d3603d9955ec7d5a2a67399b SHA512 0f41c32ce3d736e061302252f14913d7425bc97e19d0c2f3b80c50637ab3521aa6cfc67f82e5f70f91174cddb36bb5622837dc18fd9db3bf75eb860359aade27 diff --git a/dev-db/mysql-connector-c/mysql-connector-c-8.0.41.ebuild b/dev-db/mysql-connector-c/mysql-connector-c-8.0.41.ebuild new file mode 100644 index 000000000000..006029d59e49 --- /dev/null +++ b/dev-db/mysql-connector-c/mysql-connector-c-8.0.41.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake-multilib flag-o-matic + +DESCRIPTION="C client library for MariaDB/MySQL" +HOMEPAGE="https://dev.mysql.com/downloads/" + +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="https://github.com/mysql/mysql-server.git" + + inherit git-r3 +else + SRC_URI="https://dev.mysql.com/get/Downloads/MySQL-$(ver_cut 1-2)/mysql-boost-${PV}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + + S="${WORKDIR}/mysql-${PV}" +fi + +LICENSE="GPL-2" +SLOT="0/21" +IUSE="ldap static-libs" + +RDEPEND=" + >=app-arch/lz4-1.9.4:=[${MULTILIB_USEDEP}] + app-arch/zstd:=[${MULTILIB_USEDEP}] + dev-libs/openssl:=[${MULTILIB_USEDEP}] + >=sys-libs/zlib-1.2.13:=[${MULTILIB_USEDEP}] + ldap? ( dev-libs/cyrus-sasl:=[${MULTILIB_USEDEP}] ) +" +DEPEND="${RDEPEND}" +# Avoid file collisions, #692580 +RDEPEND+=" + !<dev-db/mysql-5.6.45-r1 + !=dev-db/mysql-5.7.23* + !=dev-db/mysql-5.7.24* + !=dev-db/mysql-5.7.25* + !=dev-db/mysql-5.7.26-r0 + !=dev-db/mysql-5.7.27-r0 + !<dev-db/percona-server-5.7.26.29-r1 +" + +DOCS=( README ) + +# Wrap the config script +MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config ) + +PATCHES=( + "${FILESDIR}"/${PN}-8.0.36-always-build-decompress-utilities.patch + "${FILESDIR}"/${PN}-8.0.19-do-not-install-comp_err.patch + "${FILESDIR}"/${PN}-8.0.27-res_n.patch +) + +src_prepare() { + sed -i -e 's/CLIENT_LIBS/CONFIG_CLIENT_LIBS/' "scripts/CMakeLists.txt" || die + + # All these are for the server only. + # Disable rpm call which would trigger sandbox, #692368 + sed -i \ + -e '/MYSQL_CHECK_LIBEVENT/d' \ + -e '/MYSQL_CHECK_RAPIDJSON/d' \ + -e '/MYSQL_CHECK_ICU/d' \ + -e '/MYSQL_CHECK_EDITLINE/d' \ + -e '/MYSQL_CHECK_CURL/d' \ + -e '/ADD_SUBDIRECTORY(man)/d' \ + -e '/ADD_SUBDIRECTORY(share)/d' \ + -e '/INCLUDE(cmake\/boost/d' \ + -e 's/MY_RPM rpm/MY_RPM rpmNOTEXISTENT/' \ + CMakeLists.txt || die + + # Skip building clients + echo > client/CMakeLists.txt || die + + # Forcefully disable auth plugin + if ! use ldap ; then + sed -i -e '/MYSQL_CHECK_SASL/d' CMakeLists.txt || die + echo > libmysql/authentication_ldap/CMakeLists.txt || die + fi + + cmake_src_prepare +} + +multilib_src_configure() { + # Code is now requiring C++17 due to + # https://github.com/mysql/mysql-server/commit/236ab55bedd8c9eacd80766d85edde2a8afacd08 + append-cxxflags -std=c++17 + + # LTO leads to double free in mysql-connector-c++ tests + filter-lto + + local mycmakeargs=( + -DCMAKE_C_FLAGS_RELWITHDEBINFO=-DNDEBUG + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-DNDEBUG + -DINSTALL_LAYOUT=RPM + -DINSTALL_LIBDIR=$(get_libdir) + -DWITH_DEFAULT_COMPILER_OPTIONS=OFF + -DENABLED_LOCAL_INFILE=ON + -DMYSQL_UNIX_ADDR="${EPREFIX}/run/mysqld/mysqld.sock" + # Automagically uses LLD with not using LTO (bug #710272, #775845) + -DUSE_LD_LLD=OFF + -DWITH_LZ4=system + -DWITH_NUMA=OFF + -DWITH_SSL=system + -DWITH_ZLIB=system + -DWITH_ZSTD=system + -DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient + -DSHARED_LIB_PATCH_VERSION="0" + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DWITHOUT_SERVER=ON + -DWITH_BUILD_ID=OFF + ) + + cmake_src_configure +} + +multilib_src_install_all() { + doman \ + man/my_print_defaults.1 \ + man/perror.1 \ + man/zlib_decompress.1 + + if ! use static-libs ; then + find "${ED}" -name "*.a" -delete || die + fi +} diff --git a/dev-db/mysql-workbench/Manifest b/dev-db/mysql-workbench/Manifest index 32f99b3ee9b9..97c9e7ecb764 100644 --- a/dev-db/mysql-workbench/Manifest +++ b/dev-db/mysql-workbench/Manifest @@ -5,6 +5,8 @@ DIST antlr-4.11.1-complete.jar 3547867 BLAKE2B 24e9799a402302fd13ebd91028a8e3b81 DIST antlr-4.13.2-complete.jar 2140045 BLAKE2B b810c171c7bcce7e259beda70a2efbee7868188432868953229dd4457f977b162f384823ccce2ac497dd472fe80d05930d28b6eae865b88fd8bc70def86df131 SHA512 22569a011d207fb8f33e7e71162542a5748cc3daa67eec59cbdc2aeb0894c331dfb8b6100ea88529c6cea72672cbddd77ca6134ddf331685d68b3e72b4e0a914 DIST mysql-workbench-community-8.0.38-src.tar.gz 59069184 BLAKE2B ace0afbab46c106200da5234595065766798d97f57008261c166f97bed842f185e1bba90e0c60b9acf4843b54261b5aa49c8a3a6b096e72597443fcb1a011217 SHA512 9fa18d3a66111461dd47dec05ea8dfa214dac85017d51358e694d56cb05439d96a91f675e105cfbecc70c456127964a81ddb2a5a2951457196b20b10dcb6f502 DIST mysql-workbench-community-8.0.40-src.tar.gz 59113554 BLAKE2B 3e0f86015ba6999284c9bee42e01ad2723b7e3292a67311f29bd0dc630b0bb14a82b8cef9509e1809de82b8330f5ea99594c413e347368a0dc26d69c89366021 SHA512 81f2db45f2dba2a546e02b3cb2eb1ab2e0dc142fa76f6579c0b6069e43cbdfe9cb1fb626aac435031e92aa2fa08cc00b311e7737043623b3d12291df48de9779 +DIST mysql-workbench-community-8.0.41-src.tar.gz 59311496 BLAKE2B 0882f9d210dd963ca7094c433ae92fb69534982e576e0c60f87bc551335f92ad522d1226900ad2c79cfe631a0ee11e26513bd0cab7cd97cc60ff2f98a47f65c8 SHA512 5d14b14e4ccb004963a7af470057d9bd779b514609864fdc2b6b181155d2fd948725a4a32e89452596ee685808c25db1915bee83db5a48218e125c18a7523559 EBUILD mysql-workbench-8.0.38.ebuild 2999 BLAKE2B e9e6452fe944e8ae846e8e60f1d9642a268074eccfcdc63637effb1cd77bc253b01d54b1225105180d01a394341cf1c87a5a49a9198546b02ec1b7e55e1f1481 SHA512 f34ec499aca287e946ff01ed51010b5e6a77a4a5a850b935448f8e3f30ff03d5c3f05daa371eb806160100de7f7ad7d61d24a5cc9f9c60c6a7982aa10c324028 EBUILD mysql-workbench-8.0.40.ebuild 3000 BLAKE2B 2506732059ffb12f85341dd21e0550b3e16947d8c1d2c204524063c31a86ebbebb826f2bd1c68faa06d782c2518fa1086cc5c0cbcf4e30a408e67179155c8ff4 SHA512 1450460c1ba62fed9cb2fee891d2ff3e272190a6c01ba7bd421539c0884ffb643c032ba316a858d83ea99c8693f2cd1aa032c1071fdbef2777327bf808f5dfc3 +EBUILD mysql-workbench-8.0.41.ebuild 2939 BLAKE2B 37ba0c6c78871b57f0048ed9858752d0089eaeafd02e2f9bb27efc331e219b59b41c615eaa48ccfda892f9d5d90d78ddab190b6e34058795b50c14e7b6e109a5 SHA512 426e93eda4d9ffd03676ca97a04db6c064e4bc1d51388d03a7dc105da0d87a7b96004046eafdadde34cb05ab2870e4cd7bdef07a242d5e93bdc2bd4ad5fb1514 MISC metadata.xml 312 BLAKE2B 8c491f0d45e24b9e367ef63f8822daf6925a17f8d44ff822b8faf7485f729524de02309b91e18411421b4533aa086853914c4a0b2a93d3fd5573a289fa1e3715 SHA512 01f2f645d167290bdb313e6c1c386b0426b41edd0ee9b50acf538a7353855c84321111ffd11c213c71424c7df73aa48b8fb9f3f2af914b595fb2961cc6b3186c diff --git a/dev-db/mysql-workbench/mysql-workbench-8.0.41.ebuild b/dev-db/mysql-workbench/mysql-workbench-8.0.41.ebuild new file mode 100644 index 000000000000..01b80ca69e97 --- /dev/null +++ b/dev-db/mysql-workbench/mysql-workbench-8.0.41.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +GCONF_DEBUG="no" + +PYTHON_COMPAT=( python3_{10..13} ) +PYTHON_REQ_USE="sqlite" + +ANTLR_VERSION=4.13.2 + +inherit gnome2 flag-o-matic python-single-r1 cmake + +MY_P="${PN}-community-${PV}-src" + +DESCRIPTION="MySQL Workbench" +HOMEPAGE="https://www.mysql.com/products/workbench/" +SRC_URI="https://cdn.mysql.com/Downloads/MySQLGUITools/${MY_P}.tar.gz + https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar" +S="${WORKDIR}"/"${MY_P}" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="debug doc" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +# glibc: deprecated mutex functions, removed in 2.36.0 +CDEPEND="${PYTHON_DEPS} + app-crypt/libsecret + dev-libs/glib:2 + >=dev-cpp/antlr-cpp-4.11.1:4= + dev-cpp/atkmm:* + dev-cpp/pangomm:1.4 + >=dev-cpp/glibmm-2.14:2 + dev-cpp/gtkmm:3.0 + >=net-libs/libssh-0.9.5:=[server] + x11-libs/pango + x11-libs/gtk+:3 + >=x11-libs/cairo-1.5.12[glib,svg(+)] + >=dev-libs/rapidjson-1.1.0 + dev-libs/libsigc++:2 + dev-libs/boost[nls] + >=dev-cpp/ctemplate-0.95 + >=dev-libs/libxml2-2.6.2:2 + dev-libs/libzip:= + dev-libs/libpcre[cxx] + >=sci-libs/gdal-1.11.1-r1:= + virtual/opengl + || ( sys-fs/e2fsprogs dev-libs/ossp-uuid ) + dev-libs/tinyxml[stl] + dev-db/mysql-connector-c:= + >=dev-db/mysql-connector-c++-8.0.27-r1:=[legacy(-)] + dev-db/vsqlite++ + || ( dev-db/libiodbc >=dev-db/unixODBC-2.3.11 ) + dev-python/pexpect + >=dev-python/paramiko-1.7.4 +" + +RDEPEND="${CDEPEND} + app-admin/sudo + >=sys-apps/net-tools-1.60_p20120127084908" + +DEPEND="${CDEPEND} + dev-lang/swig + >=virtual/jre-11 + virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${PN}-6.2.5-wbcopytables.patch" + "${FILESDIR}/${PN}-8.0.19-mysql-connector-8.patch" + "${FILESDIR}/${PN}-8.0.33-gcc13.patch" +) + +src_unpack() { + unpack ${PN}-community-${PV}-src.tar.gz +} + +src_prepare() { + ## And avoid -Werror + sed -i -e 's/-Werror//' CMakeLists.txt || die + ## Fix doc install directory + sed -i -e "/WB_INSTALL_DOC_DIR/ s/mysql-workbench/${P}/ ; /WB_INSTALL_DOC_DIR/ s/-community//" CMakeLists.txt || die + + ## package is very fragile... + strip-flags + + cmake_src_prepare +} + +src_configure() { + # -Werror=odr + # https://bugs.gentoo.org/924671 + # https://bugs.mysql.com/bug.php?id=115735 + filter-lto + + if has_version dev-db/libiodbc ; then + IODBC="-DIODBC_CONFIG_PATH=/usr/bin/iodbc-config" + fi + + if has_version dev-db/unixODBC ; then + UNIXODBC="-DUNIXODBC_CONFIG_PATH=/usr/bin/odbc_config" + fi + + append-cxxflags -std=c++11 + ANTLR_JAR_PATH="${DISTDIR}/antlr-${ANTLR_VERSION}-complete.jar" + local mycmakeargs=( + -DWITH_ANTLR_JAR=${ANTLR_JAR_PATH} + -DLIB_INSTALL_DIR="/usr/$(get_libdir)" + -DIODBC_INCLUDE_PATH="/usr/include/iodbc" + ${IODBC} + ${UNIXODBC} + -DPYTHON_INCLUDE_DIR="$(python_get_includedir)" + -DPYTHON_LIBRARY="$(python_get_library_path)" + -DMySQL_CONFIG_PATH="/usr/bin/mysql_config" + ) + cmake_src_configure +} diff --git a/dev-db/mysql/Manifest b/dev-db/mysql/Manifest index 7ebcf1750085..5576f1df39ca 100644 --- a/dev-db/mysql/Manifest +++ b/dev-db/mysql/Manifest @@ -13,7 +13,9 @@ DIST mysql-8.0.40-patches-01.tar.xz 8356 BLAKE2B ee67f391d7d76e2a49d772a946a0984 DIST mysql-boost-5.7.41.tar.gz 53266489 BLAKE2B 7201d6c53cf711bd121464fc85260e1799f7195f45706b91f3cb8d605fe2bd2639d532b4045a336645a553d9b0b1131cc45140a19483902e5dc37d3e2479b6f5 SHA512 88e1cc4864616ed92880a3f02285763aac2ddfc1cdeeff07e1502c97bbdfd31c9ed9d02f8f6381a352857a85241e4e4eb6bc0d978e3928a68ef49362f670482a DIST mysql-boost-8.0.37.tar.gz 445594692 BLAKE2B 105521985ec8c622a28b5e0f7f13e519b2d91af6ce7c2b483cf1c096aa79f156cc59eabb6281b485d6f558eb6e20a95d5edc349bbd72d1c4a2591eef59270f4c SHA512 4c6033d4f96990d3f324f0d5733273425ddf7cc11660e110e0dc848da6cfa47b7565c1eb0b5d1e08878a0ea2c7d1eb85b400ccca28e5b4383f7e9216ba3e1660 DIST mysql-boost-8.0.40.tar.gz 490502884 BLAKE2B 137a2060ede74449caf6a18dd1b54093668591a592eb0191b436aa289f2faae546eb9d4eaeeef17861a85f3eb34459997fe45c82b21ae07716913e2980c49e4b SHA512 fcece6e3c09dc4733767effb5c22a55e4add1c9f6b6b911e1eccdd0444f08dc5714b3c8b2a40c85a75a63ff117b6c9881904b6b4732b5ca9bef96de1cb2e284a +DIST mysql-boost-8.0.41.tar.gz 488749630 BLAKE2B 4d8c084ec9e95bb6d57573adbb998d4917d76fc77dc599c246b6f2ebbffccd2d2fd1ef8b615caa6bd7d4fa6646b55d5912f98f93d81f64fd4fc4162bf60aa9a2 SHA512 e5bb314082be6bf037808ea7a2130c8e2b44491a6c54bc3f611d823be5285021d05093afca71c3d33da6dece2bac3a8e24da5198080060407d8c4dbfeeea8a99 EBUILD mysql-5.7.41.ebuild 38684 BLAKE2B 49823400f31fb95cd8d0c7cea72899f47c38aaa9b20ec5822c9d68d56d3a2c1afa9df1999619afa4b4e2ff2a3a152b4a76cafe6204f5ae01d6a65e9cf87d5ce2 SHA512 63d34831a768b338fd25806346fa6786cbe0074255f113f5c9f731b0eebb880b73996efb2a53d042d8d57590f93e1bd74e501b2cfb481a632e4ac23f6bca16f0 EBUILD mysql-8.0.37.ebuild 41979 BLAKE2B df16fd4f3c8d052d936703a6917682ba0273509c6fa72a5b1194e15fcb52f718258485d08cd41fe22b6b8d033e520a6c988c951851409dada6aaf37f004fd572 SHA512 de864755fbbb756adb2cae3058a86ec718d42070495520531762843e0bcbcc98c96eeebea97839a55acffc161b951432fc862ac8bfd45aca5d64e0bb74c196b9 -EBUILD mysql-8.0.40.ebuild 42091 BLAKE2B 0170e7ee7058c591a5f45a0c59a028807c9a7d1c631229b9e61cbb71ac09580057fd06a6bbb3218d09b96dcc8af946e9fdc707f29f9791084704793de499eb9c SHA512 962ebbf903ace4b5ceaa86fa987a92de83f3542a822d0d40a674832026e478dcace3dc97a0207d618d8bfa2bba304ae7eecc905b7495673973b5188d13591eda +EBUILD mysql-8.0.40.ebuild 43113 BLAKE2B 56b6872790de9ac70d64157bf1f4ae3efc5e2a1fbbff118e4003aa6b3bbc2a00bd49faac3f114672fe0834d843b46cac4634bb5556f733c774ec2806d0e4f2ac SHA512 d73831695d58c8d8d78e3569d3c4fa3cb2e52b660e804e34a75cc97e38dc39358d9779d1dd616648152e1d8c812316dd27942712b226505fec9ce248c5d11c75 +EBUILD mysql-8.0.41.ebuild 42946 BLAKE2B c35dc927ac4d735d8a3df28923c4b4745f24e835369078363ab5a43542906653ffc913020fcacf24a308315b7895fbada8f1b6a741346971386301109ba7b431 SHA512 ba5c99190b900866136c19e08a27bee6a6bf106ee4ad82d3aed1cf36aca60ba3f6d18bef393da8ccb9283329bd24e94105f6b9e9a1ff99c1a8672a140e0a5919 MISC metadata.xml 1353 BLAKE2B ec0454ffdcce75567e9817fa199f1e6ec1ac73520001c299b794cbfebcd42f9e5abfcf9e6faec47bd0b04f40b03846798f1735e1561c91e4e3c0df48627fe4da SHA512 d5f33d05fd1505d13afa2e968cbfcbe1c6ad6a581468608ed1fd88daf1dd17dd66fbc55b8b6eceb42e2d03bd4327985ff7432c668f983775b103e4375b4ad8c6 diff --git a/dev-db/mysql/mysql-8.0.40.ebuild b/dev-db/mysql/mysql-8.0.40.ebuild index eeffe2b39ec6..5957c41998a9 100644 --- a/dev-db/mysql/mysql-8.0.40.ebuild +++ b/dev-db/mysql/mysql-8.0.40.ebuild @@ -391,15 +391,20 @@ src_test() { einfo "Official test instructions:" einfo "ulimit -n 16500 && USE='perl server' FEATURES='test userpriv' ebuild ..." - if ! use server ; then - ewarn "Skipping server tests due to minimal build!" - return 0 - fi - # Ensure that parallel runs don't die local -x MTR_BUILD_THREAD="$((${RANDOM} % 100))" - local -x MTR_PARALLEL=${MTR_PARALLEL:-$(makeopts_jobs)} + # Use a tmpfs opportunistically, otherwise set MTR_PARALLEL to 1. + # MySQL tests are I/O heavy. They benefit greatly from a tmpfs, parallel tests without a tmpfs are flaky due to timeouts. + if mountpoint -q /dev/shm ; then + local VARDIR="/dev/shm/mysql-var-${MTR_BUILD_THREAD}" + local -x MTR_PARALLEL=${MTR_PARALLEL:-$(makeopts_jobs)} + else + ewarn "/dev/shm not mounted, setting default MTR_PARALLEL to 1. Tests will take a long time" + local VARDIR="${T}/vardir" + # Set it to one while allowing users to override it. + local -x MTR_PARALLEL=${MTR_PARALLEL:-1} + fi einfo "MTR_PARALLEL is set to '${MTR_PARALLEL}'" # Disable unit tests, run them separately with eclass defaults @@ -419,7 +424,7 @@ src_test() { "${FILESDIR}"/my.cnf-8.0.distro-client \ "${FILESDIR}"/my.cnf-8.0.distro-server \ > "${T}"/my.cnf || die - local -X PATH_CONFIG_FILE="${T}/my.cnf" + local -x PATH_CONFIG_FILE="${T}/my.cnf" # Create directories because mysqladmin might run out of order mkdir -p "${T}"/var-tests{,/log} || die @@ -477,6 +482,10 @@ src_test() { "main.slow_log;0;Known failure - no upstream bug yet" "sys_vars.build_id_basic;0;Requires -DWITH_BUILD_ID=ON" + + # Fixed in 8.0.41 + # https://github.com/mysql/mysql-server/commit/8872c9a4530d35ab4299517708208d60b1db04ee + "main.time_zone;0;Relies on deprecated timezone name MET" ) if ! hash zip 1>/dev/null 2>&1 ; then @@ -498,7 +507,7 @@ src_test() { if use debug; then disabled_tests+=( - "innodb.dblwr_unencrypt;0;Known test failure -- no upstream bug yet" + "innodb.dblwr_unencrypt;0;Unstable test" ) fi @@ -572,24 +581,37 @@ src_test() { # Anything touching gtid_executed is negatively affected if you have unlucky ordering nonfatal edo perl mysql-test-run.pl \ --force --force-restart \ - --vardir="${T}/var-tests" --tmpdir="${T}/tmp-tests" \ + --vardir="${VARDIR}" --tmpdir="${T}/tmp-tests" \ --skip-test=tokudb --skip-test-list="${T}/disabled.def" \ - --retry-failure=2 --max-test-fail=0 + --max-test-fail=0 \ + --retry=3 --retry-failure=2 \ + --report-unstable-tests \ + --report-features retstatus_tests=$? + if [[ "${VARDIR}" != "${T}/var-tests" ]]; then + # Move vardir to tempdir. + mv "${VARDIR}" "${T}/var-tests" + # Clean up mysql temporary directory + rm -rf "${VARDIR}" 2>/dev/null + fi + + if [[ "${retstatus_tests}" -ne 0 ]]; then + eerror "Tests failed. When you file a bug, please attach the following items:" + eerror "The file that is created with this command:" + eerror "\t'find ${T}/var-tests -name '*.log' | tar -caf mysql-test-logs.tar.xz --files-from -'" + fi + popd &>/dev/null || die # Cleanup is important for these testcases. pkill -9 -f "${S}/ndb" 2>/dev/null pkill -9 -f "${S}/sql" 2>/dev/null - local failures="" - [[ ${retstatus_tests} -eq 0 ]] || failures="${failures} tests" - # bug #823656 cmake_src_test --test-command "--gtest_death_test_style=threadsafe" - [[ -z "${failures}" ]] || die "Test failures: ${failures}" + [[ "${retstatus_tests}" -ne 0 ]] && die "Test failures: mysql-test-run.pl" einfo "Tests successfully completed" } diff --git a/dev-db/mysql/mysql-8.0.41.ebuild b/dev-db/mysql/mysql-8.0.41.ebuild new file mode 100644 index 000000000000..f87dbab56247 --- /dev/null +++ b/dev-db/mysql/mysql-8.0.41.ebuild @@ -0,0 +1,1310 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit check-reqs cmake edo flag-o-matic linux-info multiprocessing prefix toolchain-funcs + +MY_PV="${PV//_pre*}" +MY_P="${PN}-${MY_PV}" + +# Patch version +PATCH_SET=( https://github.com/parona-source/mysql-server/releases/download/mysql-8.0.40-patches-01/mysql-8.0.40-patches-01.tar.xz ) + +DESCRIPTION="A fast, multi-threaded, multi-user SQL database server" +HOMEPAGE="https://www.mysql.com/" +# https://dev.mysql.com/downloads/mysql/ +SRC_URI="https://dev.mysql.com/get/Downloads/MySQL-$(ver_cut 1-2)/mysql-boost-${MY_PV}.tar.gz" +# https://downloads.mysql.com/archives/community/ +SRC_URI+=" https://cdn.mysql.com/archives/mysql-$(ver_cut 1-2)/mysql-boost-${MY_PV}.tar.gz" +SRC_URI+=" ${PATCH_SET[@]}" +# Shorten the path because the socket path length must be shorter than 107 chars +# and we will run a mysql server during test phase +S="${WORKDIR}/mysql" + +LICENSE="GPL-2" +SLOT="8.0" +# -ppc for bug #761715 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips -ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris" +IUSE="cjk cracklib debug jemalloc latin1 numa +perl profiling router selinux +server tcmalloc test test-install" +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + ?? ( tcmalloc jemalloc ) + cjk? ( server ) + jemalloc? ( server ) + numa? ( server ) + profiling? ( server ) + router? ( server ) + tcmalloc? ( server ) + test? ( server ) + test-install? ( server ) +" + +# Be warned, *DEPEND are version-dependent +# These are used for both runtime and compiletime +COMMON_DEPEND=" + >=app-arch/lz4-1.9.4:= + >=app-arch/zstd-1.2.0:= + >=dev-libs/openssl-1.0.0:= + sys-libs/ncurses:= + >=sys-libs/zlib-1.2.13:= + server? ( + dev-libs/icu:= + dev-libs/libevent:=[ssl,threads(+)] + net-libs/libtirpc:= + cjk? ( app-text/mecab ) + jemalloc? ( dev-libs/jemalloc:= ) + kernel_linux? ( + dev-libs/libaio + sys-process/procps + ) + numa? ( sys-process/numactl ) + tcmalloc? ( dev-util/google-perftools:= ) + ) +" + +DEPEND=" + ${COMMON_DEPEND} + server? ( net-libs/rpcsvc-proto ) +" +RDEPEND=" + ${COMMON_DEPEND} + !dev-db/mariadb + !dev-db/mariadb-galera + !dev-db/percona-server + !dev-db/mysql-cluster + !dev-db/mysql:0 + !dev-db/mysql:5.7 + selinux? ( sec-policy/selinux-mysql ) + !prefix? ( + acct-group/mysql + acct-user/mysql + dev-db/mysql-init-scripts + ) + test-install? ( + app-arch/zip + dev-lang/perl + dev-perl/Expect + dev-perl/JSON + sys-libs/timezone-data + ) +" +# For other stuff to bring us in +# dev-perl/DBD-mysql is needed by some scripts installed by MySQL +PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )" + +# https://bugs.gentoo.org/623962 +# tests set TZ for tests leading to failures on musl if sys-libs/timezone-data isnt installed +BDEPEND=" + app-alternatives/yacc + virtual/pkgconfig + test? ( + acct-group/mysql + acct-user/mysql + app-arch/zip + dev-lang/perl + dev-perl/Expect + dev-perl/JSON + sys-libs/timezone-data + ) + +" + +PATCHES=( + "${WORKDIR}"/mysql-patches + # Needed due to bundled boost-1.77, this fix is included in boost-1.81 + "${FILESDIR}"/mysql-8.0.36-boost-clang-fix.patch + # Needed due to bundled boost-1.77, this fix is included in boost-1.79 + "${FILESDIR}"/mysql-8.0.37-fix-bundled-boost.patch + # Needed due to bundled abseil-cpp-20230802, this fix is included in abseil-cpp-20240722 + "${FILESDIR}"/mysql-8.0.37-fix-bundled-abseil.patch + # Needed due to bundled abseil-cpp-20230802, this fix is in no release as of 2025-01-09 + "${FILESDIR}"/mysql-8.0.40-fix-bundled-abseil-gcc15.patch +) + +mysql_init_vars() { + : ${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"} + : ${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} + : ${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} + : ${MY_LOGDIR="${EPREFIX}/var/log/mysql"} + MY_DATADIR="${MY_LOCALSTATEDIR}" + + export MY_SHAREDSTATEDIR MY_SYSCONFDIR + export MY_LOCALSTATEDIR MY_LOGDIR + export MY_DATADIR +} + +pkg_pretend() { + if [[ ${MERGE_TYPE} != binary ]] ; then + if use server ; then + CHECKREQS_DISK_BUILD="3G" + + if has test ${FEATURES} ; then + CHECKREQS_DISK_BUILD="10G" + + if use elibc_musl; then + # <parona@protonmail.com> i've seen it take 17GB on musl with FEATURES="test" USE="perl server" + CHECKREQS_DISK_BUILD="18G" + fi + fi + + check-reqs_pkg_pretend + fi + fi +} + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]] ; then + CHECKREQS_DISK_BUILD="3G" + + if has test ${FEATURES} ; then + CHECKREQS_DISK_BUILD="10G" + + if use elibc_musl; then + # <parona@protonmail.com> i've seen it take 17GB on musl with FEATURES="test" USE="perl server" + CHECKREQS_DISK_BUILD="18G" + fi + + # Bug #213475 - MySQL _will_ object strenuously if your machine is named + # localhost. Also causes weird failures. + [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" + + if ! has userpriv ${FEATURES} ; then + die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." + fi + + local aio_max_nr=$(sysctl -n fs.aio-max-nr 2>/dev/null) + if [[ -z "${aio_max_nr}" || ${aio_max_nr} -lt 250000 ]] ; then + die "FEATURES=test will require fs.aio-max-nr=250000 at minimum!" + fi + + if use latin1 ; then + # Upstream only supports tests with default charset + die "Testing with USE=latin1 is not supported." + fi + fi + + if use kernel_linux && use numa ; then + linux-info_get_any_version + + local CONFIG_CHECK="~NUMA" + + local WARNING_NUMA="\ +This package expects NUMA support in kernel which this system does not have at the moment; \ +Either expect runtime errors, enable NUMA support in kernel or rebuild the package without NUMA support" + + check_extra_config + fi + + use server && check-reqs_pkg_setup + fi +} + +src_unpack() { + unpack ${A} + + mv -f "${WORKDIR}/${MY_P}" "${S}" || die +} + +src_prepare() { + # Avoid rpm call which would trigger sandbox, #692368 + sed -i \ + -e 's/MY_RPM rpm/MY_RPM rpmNONEXISTENT/' \ + CMakeLists.txt || die + + # Remove the centos and rhel selinux policies to support mysqld_safe under SELinux + if [[ -d "${S}/support-files/SELinux" ]] ; then + echo > "${S}/support-files/SELinux/CMakeLists.txt" || die + fi + + # Remove man pages for client-lib tools we don't install + rm \ + man/my_print_defaults.1 \ + man/perror.1 \ + man/zlib_decompress.1 \ + || die + + cmake_src_prepare +} + +src_configure() { + # Bug #114895, bug #110149 + filter-flags "-O" "-O[01]" + + # Code requires C++17 due to https://github.com/mysql/mysql-server/commit/236ab55bedd8c9eacd80766d85edde2a8afacd08 + append-cxxflags -std=c++17 + + # Debug build type used extensively to add preprocessor definitions + use debug && CMAKE_BUILD_TYPE="Debug" + + local mycmakeargs=( + -Wno-dev # less noise + + # Building everything as shared breaks upstream assumptions. + # For example bundled abseil is excpected to be static and is therefore not installed. + # Breaking the assumption leading the mysql to being built against bundled abseil, + # but then dynamically linked against system abseil once installed. + -DBUILD_SHARED_LIBS=OFF + + -DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql" + -DSYSCONFDIR="${EPREFIX}/etc/mysql" + + -DINSTALL_BINDIR=bin + -DINSTALL_DOCDIR=share/doc/${PF} + -DINSTALL_DOCREADMEDIR=share/doc/${PF} + -DINSTALL_INCLUDEDIR=include/mysql + -DINSTALL_INFODIR=share/info + -DINSTALL_LIBDIR=$(get_libdir) + -DINSTALL_MANDIR=share/man + -DINSTALL_PRIV_LIBDIR=$(get_libdir)/mysql/private + -DINSTALL_MYSQLSHAREDIR=share/mysql + -DINSTALL_PLUGINDIR=$(get_libdir)/mysql/plugin + -DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql" + -DINSTALL_SBINDIR=sbin + -DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mysql" + + -DROUTER_INSTALL_PLUGINDIR="$(get_libdir)/mysqlrouter" + -DROUTER_INSTALL_LIBDIR="$(get_libdir)/mysqlrouter/private" + -DROUTER_INSTALL_LOGROTATEDIR="${EPREFIX}/etc/logrotate.d" + -DROUTER_INSTALL_DOCDIR="share/doc/${PF}" + + -DCOMPILATION_COMMENT="Gentoo Linux ${PF}" + -DWITH_UNIT_TESTS=$(usex test ON OFF) + + # Enables -Werror + -DMYSQL_MAINTAINER_MODE=OFF + + # debug hack wrt #497532 + -DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usev !debug '-DNDEBUG' )" + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usev !debug '-DNDEBUG' )" + + # Automagically uses LLD when not using LTO (bug #710272, #775845) + -DUSE_LD_LLD=OFF + + # Causes issues on musl bug #922808 + -DWITH_BUILD_ID=OFF + + # These are installed via dev-db/mysql-connector-c + -DWITHOUT_CLIENTLIBS=YES + + # Using bundled editline to get CTRL+C working + -DWITH_EDITLINE=bundled + -DWITH_ZLIB=system + -DWITH_SSL=system + -DWITH_LIBWRAP=0 + -DENABLED_LOCAL_INFILE=1 + -DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock" + -DWITH_DEFAULT_COMPILER_OPTIONS=0 + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + + -DWITH_CURL=system + -DWITH_BOOST="${S}/boost" + -DWITH_ROUTER=$(usex router ON OFF) + + -DWITH_ICU=system + -DWITH_LZ4=system + # Our dev-libs/rapidjson doesn't carry necessary fixes for std::regex + -DWITH_RAPIDJSON=bundled + -DWITH_ZSTD=system + + # This is the expected location for upstream RPM's and the script will search for location relative to it. + # Other locations will not work. + -DINSTALL_MYSQLTESTDIR=$(usex test-install 'share/mysql-test' 0) + ) + + if tc-is-lto ; then + mycmakeargs+=( -DWITH_LTO=ON ) + else + mycmakeargs+=( -DWITH_LTO=OFF ) + fi + + if [[ -n "${MYSQL_DEFAULT_CHARSET}" && -n "${MYSQL_DEFAULT_COLLATION}" ]] ; then + ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}" + ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}." + ewarn "You MUST file bugs without these variables set." + ewarn "Tests will probably fail!" + + mycmakeargs+=( + -DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET} + -DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION} + ) + elif use latin1 ; then + mycmakeargs+=( + -DDEFAULT_CHARSET=latin1 + -DDEFAULT_COLLATION=latin1_swedish_ci + ) + else + mycmakeargs+=( + -DDEFAULT_CHARSET=utf8mb4 + -DDEFAULT_COLLATION=utf8mb4_0900_ai_ci + ) + fi + + if use server ; then + mycmakeargs+=( + -DWITH_EXTRA_CHARSETS=all + -DWITH_DEBUG=$(usex debug) + -DWITH_MECAB=$(usex cjk system OFF) + -DWITH_LIBEVENT=system + # Cannot handle protobuf >23 bug #912797 + # 05/06/2024: protobuf has been updated, + # but it cannot handle abseil when building against system + # Currently bundles protobuf-25.1 + -DWITH_PROTOBUF=bundled + -DWITH_NUMA=$(usex numa ON OFF) + ) + + if use jemalloc ; then + mycmakeargs+=( -DWITH_JEMALLOC=ON ) + elif use tcmalloc ; then + mycmakeargs+=( -DWITH_TCMALLOC=ON ) + fi + + if use profiling ; then + # Setting to OFF doesn't work: Once set, profiling options will be added + # to `mysqld --help` output via sql/sys_vars.cc causing + # "main.mysqld--help-notwin" test to fail + mycmakeargs+=( -DENABLED_PROFILING=ON ) + fi + + # Storage engines + mycmakeargs+=( + -DWITH_EXAMPLE_STORAGE_ENGINE=0 + -DWITH_ARCHIVE_STORAGE_ENGINE=1 + -DWITH_BLACKHOLE_STORAGE_ENGINE=1 + -DWITH_CSV_STORAGE_ENGINE=1 + -DWITH_FEDERATED_STORAGE_ENGINE=1 + -DWITH_HEAP_STORAGE_ENGINE=1 + -DWITH_INNOBASE_STORAGE_ENGINE=1 + -DWITH_INNODB_MEMCACHED=0 + -DWITH_MYISAMMRG_STORAGE_ENGINE=1 + -DWITH_MYISAM_STORAGE_ENGINE=1 + ) + else + mycmakeargs+=( + -DWITHOUT_SERVER=1 + -DWITH_SYSTEMD=no + ) + fi + + cmake_src_configure +} + +# Official test instructions: +# ulimit -n 16500 && USE='perl server' FEATURES='test userpriv' \ +# ebuild mysql-X.X.XX.ebuild digest clean test install +src_test() { + _disable_test() { + local rawtestname bug reason + rawtestname="${1}" ; shift + bug="${1}" ; shift + reason="${@}" + + ewarn "test '${rawtestname}' disabled: '${reason}' (BUG#${bug})" + echo "${rawtestname} : BUG#${bug} ${reason}" >> "${T}/disabled.def" + } + + local TESTDIR="${BUILD_DIR}/mysql-test" + local retstatus_tests + + einfo "Official test instructions:" + einfo "ulimit -n 16500 && USE='perl server' FEATURES='test userpriv' ebuild ..." + + # Ensure that parallel runs don't die + local -x MTR_BUILD_THREAD="$((${RANDOM} % 100))" + + # Use a tmpfs opportunistically, otherwise set MTR_PARALLEL to 1. + # MySQL tests are I/O heavy. They benefit greatly from a tmpfs, parallel tests without a tmpfs are flaky due to timeouts. + if mountpoint -q /dev/shm ; then + local VARDIR="/dev/shm/mysql-var-${MTR_BUILD_THREAD}" + local -x MTR_PARALLEL=${MTR_PARALLEL:-$(makeopts_jobs)} + else + ewarn "/dev/shm not mounted, setting default MTR_PARALLEL to 1. Tests will take a long time" + local VARDIR="${T}/vardir" + # Set it to one while allowing users to override it. + local -x MTR_PARALLEL=${MTR_PARALLEL:-1} + fi + einfo "MTR_PARALLEL is set to '${MTR_PARALLEL}'" + + # Disable unit tests, run them separately with eclass defaults + local -x MTR_UNIT_TESTS=0 + + # Increase test timeouts + # bug #923649 + # https://github.com/gentoo/gentoo/pull/35002#issuecomment-1926101030 + local -x MTR_SUITE_TIMEOUT=$(( 60 * 40 )) # minutes + local -x MTR_TESTCASE_TIMEOUT=60 # minutes + + # Include config for tests, this is for scenarios where mysql wasn't installed previously or if the + # configuration was from an older version. + sed \ + -e "s/@GENTOO_PORTAGE_EPREFIX@/${EPREFIX}/" \ + -e "s/@DATADIR@/${MY_DATADIR}/" \ + "${FILESDIR}"/my.cnf-8.0.distro-client \ + "${FILESDIR}"/my.cnf-8.0.distro-server \ + > "${T}"/my.cnf || die + local -x PATH_CONFIG_FILE="${T}/my.cnf" + + # Create directories because mysqladmin might run out of order + mkdir -p "${T}"/var-tests{,/log} || die + + # Run mysql tests + pushd "${TESTDIR}" &>/dev/null || die + + touch "${T}/disabled.def" || die + + local -a disabled_tests=( + "auth_sec.atomic_rename_user;103512;Depends on user running test" + "auth_sec.keyring_file_data_qa;0;Won't work with user privileges" + "auth_sec.openssl_without_fips;94718;Known test failure" + + "gis.geometry_class_attri_prop;5452;Known rounding error with latest AMD processors (PS)" + "gis.geometry_property_function_issimple;5452;Known rounding error with latest AMD processors (PS)" + "gis.gis_bugs_crashes;5452;Known rounding error with latest AMD processors (PS)" + "gis.spatial_analysis_functions_buffer;5452;Known rounding error with latest AMD processors (PS)" + "gis.spatial_analysis_functions_centroid;5452;Known rounding error with latest AMD processors (PS)" + "gis.spatial_analysis_functions_distance;5452;Known rounding error with latest AMD processors (PS)" + "gis.spatial_op_testingfunc_mix;5452;Known rounding error with latest AMD processors (PS)" + "gis.spatial_operators_intersection;5452;Known rounding error with latest AMD processors (PS)" + "gis.spatial_utility_function_distance_sphere;5452;Known rounding error with latest AMD processors (PS)" + "gis.spatial_utility_function_simplify;5452;Known rounding error with latest AMD processors (PS)" + "gis.st_symdifference;5452;Known rounding error with latest AMD processors (PS)" + + "main.derived_limit;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.explain_tree;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.gis-precise;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.mysql_load_data_local_dir;0;Known test failure -- no upstream bug yet" + "main.select_icp_mrr;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.subquery_bugs;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.subquery_sj_dupsweed;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.subquery_sj_dupsweed_bka;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.subquery_sj_dupsweed_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.subquery_sj_firstmatch;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.subquery_sj_firstmatch_bka;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.subquery_sj_firstmatch_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.subquery_sj_mat_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.subquery_sj_all_bka_nobnl;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.window_std_var;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.window_std_var_optimized;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "main.with_recursive;0;Known rounding error with latest AMD processors -- no upstream bug yet" + "perfschema.statement_digest_query_sample;0;Test will fail on slow hardware" + + "rpl.rpl_innodb_info_tbl_slave_tmp_tbl_mismatch;0;Unstable test" + "rpl_gtid.rpl_multi_source_mtr_includes;97844;Unstable test" + "main.partition_datatype;0;Unstable test" + + "sys_vars.myisam_data_pointer_size_func;87935;Test will fail on slow hardware" + + "sys_vars.build_id_basic;0;Requires -DWITH_BUILD_ID=ON" + + "main.keyring_migration_password;0;Known test failure -- no upstream bug yet" + "innodb.upgrade_orphan;0;Known test failure -- no upstream bug yet" + ) + + if ! hash zip 1>/dev/null 2>&1 ; then + # No need to force dep app-arch/zip for one test + disabled_tests+=( + "innodb.discarded_partition_create;0;Requires app-arch/zip" + "innodb.partition_upgrade_create;0;Requires app-arch/zip" + ) + fi + + if has_version ">=dev-libs/openssl-3.2" ; then + # https://bugs.mysql.com/bug.php?id=113258 + # Fails still with 8.0.41 + disabled_tests+=( + "rpl.rpl_tlsv13;0;CCM8 ciphers have a lower security level with OpenSSL 3.2" + "auth_sec.wl15800_ciphers_tlsv13;0;CCM8 ciphers have a lower security level with OpenSSL 3.2" + ) + fi + + if use debug; then + disabled_tests+=( + "innodb.dblwr_unencrypt;0;Unstable test" + ) + fi + + local test_infos_str test_infos_arr + for test_infos_str in "${disabled_tests[@]}" ; do + IFS=';' read -r -a test_infos_arr <<< "${test_infos_str}" + + if [[ ${#test_infos_arr[@]} != 3 ]] ; then + die "Invalid test data set, not matching format: ${test_infos_str}" + fi + + _disable_test "${test_infos_arr[0]}" "${test_infos_arr[1]}" "${test_infos_arr[2]}" + done + unset test_infos_str test_infos_arr + + local -a CMAKE_SKIP_TESTS=( + # timing test, can be unreliable + "routertest_harness_net_ts_timer" + + # Could not get local host address: Name or service not known(errno: -2) + "routertest_component_bootstrap" + "routertest_component_bootstrap_account" + "routertest_component_bootstrap_clusterset" + "routertest_component_config_overwrites" + "routertest_component_rest_api_enable" + "routertest_component_routing" + "routertest_component_sd_notify" + "routertest_component_state_file" + "routertest_integration_routing_direct" + "routertest_integration_routing_reuse" + "routertest_integration_routing_sharing" + "routertest_integration_routing_sharing_constrained_pools" + "routertest_integration_routing_sharing_restart" + + # TODO: ??? + "pfs_host-oom" + "pfs_user-oom" + "pfs" + ) + + # Try to increase file limits to increase test coverage + if ! ulimit -n 16500 1>/dev/null 2>&1 ; then + # Upper limit comes from parts.partition_* tests + ewarn "For maximum test coverage, please raise open file limit to 16500 (ulimit -n 16500) before calling the package manager." + + if ! ulimit -n 4162 1>/dev/null 2>&1 ; then + # Medium limit comes from + # '[Warning] Buffered warning: Could not increase number of max_open_files to more than 3000 (request: 4162)' + ewarn "For medium test coverage please raise open file limit to 4162 (ulimit -n 4162) before calling the package manager." + + if ! ulimit -n 3000 1>/dev/null 2>&1 ; then + ewarn "For minimum test coverage, please raise open file limit to 3000 (ulimit -n 3000) before calling the package manager." + else + einfo "Will run test suite with open file limit set to 3000 (minimum test coverage)." + fi + else + einfo "Will run test suite with open file limit set to 4162 (medium test coverage)." + fi + else + einfo "Will run test suite with open file limit set to 16500 (best test coverage)." + fi + + # run mysql-test tests + # Enable force restart to ensure success when tests don't cleanup sufficiently. + # Anything touching gtid_executed is negatively affected if you have unlucky ordering + nonfatal edo perl mysql-test-run.pl \ + --force --force-restart \ + --vardir="${VARDIR}" --tmpdir="${T}/tmp-tests" \ + --skip-test=tokudb --skip-test-list="${T}/disabled.def" \ + --max-test-fail=0 \ + --retry=3 --retry-failure=2 \ + --report-unstable-tests \ + --report-features + retstatus_tests=$? + + if [[ "${VARDIR}" != "${T}/var-tests" ]]; then + # Move vardir to tempdir. + mv "${VARDIR}" "${T}/var-tests" + # Clean up mysql temporary directory + rm -rf "${VARDIR}" 2>/dev/null + fi + + if [[ "${retstatus_tests}" -ne 0 ]]; then + eerror "Tests failed. When you file a bug, please attach the following items:" + eerror "The file that is created with this command:" + eerror "\t'find ${T}/var-tests -name '*.log' | tar -caf mysql-test-logs.tar.xz --files-from -'" + fi + + popd &>/dev/null || die + + # Cleanup is important for these testcases. + pkill -9 -f "${S}/ndb" 2>/dev/null + pkill -9 -f "${S}/sql" 2>/dev/null + + # bug #823656 + cmake_src_test --test-command "--gtest_death_test_style=threadsafe" + + [[ "${retstatus_tests}" -ne 0 ]] && die "Test failures: mysql-test-run.pl" + einfo "Tests successfully completed" +} + +src_install() { + cmake_src_install + + # Make sure the vars are correctly initialized + mysql_init_vars + + # Convenience links + einfo "Making Convenience links for mysqlcheck multi-call binary" + dosym "mysqlcheck" "/usr/bin/mysqlanalyze" + dosym "mysqlcheck" "/usr/bin/mysqlrepair" + dosym "mysqlcheck" "/usr/bin/mysqloptimize" + + # INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir + if [[ -d "${ED}/usr/data" ]] ; then + rm -Rf "${ED}/usr/data" || die + fi + + # Configuration stuff + einfo "Building default configuration ..." + insinto "${MY_SYSCONFDIR#${EPREFIX}}" + [[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf + cp "${FILESDIR}/my.cnf-5.7" "${TMPDIR}/my.cnf" || die + eprefixify "${TMPDIR}/my.cnf" + doins "${TMPDIR}/my.cnf" + insinto "${MY_SYSCONFDIR#${EPREFIX}}/mysql.d" + cp "${FILESDIR}/my.cnf-8.0.distro-client" "${TMPDIR}/50-distro-client.cnf" || die + eprefixify "${TMPDIR}/50-distro-client.cnf" + doins "${TMPDIR}/50-distro-client.cnf" + + mycnf_src="my.cnf-8.0.distro-server" + sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ + "${FILESDIR}/${mycnf_src}" \ + > "${TMPDIR}/my.cnf.ok" || die + + if use prefix ; then + sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \ + "${TMPDIR}/my.cnf.ok" || die + fi + + if use latin1 ; then + sed -i \ + -e "/character-set/s|utf8mb4|latin1|g" \ + "${TMPDIR}/my.cnf.ok" || die + fi + + eprefixify "${TMPDIR}/my.cnf.ok" + + newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf + + #Remove mytop if perl is not selected + [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl && rm -f "${ED}/usr/bin/mytop" + + if use router ; then + rm -rf \ + "${ED}/usr/LICENSE.router" \ + "${ED}/usr/README.router" \ + "${ED}/usr/run" \ + "${ED}/usr/var" \ + || die + fi + + # Kill old libmysqclient_r symlinks if they exist. Time to fix what depends on them. + find "${D}" -name 'libmysqlclient_r.*' -type l -delete || die +} + +pkg_postinst() { + # Make sure the vars are correctly initialized + mysql_init_vars + + # Create log directory securely if it does not exist + # NOTE: $MY_LOGDIR contains $EPREFIX by default + [[ -d "${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${MY_LOGDIR}" + + # Note about configuration change + einfo + elog "This version of ${PN} reorganizes the configuration from a single my.cnf" + elog "to several files in /etc/mysql/mysql.d." + elog "Please backup any changes you made to /etc/mysql/my.cnf" + elog "and add them as a new file under /etc/mysql/mysql.d with a .cnf extension." + elog "You may have as many files as needed and they are read alphabetically." + elog "Be sure the options have the appropriate section headers, i.e. [mysqld]." + einfo + + if [[ -z "${REPLACING_VERSIONS}" ]] ; then + einfo + elog "You might want to run:" + elog " \"emerge --config =${CATEGORY}/${PF}\"" + elog "if this is a new install." + einfo + else + einfo + elog "Upgrade process for ${PN}-8.x has changed. Please read" + elog "https://dev.mysql.com/doc/refman/8.0/en/upgrade-binary-package.html" + einfo + fi +} + +pkg_config() { + _getoptval() { + local section="$1" + local flag="--${2}=" + local extra_options="${3}" + local cmd=( + "${my_print_defaults_binary}" + "${extra_options}" + "${section}" + ) + local results=( $(eval "${cmd[@]}" 2>/dev/null | sed -n "/^${flag}/s,${flag},,gp") ) + + if [[ ${#results[@]} -gt 0 ]] ; then + # When option is set multiple times only return last value + echo "${results[-1]}" + fi + } + + _mktemp_dry() { + # emktemp has no --dry-run option + local template="${1}" + + if [[ -z "${template}" ]] ; then + if [[ -z "${T}" ]] ; then + template="/tmp/XXXXXXX" + else + template="${T}/XXXXXXX" + fi + fi + + local template_wo_X=${template//X/} + local n_X + let n_X=${#template}-${#template_wo_X} + if [[ ${n_X} -lt 3 ]] ; then + echo "${FUNCNAME[0]}: too few X's in template '${template}'" >&2 + return + fi + + local attempts=0 + local character tmpfile + while [[ true ]] ; do + let attempts=attempts+1 + + new_file= + while read -n1 character ; do + if [[ "${character}" == "X" ]] ; then + tmpfile+="${RANDOM:0:1}" + else + tmpfile+="${character}" + fi + done < <(echo -n "${template}") + + if [[ ! -f "${tmpfile}" ]] + then + echo "${tmpfile}" + return + fi + + if [[ ${attempts} -ge 100 ]] ; then + echo "${FUNCNAME[0]}: Cannot create temporary file after 100 attempts." >&2 + return + fi + done + } + + local mysqld_binary="${EROOT}/usr/sbin/mysqld" + if [[ ! -x "${mysqld_binary}" ]] ; then + die "'${mysqld_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local mysql_binary="${EROOT}/usr/bin/mysql" + if [[ ! -x "${mysql_binary}" ]] ; then + die "'${mysql_binary}' not found! Please re-install ${CATEGORY}/${PN}!" + fi + + local my_print_defaults_binary="${EROOT}/usr/bin/my_print_defaults" + if [[ ! -x "${my_print_defaults_binary}" ]] ; then + die "'${my_print_defaults_binary}' not found! Please re-install dev-db/mysql-connector-c!" + fi + + if [[ -z "${MYSQL_USER}" ]] ; then + MYSQL_USER=mysql + if use prefix ; then + MYSQL_USER=$(id -u -n 2>/dev/null) + if [[ -z "${MYSQL_USER}" ]] ; then + die "Failed to determine current username!" + fi + fi + fi + + if [[ -z "${MYSQL_GROUP}" ]] ; then + MYSQL_GROUP=mysql + if use prefix ; then + MYSQL_GROUP=$(id -g -n 2>/dev/null) + if [[ -z "${MYSQL_GROUP}" ]] ; then + die "Failed to determine current user groupname!" + fi + fi + fi + + # my_print_defaults needs to read stuff in $HOME/.my.cnf + local -x HOME="${EROOT}/root" + + # Make sure the vars are correctly initialized + mysql_init_vars + + # Read currently set data directory + MY_DATADIR="$(_getoptval mysqld datadir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + + # Bug #213475 - MySQL _will_ object strenously if your machine is named + # localhost. Also causes weird failures. + [[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" + + if [[ -z "${MY_DATADIR}" ]] ; then + die "Sorry, unable to find MY_DATADIR!" + elif [[ -d "${MY_DATADIR}/mysql" ]] ; then + ewarn "Looks like your data directory '${MY_DATADIR}' is already initialized!" + ewarn "Please rename or delete its content if you wish to initialize a new data directory." + die "${PN} data directory at '${MY_DATADIR}' looks already initialized!" + fi + + MYSQL_TMPDIR="$(_getoptval mysqld tmpdir "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + MYSQL_TMPDIR=${MYSQL_TMPDIR%/} + # These are dir+prefix + MYSQL_LOG_BIN="$(_getoptval mysqld log-bin "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*} + MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log "--defaults-file='${MY_SYSCONFDIR}/my.cnf'")" + MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*} + + # Create missing directories. + # Always check if mysql user can write to directory even if we just + # created directory because a parent directory might be not + # accessible for that user. + PID_DIR="${EROOT}/run/mysqld" + if [[ ! -d "${PID_DIR}" ]] ; then + einfo "Creating ${PN} PID directory '${PID_DIR}' ..." + install -d -m 755 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${PID_DIR}" \ + || die "Failed to create PID directory '${PID_DIR}'!" + fi + + local _pid_dir_testfile="$(_mktemp_dry "${PID_DIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_pid_dir_testfile}" ]] \ + && die "_mktemp_dry() for '${PID_DIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_pid_dir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_pid_dir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]] ; then + die "${MYSQL_USER} user cannot write into PID dir '${PID_DIR}'!" + else + rm "${_pid_dir_testfile}" || die + unset _pid_dir_testfile + fi + + if [[ ! -d "${MY_DATADIR}" ]] ; then + einfo "Creating ${PN} data directory '${MY_DATADIR}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MY_DATADIR}" \ + || die "Failed to create ${PN} data directory '${MY_DATADIR}'!" + fi + + local _my_datadir_testfile="$(_mktemp_dry "${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_datadir_testfile}" ]] \ + && die "_mktemp_dry() for '${MY_DATADIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_datadir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_datadir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]] ; then + die "${MYSQL_USER} user cannot write into data directory '${MY_DATADIR}'!" + else + rm "${_my_datadir_testfile}" || die + unset _my_datadir_testfile + fi + + if [[ -n "${MYSQL_TMPDIR}" && ! -d "${MYSQL_TMPDIR}" ]] ; then + einfo "Creating ${PN} tmpdir '${MYSQL_TMPDIR}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_TMPDIR}" \ + || die "Failed to create ${PN} tmpdir '${MYSQL_TMPDIR}'!" + fi + + if [[ -z "${MYSQL_TMPDIR}" ]] ; then + MYSQL_TMPDIR="$(_mktemp_dry "${EROOT}/tmp/mysqld-tmp.XXXXXXXXX")" + [[ -z "${MYSQL_TMPDIR}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}' failed!" + + mkdir "${MYSQL_TMPDIR}" || die + chown ${MYSQL_USER} "${MYSQL_TMPDIR}" || die + fi + + # Now we need to test MYSQL_TMPDIR... + local _my_tmpdir_testfile="$(_mktemp_dry "${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_tmpdir_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_tmpdir_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_tmpdir_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]] ; then + die "${MYSQL_USER} user cannot write into tmpdir '${MYSQL_TMPDIR}'!" + else + rm "${_my_tmpdir_testfile}" || die + unset _my_tmpdir_testfile + fi + + if [[ -n "${MYSQL_LOG_BIN}" && ! -d "${MYSQL_LOG_BIN}" ]] ; then + einfo "Creating ${PN} log-bin directory '${MYSQL_LOG_BIN}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_LOG_BIN}" \ + || die "Failed to create ${PN} log-bin directory '${MYSQL_LOG_BIN}'" + fi + + if [[ -n "${MYSQL_LOG_BIN}" ]] ; then + local _my_logbin_testfile="$(_mktemp_dry "${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_logbin_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_LOG_BIN}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_logbin_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_logbin_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]] ; then + die "${MYSQL_USER} user cannot write into log-bin directory '${MYSQL_LOG_BIN}'!" + else + rm "${_my_logbin_testfile}" || die + unset _my_logbin_testfile + fi + fi + + if [[ -n "${MYSQL_RELAY_LOG}" && ! -d "${MYSQL_RELAY_LOG}" ]] ; then + einfo "Creating ${PN} relay-log directory '${MYSQL_RELAY_LOG}' ..." + install -d -m 770 -o ${MYSQL_USER} -g ${MYSQL_GROUP} "${MYSQL_RELAY_LOG}" \ + || die "Failed to create ${PN} relay-log directory '${MYSQL_RELAY_LOG}'!" + fi + + if [[ -n "${MYSQL_RELAY_LOG}" ]] ; then + local _my_relaylog_testfile="$(_mktemp_dry "${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX")" + [[ -z "${_my_relaylog_testfile}" ]] \ + && die "_mktemp_dry() for '${MYSQL_RELAY_LOG}/.pkg_config-access-test.XXXXXXXXX' failed!" + + if use prefix ; then + touch "${_my_relaylog_testfile}" &>/dev/null + else + su -s /bin/sh -c "touch ${_my_relaylog_testfile}" ${MYSQL_USER} &>/dev/null + fi + + if [[ $? -ne 0 ]] ; then + die "${MYSQL_USER} user cannot write into relay-log directory '${MYSQL_RELAY_LOG}'!" + else + rm "${_my_relaylog_testfile}" || die + unset _my_relaylog_testfile + fi + fi + + local mysql_install_log="$(_mktemp_dry "${MYSQL_TMPDIR}/install_db.XXXXXXXXX.log")" + if [[ -z "${mysql_install_log}" ]] ; then + die "_mktemp_dry() for '${MYSQL_TMPDIR}/install_db.XXXXXXXXX.log' failed!" + else + # make sure file is writable for MYSQL_USER... + touch "${mysql_install_log}" || die + chown ${MYSQL_USER} "${mysql_install_log}" || die + fi + + local mysqld_logfile="$(_mktemp_dry "${MYSQL_TMPDIR}/install_mysqld.XXXXXXXXX.log")" + if [[ -z "${mysqld_logfile}" ]] ; then + die "_mktemp_dry() for '${MYSQL_TMPDIR}/install_mysqld.XXXXXXXXX.log' failed!" + else + # make sure file is writable for MYSQL_USER... + touch "${mysqld_logfile}" || die + chown ${MYSQL_USER} "${mysqld_logfile}" || die + fi + + echo "" + einfo "Detected settings:" + einfo "==================" + einfo "MySQL User:\t\t\t\t${MYSQL_USER}" + einfo "MySQL Group:\t\t\t\t${MYSQL_GROUP}" + einfo "MySQL DATA directory:\t\t${MY_DATADIR}" + einfo "MySQL TMP directory:\t\t\t${MYSQL_TMPDIR}" + + if [[ -n "${MYSQL_LOG_BIN}" ]] ; then + einfo "MySQL Binary Log File location:\t${MYSQL_LOG_BIN}" + fi + + if [[ -n "${MYSQL_RELAY_LOG}" ]] ; then + einfo "MySQL Relay Log File location:\t${MYSQL_RELAY_LOG}" + fi + + einfo "PID DIR:\t\t\t\t${PID_DIR}" + einfo "Install db log:\t\t\t${mysql_install_log}" + einfo "Install server log:\t\t\t${mysqld_logfile}" + + local -a config_files + + local config_file="${EROOT}/etc/mysql/mysql.d/50-distro-client.cnf" + if [[ -f "${config_file}" ]] ; then + config_files+=( "${config_file}" ) + else + ewarn "Client configuration '${config_file}' not found." + ewarn "Skipping configuration of default authentication plugin for client ..." + fi + + config_file="${EROOT}/etc/mysql/mysql.d/50-distro-server.cnf" + if [[ -f "${config_file}" ]] ; then + config_files+=( "${config_file}" ) + else + ewarn "Server configuration '${config_file}' not found" + ewarn "Skipping configuration of default authentication plugin for mysqld ..." + fi + + if [[ ${#config_files[@]} -gt 0 ]] ; then + if [[ -z "${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" ]] ; then + local user_answer + + echo + einfo "Please select default authentication plugin (enter number or plugin name):" + einfo "1) caching_sha2_password [MySQL 8.0 default]" + einfo "2) mysql_native_password [MySQL 5.7 default]" + einfo + einfo "For details see:" + einfo "https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password" + read -p " >" user_answer + echo + + case "${user_answer}" in + 1|caching_sha2_password) + MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=caching_sha2_password + ;; + 2|mysql_native_password) + MYSQL_DEFAULT_AUTHENTICATION_PLUGIN=mysql_native_password + ;; + '') + die "No authentication plugin selected!" + ;; + *) + die "Authentication plugin '${user_answer}' is unknown/unsupported!" + ;; + esac + + echo "Selected authentication plugin: ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" >> "${mysql_install_log}" + + unset user_answer + fi + + local cfg_option cfg_option_tabs cfg_section + for config_file in "${config_files[@]}" ; do + cfg_option="default-authentication-plugin" + cfg_section="mysqld" + cfg_option_tabs="\t\t" + if [[ "${config_file}" == *client.cnf ]] ; then + cfg_option="default-auth" + cfg_section="client" + cfg_option_tabs="\t\t\t\t" + fi + + if grep -qE "^(loose-)?${cfg_option}\b.*=" "${config_file}" 2>/dev/null ; then + einfo "Ensuring that ${cfg_option} is set to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..." + sed -i \ + -e "s/^\(loose-\)\?${cfg_option}\b.*=.*/loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}/" \ + "${config_file}" || die "Failed to change ${cfg_option} in '${config_file}'!" + else + einfo "Setting ${cfg_option} to '${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}' in '${config_file}' ..." + sed -i \ + -e "/^\[${cfg_section}\]$/a loose-${cfg_option}${cfg_option_tabs}= ${MYSQL_DEFAULT_AUTHENTICATION_PLUGIN}" \ + "${config_file}" || die "Failed to add ${cfg_option} to '${config_file}'!" + fi + done + unset cfg_option cfg_option_tabs cfg_section + fi + unset config_files config_file + + echo + + if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then + local tmp_mysqld_password_source= + + for tmp_mysqld_password_source in mysql client ; do + einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..." + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)" + if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then + if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]] ; then + ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character!" + ewarn "(Do you have multiple password options set?)" + MYSQL_ROOT_PASSWORD= + continue + fi + + einfo "Found password in '${tmp_mysqld_password_source}' section!" + break + fi + done + + # Sometimes --show is required to display passwords in some implementations of my_print_defaults + if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]] ; then + MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)" + fi + + unset tmp_mysqld_password_source + fi + + if [[ -z "${MYSQL_ROOT_PASSWORD}" ]] ; then + local pwd1="a" + local pwd2="b" + + echo + einfo "No password for mysql 'root' user was specified via environment" + einfo "variable MYSQL_ROOT_PASSWORD and no password was found in config" + einfo "file like '${HOME}/.my.cnf'." + einfo "To continue please provide a password for the mysql 'root' user" + einfo "now on console:" + ewarn "NOTE: Please avoid [\"'\\_%] characters in the password!" + read -rsp " >" pwd1 ; echo + + einfo "Retype the password" + read -rsp " >" pwd2 ; echo + + if [[ "x$pwd1" != "x$pwd2" ]] ; then + die "Passwords are not the same!" + fi + + MYSQL_ROOT_PASSWORD="${pwd1}" + unset pwd1 pwd2 + + echo + fi + + local -a mysqld_options + + # Fix bug 446200. Don't reference host my.cnf, needs to come first, + # see http://bugs.mysql.com/bug.php?id=31312 + use prefix && mysqld_options+=( "--defaults-file='${MY_SYSCONFDIR}/my.cnf'" ) + + # Figure out which options we need to disable to do the setup + local helpfile="${TMPDIR}/mysqld-help" + "${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null + + local opt optexp optfull + for opt in host-cache name-resolve networking slave-start \ + federated ssl log-bin relay-log slow-query-log external-locking \ + log-slave-updates \ + ; do + optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}" + grep -E -sq -- "${optexp}" "${helpfile}" && mysqld_options+=( "${optfull}" ) + done + + # Prepare timezones, see + # https://dev.mysql.com/doc/mysql/en/time-zone-support.html + local tz_sql="$(_mktemp_dry "${MYSQL_TMPDIR}/tz.XXXXXXXXX.sql")" + [[ -z "${tz_sql}" ]] \ + && die "_mktemp_dry() for '${MYSQL_TMPDIR}/tz.XXXXXXXXX.sql' failed!" + + echo "USE mysql;" >"${tz_sql}" + "${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" >> "${tz_sql}" 2>/dev/null + if [[ $? -ne 0 ]] ; then + die "mysql_tzinfo_to_sql failed!" + fi + + # --initialize-insecure will not set root password + # --initialize would set a random one in the log which we don't need as we set it ourselves + local cmd=( + "${mysqld_binary}" + "${mysqld_options[@]}" + "--initialize-insecure" + "--init-file='${tz_sql}'" + "--basedir='${EROOT}/usr'" + "--datadir='${MY_DATADIR}'" + "--tmpdir='${MYSQL_TMPDIR}'" + "--log-error='${mysql_install_log}'" + "--user=${MYSQL_USER}" + ) + + einfo "Initializing ${PN} data directory: ${cmd[@]}" + eval "${cmd[@]}" >>"${mysql_install_log}" 2>&1 + + if [[ $? -ne 0 || ! -f "${MY_DATADIR}/mysql.ibd" ]] ; then + grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_install_log}" 1>&2 + die "Failed to initialize ${PN} data directory. Please review '${mysql_install_log}'!" + fi + + rm "${tz_sql}" || die + + local x=${RANDOM} + local socket="${EROOT}${PID_DIR}/mysqld${x}.sock" + local pidfile="${EROOT}${PID_DIR}/mysqld${x}.pid" + unset x + + cmd=( + "${mysqld_binary}" + "${mysqld_options[@]}" + "--basedir='${EROOT}/usr'" + "--datadir='${MY_DATADIR}'" + "--tmpdir='${MYSQL_TMPDIR}'" + --max_allowed_packet=8M + --net_buffer_length=16K + "--socket='${socket}'" + "--pid-file='${pidfile}'" + "--log-error='${mysqld_logfile}'" + "--user=${MYSQL_USER}" + ) + + einfo "Starting mysqld to finalize initialization: ${cmd[@]}" + eval "${cmd[@]}" >>"${mysqld_logfile}" 2>&1 & + + echo -n "Waiting for mysqld to accept connections " + local maxtry=15 + while [[ ! -S "${socket}" && "${maxtry}" -gt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + + if [[ -S "${socket}" ]] ; then + # Even with a socket we don't know if mysqld will abort + # start due to an error so just wait a little bit more... + maxtry=5 + while [[ -S "${socket}" && "${maxtry}" -gt 1 ]] ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + fi + + echo + + if [[ ! -S "${socket}" ]] ; then + grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysqld_logfile}" 1>&2 + die "mysqld was unable to start from initialized data directory. Please review '${mysqld_logfile}'!" + fi + + local mysql_logfile="${TMPDIR}/set_root_pw.log" + touch "${mysql_logfile}" || die + + ebegin "Setting root password" + # Do this from memory, as we don't want clear text passwords in temp files + local sql="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'" + cmd=( + "${mysql_binary}" + --no-defaults + "--socket='${socket}'" + -hlocalhost + "-e \"${sql}\"" + ) + eval "${cmd[@]}" >"${mysql_logfile}" 2>&1 + local rc=$? + eend ${rc} + + if [[ ${rc} -ne 0 ]] ; then + # Poor man's solution which tries to avoid having password + # in log. NOTE: sed can fail if user didn't follow advice + # and included character which will require escaping... + sed -i -e "s/${MYSQL_ROOT_PASSWORD}/*****/" "${mysql_logfile}" 2>/dev/null + + grep -B5 -A999 -iE "(Aborting|ERROR|errno)" "${mysql_logfile}" + die "Failed to set ${PN} root password. Please review '${mysql_logfile}'!" + fi + + # Stop the server + if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then + echo -n "Stopping the server " + pkill -F "${pidfile}" &>/dev/null + + maxtry=10 + while [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; do + maxtry=$((${maxtry}-1)) + echo -n "." + sleep 1 + done + + echo + + if [[ -f "${pidfile}" ]] && pgrep -F "${pidfile}" &>/dev/null ; then + # We somehow failed to stop server. + # However, not a fatal error. Just warn the user. + ewarn "WARNING: mysqld[$(cat "${pidfile}")] is still running!" + fi + fi + + einfo "${PN} data directory at '${MY_DATADIR}' successfully initialized!" +} |