diff --git a/.github/autobump.txt b/.github/autobump.txt index ac7b75fa6b4fe..e8193adf65c61 100644 --- a/.github/autobump.txt +++ b/.github/autobump.txt @@ -2438,6 +2438,7 @@ pedump pegtl percona-toolkit percona-xtrabackup +percona-xtrabackup@8.0 periscope perl perl-dbd-mysql diff --git a/Aliases/percona-xtrabackup@8.4 b/Aliases/percona-xtrabackup@8.4 new file mode 120000 index 0000000000000..d685a73201e47 --- /dev/null +++ b/Aliases/percona-xtrabackup@8.4 @@ -0,0 +1 @@ +../Formula/p/percona-xtrabackup.rb \ No newline at end of file diff --git a/Formula/p/percona-xtrabackup.rb b/Formula/p/percona-xtrabackup.rb index 61cde84ae30c0..cdcb7144f3bb2 100644 --- a/Formula/p/percona-xtrabackup.rb +++ b/Formula/p/percona-xtrabackup.rb @@ -1,12 +1,12 @@ class PerconaXtrabackup < Formula desc "Open source hot backup tool for InnoDB and XtraDB databases" homepage "https://www.percona.com/software/mysql-database/percona-xtrabackup" - url "https://downloads.percona.com/downloads/Percona-XtraBackup-LATEST/Percona-XtraBackup-8.0.35-32/source/tarball/percona-xtrabackup-8.0.35-32.tar.gz" - sha256 "04982a36e36d0e9dfb8487afa77329dd0d2d38da163a205f0179635ceea1aff1" + url "https://downloads.percona.com/downloads/Percona-XtraBackup-8.4/Percona-XtraBackup-8.4.0-2/source/tarball/percona-xtrabackup-8.4.0-2.tar.gz" + sha256 "0777e3d3c3b4d4649ed23ed7197ec0aa71379b4a4a41b969b7286f6cf8888b4a" license "GPL-2.0-only" livecheck do - url "https://docs.percona.com/percona-xtrabackup/latest/" + url "https://docs.percona.com/percona-xtrabackup/#{version.major_minor}/" regex(/href=.*?v?(\d+(?:[.-]\d+)+)\.html/i) strategy :page_match do |page, regex| page.scan(regex).map do |match| @@ -18,21 +18,19 @@ class PerconaXtrabackup < Formula end bottle do - rebuild 1 - sha256 arm64_sequoia: "b9bc786870dda248a5015a08f61259c33a7fc94d1f0d9a35e29a8e472bee1d63" - sha256 arm64_sonoma: "c25262ed7de167c267f22163a3adb26003b0b65edfab50e91bb6630f78198042" - sha256 arm64_ventura: "05e87d93c0c563600bc6b07d8cc2e705a51a394f484a98cac7af6e4c4fd7f9a1" - sha256 sonoma: "db880cd44776b88bed474495f27c93a8473a5955794cc9ab9190a5246c046243" - sha256 ventura: "3566ba098d8d1e0ffe534833206710421ce4b5f73861c12bd7257580b4dbf2cd" - sha256 x86_64_linux: "f76e910c33eb583506704b3e9e0ad2824fa4b2662cd9febb9ccf19274f415625" + sha256 arm64_sequoia: "a876081d4bd690db7df164538407227c484282547c2f2b960040ea79d57b233d" + sha256 arm64_sonoma: "0e4dc0dc18abb1b2aa986fa4e3fcb7f806d38681cbf7ac0cb7617f7b1f29483f" + sha256 arm64_ventura: "f527d63a8ba3bfc54aea0923257afcc503419888a26a14313c02739780aa992c" + sha256 sonoma: "916fd8f3057cfa5f1f1a6cde1634757e3a248a4e14e7c5a1addd9196cb5452c9" + sha256 ventura: "d5dfd9b4a66f4f015c92d82b896f140f4d32221ff0ba981726c15c29c77f48f8" + sha256 x86_64_linux: "0caf7c7683ab7a978ffa5926e73ff2b53d762a7e9ff50bac49b1247bec0793a8" end depends_on "bison" => :build # needs bison >= 3.0.4 depends_on "cmake" => :build - depends_on "libevent" => :build depends_on "pkgconf" => :build depends_on "sphinx-doc" => :build - depends_on "mysql@8.0" => :test + depends_on "mysql@8.4" => :test depends_on "icu4c@76" depends_on "libev" depends_on "libgcrypt" @@ -55,16 +53,10 @@ class PerconaXtrabackup < Formula depends_on "procps" end - # https://github.com/percona/percona-xtrabackup/blob/percona-xtrabackup-#{version}/cmake/boost.cmake - resource "boost" do - url "https://downloads.sourceforge.net/project/boost/boost/1.77.0/boost_1_77_0.tar.bz2" - sha256 "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" - end - # Apply fix for newer protobuf from MySQL repo. Remove once Percona syncs with MySQL 8.0.40 / 8.4.3 patch do - url "https://github.com/mysql/mysql-server/commit/269abc0409b22bb87ec88bd4d53dfb7a1403eace.patch?full_index=1" - sha256 "ffcee32804e7e1237907432adb3590fcbf30c625eea836df6760c05a312a84e1" + url "https://github.com/mysql/mysql-server/commit/941e4ac8cfdacc7c2cd1c11b4d72329b70c46564.patch?full_index=1" + sha256 "1c39061a6c90e25a542f547ff8e5463d84c446009b4ab317c2c52184a4f931b8" end # Patch out check for Homebrew `boost`. @@ -76,9 +68,8 @@ def install # Remove bundled libraries other than explicitly allowed below. # `boost` and `rapidjson` must use bundled copy due to patches. # `lz4` is still needed due to xxhash.c used by mysqlgcs - keep = %w[duktape libkmip lz4 rapidjson robin-hood-hashing] + keep = %w[boost libbacktrace libcno libkmip lz4 rapidjson unordered_dense] (buildpath/"extra").each_child { |dir| rm_r(dir) unless keep.include?(dir.basename.to_s) } - (buildpath/"boost").install resource("boost") perl = "/usr/bin/perl" if OS.linux? @@ -104,9 +95,7 @@ def install -DOPENSSL_ROOT_DIR=#{Formula["openssl@3"].opt_prefix} -DWITH_ICU=#{icu4c.opt_prefix} -DWITH_SYSTEM_LIBS=ON - -DWITH_BOOST=#{buildpath}/boost -DWITH_EDITLINE=system - -DWITH_LIBEVENT=system -DWITH_LZ4=system -DWITH_PROTOBUF=system -DWITH_SSL=system @@ -134,7 +123,7 @@ def install end test do - mysql = Formula["mysql@8.0"] + mysql = Formula["mysql@8.4"] common_args = %W[--no-defaults --port=#{free_port} --socket=#{testpath}/mysql.sock] client_args = %w[--user=root --password=] server_args = %W[--datadir=#{testpath}/mysql --tmpdir=#{testpath}/tmp] @@ -169,17 +158,17 @@ def install __END__ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 42e63d0..5d21cc3 100644 +index 438dff720c5..47863c17e23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1942,31 +1942,6 @@ MYSQL_CHECK_RAPIDJSON() +@@ -1948,31 +1948,6 @@ MYSQL_CHECK_RAPIDJSON() MYSQL_CHECK_FIDO() MYSQL_CHECK_FIDO_DLLS() -IF(APPLE) - GET_FILENAME_COMPONENT(HOMEBREW_BASE ${HOMEBREW_HOME} DIRECTORY) - IF(EXISTS ${HOMEBREW_BASE}/include/boost) -- FOREACH(SYSTEM_LIB ICU LIBEVENT LZ4 PROTOBUF ZSTD FIDO) +- FOREACH(SYSTEM_LIB ICU LZ4 PROTOBUF ZSTD FIDO) - IF(WITH_${SYSTEM_LIB} STREQUAL "system") - MESSAGE(FATAL_ERROR - "WITH_${SYSTEM_LIB}=system is not compatible with Homebrew boost\n" @@ -193,7 +182,7 @@ def install - ENDFOREACH() - ENDIF() - # Ensure that we look in /usr/local/include or /opt/homebrew/include -- FOREACH(SYSTEM_LIB ICU LIBEVENT LZ4 PROTOBUF ZSTD FIDO) +- FOREACH(SYSTEM_LIB ICU LZ4 PROTOBUF ZSTD FIDO) - IF(WITH_${SYSTEM_LIB} STREQUAL "system") - INCLUDE_DIRECTORIES(SYSTEM ${HOMEBREW_BASE}/include) - BREAK() @@ -201,6 +190,6 @@ def install - ENDFOREACH() -ENDIF() - - IF(WITH_AUTHENTICATION_FIDO OR WITH_AUTHENTICATION_CLIENT_PLUGINS) + IF(WITH_AUTHENTICATION_WEBAUTHN OR + WITH_AUTHENTICATION_CLIENT_PLUGINS) IF(WITH_FIDO STREQUAL "system" AND - NOT WITH_SSL STREQUAL "system") diff --git a/Formula/p/percona-xtrabackup@8.0.rb b/Formula/p/percona-xtrabackup@8.0.rb new file mode 100644 index 0000000000000..e2a3c372d6c07 --- /dev/null +++ b/Formula/p/percona-xtrabackup@8.0.rb @@ -0,0 +1,212 @@ +class PerconaXtrabackupAT80 < Formula + desc "Open source hot backup tool for InnoDB and XtraDB databases" + homepage "https://www.percona.com/software/mysql-database/percona-xtrabackup" + url "https://downloads.percona.com/downloads/Percona-XtraBackup-8.0/Percona-XtraBackup-8.0.35-32/source/tarball/percona-xtrabackup-8.0.35-32.tar.gz" + sha256 "04982a36e36d0e9dfb8487afa77329dd0d2d38da163a205f0179635ceea1aff1" + license "GPL-2.0-only" + + livecheck do + url "https://docs.percona.com/percona-xtrabackup/#{version.major_minor}/" + regex(/href=.*?v?(\d+(?:[.-]\d+)+)\.html/i) + strategy :page_match do |page, regex| + page.scan(regex).map do |match| + # Convert a version like 1.2.3-4.0 to 1.2.3-4 (but leave a version like + # 1.2.3-4.5 as-is). + match[0].sub(/(-\d+)\.0$/, '\1') + end + end + end + + bottle do + sha256 arm64_sequoia: "e5afd37f5fd4c4f32d8774cdb17d48ffccdbaed1101f8870b3dd327b8eab1dbc" + sha256 arm64_sonoma: "99483ad138428415892749dfbde689af2cd9fcf66e66a4861068349edfb7c7ea" + sha256 arm64_ventura: "79a0f127c6ac44100e902bb0416d191123a829c9b4288f27db14d62de0418432" + sha256 sonoma: "2122b3ef73c7120d2f2a4f4e8d6c2e21838fd4837de8cdff80f3509b78fd32eb" + sha256 ventura: "4c060f49c28ef29a5c97463574cf2822836970bbbc03cec70c2b1ab437890152" + sha256 x86_64_linux: "1ee6bc1d9aabde4fef12b4c0519c8baefaacc43ca9c9f4dd0e7677caf38e353a" + end + + keg_only :versioned_formula + + depends_on "bison" => :build # needs bison >= 3.0.4 + depends_on "cmake" => :build + depends_on "libevent" => :build + depends_on "pkgconf" => :build + depends_on "sphinx-doc" => :build + depends_on "mysql@8.0" => :test + depends_on "icu4c@76" + depends_on "libev" + depends_on "libgcrypt" + depends_on "lz4" + depends_on "openssl@3" + depends_on "perl-dbd-mysql" + depends_on "protobuf" + depends_on "zlib" + depends_on "zstd" + + uses_from_macos "cyrus-sasl" => :build + uses_from_macos "libedit" => :build + uses_from_macos "vim" => :build # needed for xxd + uses_from_macos "curl" + uses_from_macos "perl" + + on_linux do + depends_on "patchelf" => :build + depends_on "libaio" + depends_on "procps" + end + + # Check boost version via `brew livecheck percona-xtrabackup --resources --autobump` + resource "boost" do + url "https://downloads.sourceforge.net/project/boost/boost/1.77.0/boost_1_77_0.tar.bz2" + sha256 "fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854" + + livecheck do + url "https://raw.githubusercontent.com/percona/percona-xtrabackup/refs/tags/percona-xtrabackup-#{LATEST_VERSION}/cmake/boost.cmake" + regex(%r{/release/v?(\d+(?:\.\d+)+)/}i) + end + end + + # Apply fix for newer protobuf from MySQL repo. Remove once Percona syncs with MySQL 8.0.40 + patch do + url "https://github.com/mysql/mysql-server/commit/269abc0409b22bb87ec88bd4d53dfb7a1403eace.patch?full_index=1" + sha256 "ffcee32804e7e1237907432adb3590fcbf30c625eea836df6760c05a312a84e1" + end + + # Patch out check for Homebrew `boost`. + # This should not be necessary when building inside `brew`. + # https://github.com/Homebrew/homebrew-test-bot/pull/820 + patch :DATA + + def install + # Remove bundled libraries other than explicitly allowed below. + # `boost` and `rapidjson` must use bundled copy due to patches. + # `lz4` is still needed due to xxhash.c used by mysqlgcs + keep = %w[duktape libkmip lz4 rapidjson robin-hood-hashing] + (buildpath/"extra").each_child { |dir| rm_r(dir) unless keep.include?(dir.basename.to_s) } + (buildpath/"boost").install resource("boost") + + perl = "/usr/bin/perl" + if OS.linux? + perl = Formula["perl"].opt_bin/"perl" + # Disable ABI checking + inreplace "cmake/abi_check.cmake", "RUN_ABI_CHECK 1", "RUN_ABI_CHECK 0" + end + + # Make sure Perl from `perl-dbd-mysql` is used at runtime. Otherwise may have incompatible modules + inreplace "storage/innobase/xtrabackup/src/backup_copy.cc", 'popen("perl",', "popen(\"#{perl}\"," + + icu4c = deps.map(&:to_formula).find { |f| f.name.match?(/^icu4c@\d+$/) } + # -DWITH_FIDO=system isn't set as feature isn't enabled and bundled copy was removed. + # Formula paths are set to avoid HOMEBREW_HOME logic in CMake scripts + cmake_args = %W[ + -DBUILD_CONFIG=xtrabackup_release + -DCOMPILATION_COMMENT=Homebrew + -DINSTALL_PLUGINDIR=lib/percona-xtrabackup/plugin + -DINSTALL_MANDIR=#{man} + -DWITH_MAN_PAGES=ON + -DINSTALL_MYSQLTESTDIR= + -DBISON_EXECUTABLE=#{Formula["bison"].opt_bin}/bison + -DOPENSSL_ROOT_DIR=#{Formula["openssl@3"].opt_prefix} + -DWITH_ICU=#{icu4c.opt_prefix} + -DWITH_SYSTEM_LIBS=ON + -DWITH_BOOST=#{buildpath}/boost + -DWITH_EDITLINE=system + -DWITH_LIBEVENT=system + -DWITH_LZ4=system + -DWITH_PROTOBUF=system + -DWITH_SSL=system + -DWITH_ZLIB=system + -DWITH_ZSTD=system + ] + # Reduce overlinking on macOS + cmake_args += %w[EXE MODULE].map { |type| "-DCMAKE_#{type}_LINKER_FLAGS=-Wl,-dead_strip_dylibs" } if OS.mac? + + # Remove conflicting manpages + rm (Dir["man/*"] - ["man/CMakeLists.txt"]) + + system "cmake", "-S", ".", "-B", "build", *cmake_args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + bin.env_script_all_files(libexec/"bin", PERL5LIB: Formula["perl-dbd-mysql"].opt_libexec/"lib/perl5") + + # remove conflicting library that is already installed by mysql + (lib/"libmysqlservices.a").unlink + # remove conflicting libraries/headers that are installed by percona-server + (lib/"libkmip.a").unlink + (lib/"libkmippp.a").unlink + (include/"kmip.h").unlink + (include/"kmippp.h").unlink + end + + test do + mysql = Formula["mysql@8.0"] + common_args = %W[--no-defaults --port=#{free_port} --socket=#{testpath}/mysql.sock] + client_args = %w[--user=root --password=] + server_args = %W[--datadir=#{testpath}/mysql --tmpdir=#{testpath}/tmp] + mysqld_args = common_args + server_args + %W[--mysqlx=OFF --user=#{ENV["USER"]}] + mysqladmin_args = common_args + client_args + xtrabackup_args = common_args + client_args + server_args + %W[--target-dir=#{testpath}/backup --backup] + + (testpath/"backup").mkpath + (testpath/"mysql").mkpath + (testpath/"tmp").mkpath + + assert_match version.to_s, shell_output("#{bin}/xtrabackup --version 2>&1") + + output = shell_output("#{bin}/xtrabackup #{xtrabackup_args.join(" ")} 2>&1", 1) + assert_match "Failed to connect to MySQL server", output + + system mysql.bin/"mysqld", *mysqld_args, "--initialize-insecure" + pid = spawn(mysql.bin/"mysqld", *mysqld_args) + begin + sleep 5 + output = shell_output("#{bin}/xtrabackup #{xtrabackup_args.join(" ")} 2>&1") + refute_match "[ERROR]", output + assert_match "[Xtrabackup] completed OK!", output + assert_match "version_check Done.", output # check Perl modules work + assert_path_exists testpath/"backup/xtrabackup_info" + ensure + system mysql.bin/"mysqladmin", *mysqladmin_args, "shutdown" + Process.kill "TERM", pid + end + end +end + +__END__ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 42e63d0..5d21cc3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1942,31 +1942,6 @@ MYSQL_CHECK_RAPIDJSON() + MYSQL_CHECK_FIDO() + MYSQL_CHECK_FIDO_DLLS() + +-IF(APPLE) +- GET_FILENAME_COMPONENT(HOMEBREW_BASE ${HOMEBREW_HOME} DIRECTORY) +- IF(EXISTS ${HOMEBREW_BASE}/include/boost) +- FOREACH(SYSTEM_LIB ICU LIBEVENT LZ4 PROTOBUF ZSTD FIDO) +- IF(WITH_${SYSTEM_LIB} STREQUAL "system") +- MESSAGE(FATAL_ERROR +- "WITH_${SYSTEM_LIB}=system is not compatible with Homebrew boost\n" +- "MySQL depends on ${BOOST_PACKAGE_NAME} with a set of patches.\n" +- "Including headers from ${HOMEBREW_BASE}/include " +- "will break the build.\n" +- "Please use WITH_${SYSTEM_LIB}=bundled\n" +- "or do 'brew uninstall boost' or 'brew unlink boost'" +- ) +- ENDIF() +- ENDFOREACH() +- ENDIF() +- # Ensure that we look in /usr/local/include or /opt/homebrew/include +- FOREACH(SYSTEM_LIB ICU LIBEVENT LZ4 PROTOBUF ZSTD FIDO) +- IF(WITH_${SYSTEM_LIB} STREQUAL "system") +- INCLUDE_DIRECTORIES(SYSTEM ${HOMEBREW_BASE}/include) +- BREAK() +- ENDIF() +- ENDFOREACH() +-ENDIF() +- + IF(WITH_AUTHENTICATION_FIDO OR WITH_AUTHENTICATION_CLIENT_PLUGINS) + IF(WITH_FIDO STREQUAL "system" AND + NOT WITH_SSL STREQUAL "system")