From ea7b98683c13a79ad732715c49a1e14a13f2caed Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Wed, 12 Jun 2024 07:59:42 +0200 Subject: [PATCH] Rebase to 10.11.9 --- mariadb-fmt_bundle.patch | 16 --------- mariadb-libfmt.patch | 31 ++++++++++++++++ mariadb.spec | 32 ++++++++++++++--- sources | 4 +-- ...096f93b7f130b36f8bc0fc43440db9a848e4.patch | 36 +++++++++---------- 5 files changed, 78 insertions(+), 41 deletions(-) delete mode 100644 mariadb-fmt_bundle.patch create mode 100644 mariadb-libfmt.patch diff --git a/mariadb-fmt_bundle.patch b/mariadb-fmt_bundle.patch deleted file mode 100644 index a988598..0000000 --- a/mariadb-fmt_bundle.patch +++ /dev/null @@ -1,16 +0,0 @@ -Currently, the CMAKE script is able to aither use the system library, or download a bundle. -We don't have FMT as a system library in RHEL, and we can't *download* a bundle during build time. -So we download the bundle ourselves, add it as additional package sources, and redirect the CMAKE -so it would search for it on the correct - local - location. - ---- mariadb-10.11.6/cmake/libfmt.cmake 2023-11-08 16:51:39.000000000 +0100 -+++ mariadb-10.11.6/cmake/libfmt.cmake_patched 2024-01-10 17:29:18.004421343 +0100 -@@ -15,7 +15,7 @@ MACRO(BUNDLE_LIBFMT) - ExternalProject_Add( - libfmt - PREFIX "${dir}" -- URL "https://github.com/fmtlib/fmt/archive/refs/tags/8.0.1.zip" -+ URL "${CMAKE_BINARY_DIR}/bundles/8.0.1.zip" - URL_MD5 e77873199e897ca9f780479ad68e25b1 - INSTALL_COMMAND "" - CONFIGURE_COMMAND "" diff --git a/mariadb-libfmt.patch b/mariadb-libfmt.patch new file mode 100644 index 0000000..d5dabf1 --- /dev/null +++ b/mariadb-libfmt.patch @@ -0,0 +1,31 @@ +MariaDB upstream uses an old version (8.0) of the FMT library, unlike Fedora which packs a current one (10.2) + https://src.fedoraproject.org/rpms/fmt + https://github.com/MariaDB/server/blob/10.11/cmake/libfmt.cmake#L18 + +There is a breaking change between the FMT library version 8 and 10. +Sergei Golubchik from MariaDB upstream noticed that and decided to not rebase to the newer version for now. In the same commit: + https://github.com/MariaDB/server/commit/b5c367cd88e37091ab5f8dab0396c01c97d037e2 +He also fixed the CMake file controlling the FMT library. +It now correctly detects, whether the system version is able to compile a given code in an expected way. + +The incompatibility between FMT library version has been reported both agains Fedora and FMT upstream + https://bugzilla.redhat.com/show_bug.cgi?id=2266807 +The upstream created a patch and Fedora backported it + https://src.fedoraproject.org/rpms/fmt/c/7d6d6e2c33e845b3cbf3fcaf83f14dfeddfa8a70?branch=rawhide +but only in F40 and later. + +To avoid potential issues on systems with FMT library between 8.0 and the one with the fix backported, +introduce a bundling mechanism for use on such distributions. +We pre-download the sources archive and supply the CMake with it, instead of the web URL. + +--- mariadb-10.11.7/cmake/libfmt.cmake 2024-02-01 18:44:35.000000000 +0100 ++++ mariadb-10.11.7/cmake/libfmt.cmake_patched 2024-06-06 23:27:10.770987424 +0200 +@@ -15,7 +15,7 @@ MACRO(BUNDLE_LIBFMT) + ExternalProject_Add( + libfmt + PREFIX "${dir}" +- URL "https://github.com/fmtlib/fmt/releases/download/11.0.1/fmt-11.0.1.zip" ++ URL "file:///${dir}/fmt-11.0.1.zip" + URL_MD5 5f3915e2eff60e7f70c558120592100d + INSTALL_COMMAND "" + CONFIGURE_COMMAND "" diff --git a/mariadb.spec b/mariadb.spec index 2dbba4e..a7836de 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -112,7 +112,14 @@ ExcludeArch: %{ix86} %bcond_without unbundled_pcre %else %bcond_with unbundled_pcre -%global pcre_bundled_version 10.42 +%global pcre_bundled_version 10.44 +%endif + +# To avoid issues with a breaking change in FMT library, bundle it on systems where FMT wasn't fixed yet +# See mariadb-libfmt.patch for detailed description. +%bcond_without bundled_fmt +%if %{with bundled_fmt} +%global fmt_bundled_version 11.0.1 %endif # Use main python interpretter version @@ -150,7 +157,7 @@ ExcludeArch: %{ix86} %global sameevr %{epoch}:%{version}-%{release} Name: mariadb -Version: 10.11.6 +Version: 10.11.9 Release: 1%{?with_debug:.debug}%{?dist} Epoch: 3 @@ -160,7 +167,9 @@ URL: http://mariadb.org License: GPLv2 with exceptions and LGPLv2 and BSD Source0: https://downloads.mariadb.org/interstitial/mariadb-%{version}/source/mariadb-%{version}.tar.gz -Source1: https://github.com/fmtlib/fmt/archive/refs/tags/8.0.1.zip +%if %{with bundled_fmt} +Source1: https://github.com/fmtlib/fmt/releases/download/%{fmt_bundled_version}/fmt-%{fmt_bundled_version}.zip +%endif Source2: mysql_config_multilib.sh Source3: my.cnf.in Source6: README.mysql-docs @@ -218,7 +227,8 @@ Patch16: %{pkgnamepatch}-auth_pam_tool_dir.patch # Patch17: Revert of an upstream commit Patch17: upstream_5cc2096f93b7f130b36f8bc0fc43440db9a848e4.patch -Patch11: %{pkgnamepatch}-fmt_bundle.patch +# Patch13: bundle the FMT library +Patch13: %{pkgnamepatch}-libfmt.patch BuildRequires: cmake gcc-c++ BuildRequires: multilib-rpm-config @@ -449,6 +459,8 @@ Recommends: %{name}-backup%{?_isa} = %{sameevr} %{?with_connect:Suggests: %{name}-connect-engine%{?_isa} = %{sameevr}} %{?with_pam:Suggests: %{name}-pam%{?_isa} = %{sameevr}} +%{?with_bundled_fmt:Provides: bundled(fmt) = %{fmt_bundled_version}} + Suggests: mytop Suggests: logrotate @@ -732,6 +744,11 @@ rm -r extra/wolfssl rm -r storage/columnstore rm -r debian +%if %{with bundled_fmt} +mkdir -p redhat-linux-build/extra/libfmt/ +cp %{SOURCE1} redhat-linux-build/extra/libfmt/ +%endif + # Remove JAR files that upstream puts into tarball find . -name "*.jar" -type f -exec rm --verbose -f {} \; # Remove testsuite for the mariadb-connector-c @@ -744,7 +761,9 @@ rm -r storage/rocksdb/ %patch4 -p1 %patch7 -p1 %patch9 -p1 -%patch11 -p1 +%if %{with bundled_fmt} +%patch -P13 -p1 +%endif # The test in Patch 10 has been recently updated by upstream # and the test was disabled in the testuite run # main.ssl_cipher [ disabled ] MDEV-17184 - Failures with OpenSSL 1.1.1 @@ -1662,6 +1681,9 @@ fi %endif %changelog +* Tue Aug 13 2024 Michal Schorm - 3:10.11.9-1 +- Rebase to 10.11.9 + * Mon Dec 18 2023 Michal Schorm - 3:10.11.6-1 - Rebase to 10.11.6 diff --git a/sources b/sources index e06df4d..9f26238 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (mariadb-10.11.6.tar.gz) = 3d77f7be4a26d5a36af56150a5f8ed5e21adeed9bc8ea1bd694e47a25a571bd73468eada7c96e0dfe5a6c81bef625abf71a56d228cf43a738e555e3c0d824a6a -SHA512 (8.0.1.zip) = 53f781e33ffb3bc38d743b81c5755a7d71dce95dcf5cdf23d5b4cf880a8f29189ca1b790272ee8586cbcd552648bae040247e572b2a97cd8b3631c284873f57d +SHA512 (mariadb-10.11.9.tar.gz) = a51680babed106ad52a8a9d57fb1db82fca02fd3eff7ef3f2cc3dd89bd9608e9f78ca5a11335a6be8d22950ca8caf1e859bd19550ab3fe129b73b856674cfdc0 +SHA512 (fmt-11.0.1.zip) = 77aa8371f1cb7f4bbac694fab7612bfba646c9ea784b18f5bfcf84187222e57f60c92f62c30096b9d6d2733790ff0f6ec55d7c024cbbbb3d0c51d9511cc67c19 diff --git a/upstream_5cc2096f93b7f130b36f8bc0fc43440db9a848e4.patch b/upstream_5cc2096f93b7f130b36f8bc0fc43440db9a848e4.patch index 0f104ea..effd1fe 100644 --- a/upstream_5cc2096f93b7f130b36f8bc0fc43440db9a848e4.patch +++ b/upstream_5cc2096f93b7f130b36f8bc0fc43440db9a848e4.patch @@ -299,24 +299,24 @@ index 2001efae3929..6b4d758a5131 100644 { PrintError => 0}) diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index c56cdea470c0..94e577a94a7f 100644 ---- a/scripts/mysqlhotcopy.sh -+++ b/scripts/mysqlhotcopy.sh -@@ -192,12 +192,12 @@ $opt{allowold} = 1 if $opt{keepold}; - my $dsn; - $dsn = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost"); - $dsn .= ";port=$opt{port}" if $opt{port}; --$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; -+$dsn .= ";mariadb_socket=$opt{socket}" if $opt{socket}; - --# use mysql_read_default_group=mysqlhotcopy so that [client] and -+# use mariadb_read_default_group=mysqlhotcopy so that [client] and - # [mysqlhotcopy] groups will be read from standard options files. - --my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy", -+my $dbh = DBI->connect("DBI:MariaDB:$dsn;mariadb_read_default_group=mysqlhotcopy", - $opt{user}, $opt{password}, - { - RaiseError => 1, +#--- a/scripts/mysqlhotcopy.sh +#+++ b/scripts/mysqlhotcopy.sh +#@@ -192,12 +192,12 @@ $opt{allowold} = 1 if $opt{keepold}; +# my $dsn; +# $dsn = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost"); +# $dsn .= ";port=$opt{port}" if $opt{port}; +#-$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket}; +#+$dsn .= ";mariadb_socket=$opt{socket}" if $opt{socket}; +# +#-# use mysql_read_default_group=mysqlhotcopy so that [client] and +#+# use mariadb_read_default_group=mysqlhotcopy so that [client] and +# # [mysqlhotcopy] groups will be read from standard options files. +# +#-my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy", +#+my $dbh = DBI->connect("DBI:MariaDB:$dsn;mariadb_read_default_group=mysqlhotcopy", +# $opt{user}, $opt{password}, +# { +# RaiseError => 1, @@ -796,7 +796,7 @@ sub record_log_pos { my $row_hash = get_row_hash( $dbh, "show slave status" );