From 286bab57e057c1ab68b34efbee9dd98a7a02d583 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 10 Jul 2026 15:31:00 +0200 Subject: [PATCH 1/3] new(mysql.com/v5_7): MySQL 5.7 legacy line (Top 300 #735) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebased onto main now that the gnu.org/gcc/v8 companion (#13733) has merged — this PR is now a single-file recipe. MySQL 5.7's vendored InnoDB uses pre-C++17 idioms that gcc 12+ rejects, so the linux build pins gnu.org/gcc/v8; darwin uses the system clang. Runtime libstdc++ via gnu.org/gcc/libstdcxx ^14 (forward-compatible with gcc 8's symbols). Closes part of pkgxdev/pantry#99. Co-Authored-By: Claude Opus 4.8 (1M context) --- projects/mysql.com/v5_7/package.yml | 103 ++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 projects/mysql.com/v5_7/package.yml diff --git a/projects/mysql.com/v5_7/package.yml b/projects/mysql.com/v5_7/package.yml new file mode 100644 index 0000000000..cb876e6f14 --- /dev/null +++ b/projects/mysql.com/v5_7/package.yml @@ -0,0 +1,103 @@ +# MySQL 5.7 — legacy line. +# +# 5.7 reached EOL in October 2023 — homebrew dropped its `mysql@5.7` +# formula in 2024. Some legacy applications (Rails 5.x apps, +# WordPress legacy sites, custom replication setups) still pin to +# 5.7 because the 8.0 migration broke their schema or auth modes. +# +# Build is best-effort — 5.7 needs older C++ idioms, boost 1.59, +# OpenSSL 1.0.x patterns. Expect to iterate. +# +# Closes part of pkgxdev/pantry#99 (Top 300 holdout #735). + +distributable: + url: https://cdn.mysql.com/Downloads/MySQL-{{version.marketing}}/mysql-boost-{{version}}.tar.gz + strip-components: 1 + +# Pin to the 5.7.x stream. mysql-server tags use "mysql-5.7.X" format. +versions: + github: mysql/mysql-server/tags + # `github:` mode silently ignores `match:`. Negative lookahead in + # `ignore:` also doesn't work (RE2-like regex, no lookahead). + # Use `transform:` instead — return the stripped 5.7.X version for + # matching tags, undefined for everything else. + transform: | + v => { + const m = v.match(/^mysql-(5\.7\.\d+)$/); + return m ? m[1] : undefined; + } + +platforms: + - linux/x86-64 + - linux/aarch64 + - darwin/x86-64 + - darwin/aarch64 + +dependencies: + unicode.org: '*' + libevent.org: ^2 + openssl.org: ^1.1 + zlib.net: ^1 + curl.se: '*' + thrysoee.dk/editline: '*' + linux: + # Runtime libstdc++. gcc 8 produced older GLIBCXX_3.4.25-ish + # symver references which libstdcxx ^14 (forward-compatible) can + # resolve. Same lockstep rationale as the main mysql recipe + # (PR #13104) — pantry doesn't auto-propagate stdenv.cc.cc.lib + # the way nixpkgs does, so the runtime libstdc++ must be + # explicit. + gnu.org/gcc/libstdcxx: ^14 + +build: + dependencies: + cmake.org: ^3 + gnu.org/bison: '*' + linux: + # MySQL 5.7's vendored InnoDB uses unnamed scoped enums + other + # pre-C++17 idioms that gcc 12+ rejects. Use the dedicated gcc 8 + # recipe (companion PR #13070). Linux only — homebrew's + # mysql@5.7 builds fine on darwin with the system clang (which + # is what pantry uses on darwin too), no gcc pin needed. + gnu.org/gcc/v8: '*' + working-directory: build + script: + # 5.7's bundled boost has the old `cmake_minimum_required` which + # CMake 4.x rejects without the policy floor override. + - run: | + export CMAKE_POLICY_VERSION_MINIMUM=3.5 + cmake .. $ARGS + make --jobs {{ hw.concurrency }} install + env: + ARGS: + - -DCMAKE_INSTALL_PREFIX={{prefix}} + - -DCMAKE_BUILD_TYPE=Release + - -DDOWNLOAD_BOOST=0 + - -DWITH_BOOST=../boost # bundled + - -DWITH_SSL=system + - -DWITH_ZLIB=system + - -DWITH_LIBEVENT=system + - -DWITH_EDITLINE=system + - -DENABLED_LOCAL_INFILE=1 + - -DWITHOUT_TOKUDB=1 + - -DWITHOUT_ROCKSDB=1 + - -DWITHOUT_MROONGA=1 + - -DWITHOUT_SPIDER=1 + # Don't force CXX_STANDARD=17 — the whole point of pinning gcc 8 + # is that 5.7's vendored sources are pre-C++17. Let the gcc 8 + # default (gnu++14) apply, matching homebrew's mysql@5.7 build. + +provides: + - bin/mysql + - bin/mysqld + - bin/mysqldump + - bin/mysqladmin + - bin/mysqlimport + - bin/mysqlcheck + - bin/mysqlshow + - bin/mysqlbinlog + - bin/mysql_secure_installation + - bin/mysql_config + +test: + - mysql --version | grep "5\\.7\\." From 1fa57a27fd99ff174bc8b888f6e51c8208d1b0b6 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Mon, 27 Jul 2026 15:03:45 +0200 Subject: [PATCH 2/3] fix(mysql@5.7): force gcc 8 as the compiler on linux (past brewkit wrappers) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With gcc/v8 #13770 merged, the compiler test passes, but the build then used Clang, not gcc 8: brewkit's toolchain wrappers symlink cc/c++/gcc/g++ all to clang, so cmake auto-detected "Clang 22.1.8". MySQL 5.7's bundled boost 1.59 then fails to compile (clang rejects boost mpl's integral_wrapper.hpp non-type template usage) — the exact reason this recipe pins gcc 8. Point CMAKE_C_COMPILER/CMAKE_CXX_COMPILER straight at the gcc 8 bottle's real binaries (absolute path, bypassing the wrappers). Darwin keeps using system clang (matches homebrew's mysql@5.7). Verified on x86-64: cmake now detects "GNU 8.5.0" and the boost 1.59 sources that failed under clang compile cleanly with gcc 8. Co-Authored-By: Claude Opus 4.8 (1M context) --- projects/mysql.com/v5_7/package.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/projects/mysql.com/v5_7/package.yml b/projects/mysql.com/v5_7/package.yml index cb876e6f14..585cf46e5e 100644 --- a/projects/mysql.com/v5_7/package.yml +++ b/projects/mysql.com/v5_7/package.yml @@ -64,10 +64,27 @@ build: script: # 5.7's bundled boost has the old `cmake_minimum_required` which # CMake 4.x rejects without the policy floor override. + # + # LINUX: force the gcc 8 bottle as the compiler. brewkit's toolchain + # wrappers symlink cc/c++/gcc/g++ ALL to clang, so cmake would + # otherwise detect Clang (not gcc 8) — and MySQL 5.7's bundled + # boost 1.59 / InnoDB then fail (e.g. clang rejects boost mpl's + # `integral_wrapper.hpp` non-type template usage). Point + # CMAKE_C/CXX_COMPILER straight at the gcc 8 bottle's real binaries + # (absolute path, past the wrappers) so the pre-C++17 sources build. + - run: | + export CMAKE_POLICY_VERSION_MINIMUM=3.5 + CC="{{deps.gnu.org/gcc/v8.prefix}}/bin/gcc" + CXX="{{deps.gnu.org/gcc/v8.prefix}}/bin/g++" + cmake .. $ARGS -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" + make --jobs {{ hw.concurrency }} install + if: linux + # DARWIN: system clang builds mysql@5.7 fine (matches homebrew). - run: | export CMAKE_POLICY_VERSION_MINIMUM=3.5 cmake .. $ARGS make --jobs {{ hw.concurrency }} install + if: darwin env: ARGS: - -DCMAKE_INSTALL_PREFIX={{prefix}} From 864035eabc4df826728243125342f807c94362cb Mon Sep 17 00:00:00 2001 From: tannevaled Date: Mon, 27 Jul 2026 15:16:10 +0200 Subject: [PATCH 3/3] =?UTF-8?q?fix(mysql@5.7):=20drop=20darwin=20=E2=80=94?= =?UTF-8?q?=20no=20gcc=208=20there,=20clang=20can't=20build=20boost=201.59?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The macOS builders fail on the same boost 1.59 integral_wrapper.hpp error as linux-with-clang did: MySQL 5.7's bundled boost needs gcc 8, but the gcc/v8 bottle is linux-only (darwin's old-SDK situation makes gcc 8 hard to bring up), so there's no viable darwin compiler for this legacy line. The prior claim that macOS system clang builds mysql@5.7 fine is wrong. Ship linux/x86-64 + linux/aarch64 (both build green with the forced gcc 8), and drop the darwin platforms + darwin build branch. Co-Authored-By: Claude Opus 4.8 (1M context) --- projects/mysql.com/v5_7/package.yml | 43 +++++++++++++---------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/projects/mysql.com/v5_7/package.yml b/projects/mysql.com/v5_7/package.yml index 585cf46e5e..a2e6715967 100644 --- a/projects/mysql.com/v5_7/package.yml +++ b/projects/mysql.com/v5_7/package.yml @@ -27,11 +27,16 @@ versions: return m ? m[1] : undefined; } +# Linux only. MySQL 5.7's bundled boost 1.59 / InnoDB need gcc 8 to +# compile (modern clang rejects boost mpl's integral_wrapper.hpp +# non-type template usage — confirmed on both linux-with-clang and the +# macOS clang builders). The gcc/v8 bottle is itself linux-only (darwin's +# old-SDK situation makes gcc 8 hard to bring up), so there's no viable +# darwin compiler for this legacy line. Ship linux; darwin users needing +# 5.7 are on their own toolchain. platforms: - linux/x86-64 - linux/aarch64 - - darwin/x86-64 - - darwin/aarch64 dependencies: unicode.org: '*' @@ -54,37 +59,27 @@ build: cmake.org: ^3 gnu.org/bison: '*' linux: - # MySQL 5.7's vendored InnoDB uses unnamed scoped enums + other - # pre-C++17 idioms that gcc 12+ rejects. Use the dedicated gcc 8 - # recipe (companion PR #13070). Linux only — homebrew's - # mysql@5.7 builds fine on darwin with the system clang (which - # is what pantry uses on darwin too), no gcc pin needed. + # MySQL 5.7's vendored boost 1.59 + InnoDB use pre-C++17 idioms + # that modern gcc/clang reject. Build with the dedicated gcc 8 + # bottle (which is itself linux-only — see the platforms note). gnu.org/gcc/v8: '*' working-directory: build script: - # 5.7's bundled boost has the old `cmake_minimum_required` which - # CMake 4.x rejects without the policy floor override. - # - # LINUX: force the gcc 8 bottle as the compiler. brewkit's toolchain - # wrappers symlink cc/c++/gcc/g++ ALL to clang, so cmake would - # otherwise detect Clang (not gcc 8) — and MySQL 5.7's bundled - # boost 1.59 / InnoDB then fail (e.g. clang rejects boost mpl's - # `integral_wrapper.hpp` non-type template usage). Point - # CMAKE_C/CXX_COMPILER straight at the gcc 8 bottle's real binaries - # (absolute path, past the wrappers) so the pre-C++17 sources build. + # Force the gcc 8 bottle as the compiler. brewkit's toolchain wrappers + # symlink cc/c++/gcc/g++ ALL to clang, so cmake would otherwise detect + # Clang (not gcc 8) — and MySQL 5.7's bundled boost 1.59 / InnoDB then + # fail (clang rejects boost mpl's `integral_wrapper.hpp` non-type + # template usage). Point CMAKE_C/CXX_COMPILER straight at the gcc 8 + # bottle's real binaries (absolute path, past the wrappers) so the + # pre-C++17 sources build. (5.7's bundled boost also has an old + # `cmake_minimum_required` that CMake 4.x rejects without the policy + # floor override.) - run: | export CMAKE_POLICY_VERSION_MINIMUM=3.5 CC="{{deps.gnu.org/gcc/v8.prefix}}/bin/gcc" CXX="{{deps.gnu.org/gcc/v8.prefix}}/bin/g++" cmake .. $ARGS -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" make --jobs {{ hw.concurrency }} install - if: linux - # DARWIN: system clang builds mysql@5.7 fine (matches homebrew). - - run: | - export CMAKE_POLICY_VERSION_MINIMUM=3.5 - cmake .. $ARGS - make --jobs {{ hw.concurrency }} install - if: darwin env: ARGS: - -DCMAKE_INSTALL_PREFIX={{prefix}}