summaryrefslogtreecommitdiff
path: root/gnu/packages/databases.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2026-05-14 23:44:14 +0900
committerMaxim Cournoyer <maxim@guixotic.coop>2026-05-29 13:20:05 +0900
commit2c79f4d9328dbd703664cc3a2033c0f41575670f (patch)
tree3f3f505758faefb5787028665ff177fada4489a0 /gnu/packages/databases.scm
parentffe6057e2ad8e2457e9988113a6dd89aeb3de4fa (diff)
gnu: mysql: Update to 9.7.0 and make reproducible [security fixes].
Fixes a slew of security vulnerabilities, which can be consulted here: <https://nvd.nist.gov/vuln/search#/nvd/home?cpeFilterMode=cpe&cpeName=cpe:2.3:a:oracle:mysql:5.7.33:*:*:*:-:*:*:*&resultType=records> * gnu/packages/databases.scm (mysql): Remove stale comment. Update to 9.7.0. [source]: Adjust URI. Delete most bundled library sources. [#:tests?]: Set to #f. [#:configure-flags]: Replace -DWITH_SSL=system and -DWITH_ZLIB=system with -DWITH_SYSTEM_LIBS=ON. Add -DWITH_AUTHENTICATION_LDAP=ON, -DWITH_AUTHENTICATION_WEBAUTHN=ON, -DWITH_BENCHMARK=OFF -DWITH_BUILD_ID=OFF, -DWITH_FIDO=system, -DWITH_SYSTEM_LIBS=ON, -DREPRODUCIBLE_BUILD=ON. Set -DINSTALL_INFODIR to share/info. Set -DINSTALL_MYSQLTESTDIR to OFF. Delete -DINSTALL_SCRIPTDIR=bin, -DDEFAULT_CHARSET=utf8, -DDEFAULT_COLLATION=utf8_general_ci and -DINSTALL_SQLBENCHDIR="". [#:phases] {disable-broken-abi-check, fix-permissions}: New phases. [inputs]: Replace boost-for-mysql with boost. Replace openssl-1.1 with openssl. Add curl, cyrus-sasl, icu4c, libedit, libfido2, lz4, mit-krb5, openldap, protobuf and zstd:lib. [license]: Add comment. Fixes: #7500 Fixes: #8897 Change-Id: Ia089e66064406d082de8b17e31ffdca6eaf42449
Diffstat (limited to 'gnu/packages/databases.scm')
-rw-r--r--gnu/packages/databases.scm98
1 files changed, 74 insertions, 24 deletions
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index d379ef05494..dca8b1cf9b1 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -32,7 +32,7 @@
32;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com> 32;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
33;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net> 33;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
34;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com> 34;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
35;;; Copyright © 2018, 2021, 2022, 2023 Maxim Cournoyer <maxim@guixotic.coop> 35;;; Copyright © 2018, 2021-2023, 2026 Maxim Cournoyer <maxim@guixotic.coop>
36;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us> 36;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
37;;; Copyright © 2019 Alex Griffin <a@ajgrf.com> 37;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
38;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com> 38;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
@@ -131,6 +131,7 @@
131 #:use-module (gnu packages guile-xyz) 131 #:use-module (gnu packages guile-xyz)
132 #:use-module (gnu packages icu4c) 132 #:use-module (gnu packages icu4c)
133 #:use-module (gnu packages jemalloc) 133 #:use-module (gnu packages jemalloc)
134 #:use-module (gnu packages kerberos)
134 #:use-module (gnu packages language) 135 #:use-module (gnu packages language)
135 #:use-module (gnu packages libedit) 136 #:use-module (gnu packages libedit)
136 #:use-module (gnu packages libevent) 137 #:use-module (gnu packages libevent)
@@ -147,6 +148,7 @@
147 #:use-module (gnu packages networking) 148 #:use-module (gnu packages networking)
148 #:use-module (gnu packages node) 149 #:use-module (gnu packages node)
149 #:use-module (gnu packages onc-rpc) 150 #:use-module (gnu packages onc-rpc)
151 #:use-module (gnu packages openldap)
150 #:use-module (gnu packages openstack) 152 #:use-module (gnu packages openstack)
151 #:use-module (gnu packages pantheon) 153 #:use-module (gnu packages pantheon)
152 #:use-module (gnu packages parallel) 154 #:use-module (gnu packages parallel)
@@ -175,6 +177,7 @@
175 #:use-module (gnu packages ruby) 177 #:use-module (gnu packages ruby)
176 #:use-module (gnu packages ruby-check) 178 #:use-module (gnu packages ruby-check)
177 #:use-module (gnu packages ruby-xyz) 179 #:use-module (gnu packages ruby-xyz)
180 #:use-module (gnu packages security-token)
178 #:use-module (gnu packages serialization) 181 #:use-module (gnu packages serialization)
179 #:use-module (gnu packages sphinx) 182 #:use-module (gnu packages sphinx)
180 #:use-module (gnu packages ssh) 183 #:use-module (gnu packages ssh)
@@ -1183,50 +1186,81 @@ autocompletion and syntax highlighting.")
1183auto-completion and syntax highlighting.") 1186auto-completion and syntax highlighting.")
1184 (license license:bsd-3))) 1187 (license license:bsd-3)))
1185 1188
1186;; XXX When updating, check whether boost-for-mysql is still needed.
1187;; It might suffice to patch ‘cmake/boost.cmake’ as done in the past.
1188(define-public mysql 1189(define-public mysql
1189 (package 1190 (package
1190 (name "mysql") 1191 (name "mysql")
1191 (version "5.7.33") 1192 (version "9.7.0")
1192 (source (origin 1193 (source (origin
1193 (method url-fetch) 1194 (method url-fetch)
1194 (uri (list (string-append 1195 (uri (list (string-append
1195 "https://dev.mysql.com/get/Downloads/MySQL-" 1196 "https://cdn.mysql.com/Downloads/MySQL-"
1196 (version-major+minor version) "/" 1197 (version-major+minor version) "/"
1197 name "-" version ".tar.gz")
1198 (string-append
1199 "https://downloads.mysql.com/archives/get/file/"
1200 name "-" version ".tar.gz"))) 1198 name "-" version ".tar.gz")))
1201 (sha256 1199 (sha256
1202 (base32 1200 (base32
1203 "1bb343mf7n0qg2qz497gxjsqprygrjz1q1pbz76hgqxnsy08sfxd")))) 1201 "0v9hc8yzp0f5pwl4kr1a8k7lwyf62g95klxb6avfrc2npjx79dbl"))
1202 (modules '((guix build utils)
1203 (ice-9 ftw)
1204 (srfi srfi-26)))
1205 (snippet
1206 #~(begin
1207 (define (delete-all-but directory . preserve)
1208 (with-directory-excursion directory
1209 (let* ((pred (negate (cut member <>
1210 (cons* "." ".." preserve))))
1211 (items (scandir "." pred)))
1212 (for-each (cut delete-file-recursively <>) items))))
1213
1214 ;; Delete bundled source libraries.
1215 (delete-all-but "extra"
1216 ;; XXX: The build system doesn't currently
1217 ;; support unbundling these.
1218 "json" ;used by bundled opentelemetry
1219 "libbacktrace"
1220 "libcno"
1221 "opentelemetry-cpp"
1222 "opentelemetry-proto"
1223 "rapidjson"
1224 "unordered_dense"
1225 "xxhash")))))
1204 (build-system cmake-build-system) 1226 (build-system cmake-build-system)
1205 (arguments 1227 (arguments
1206 (list 1228 (list
1229 #:tests? #f ;FIXME: teach build system to use system googletest
1207 #:configure-flags 1230 #:configure-flags
1208 #~(list "-DBUILD_CONFIG=mysql_release" 1231 #~(list "-DBUILD_CONFIG=mysql_release"
1209 "-DWITH_SSL=system" 1232 "-DWITH_AUTHENTICATION_LDAP=ON"
1210 "-DWITH_ZLIB=system" 1233 "-DWITH_AUTHENTICATION_WEBAUTHN=ON"
1211 "-DDEFAULT_CHARSET=utf8" 1234 "-DWITH_BENCHMARK=OFF"
1212 "-DDEFAULT_COLLATION=utf8_general_ci" 1235 ;; XXX: BUILD_ID is disabled so that the INFO_BIN target is not
1236 ;; run; this target relies on running mysqld before it is
1237 ;; installed, which fails in our case.
1238 "-DWITH_BUILD_ID=OFF"
1239 "-DWITH_FIDO=system"
1240 "-DWITH_SYSTEM_LIBS=ON"
1241 "-DWITH_UNIT_TESTS=OFF" ;avoid bundled googletest
1242 "-DREPRODUCIBLE_BUILD=ON"
1213 "-DMYSQL_DATADIR=/var/lib/mysql" 1243 "-DMYSQL_DATADIR=/var/lib/mysql"
1214 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock" 1244 "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
1215 "-DINSTALL_INFODIR=share/mysql/docs" 1245 "-DINSTALL_INFODIR=share/info"
1216 "-DINSTALL_MANDIR=share/man" 1246 "-DINSTALL_MANDIR=share/man"
1217 "-DINSTALL_PLUGINDIR=lib/mysql/plugin" 1247 "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
1218 "-DINSTALL_SCRIPTDIR=bin"
1219 "-DINSTALL_INCLUDEDIR=include/mysql" 1248 "-DINSTALL_INCLUDEDIR=include/mysql"
1220 "-DINSTALL_DOCREADMEDIR=share/mysql/docs" 1249 "-DINSTALL_DOCREADMEDIR=share/mysql/docs"
1221 "-DINSTALL_SUPPORTFILESDIR=share/mysql" 1250 "-DINSTALL_SUPPORTFILESDIR=share/mysql"
1222 "-DINSTALL_MYSQLSHAREDIR=share/mysql" 1251 "-DINSTALL_MYSQLSHAREDIR=share/mysql"
1252 "-DINSTALL_MYSQLTESTDIR=OFF"
1223 "-DINSTALL_DOCDIR=share/mysql/docs" 1253 "-DINSTALL_DOCDIR=share/mysql/docs"
1224 "-DINSTALL_SHAREDIR=share/mysql" 1254 "-DINSTALL_SHAREDIR=share/mysql")
1225 ;; Get rid of test data.
1226 "-DINSTALL_MYSQLTESTDIR="
1227 "-DINSTALL_SQLBENCHDIR=")
1228 #:phases 1255 #:phases
1229 #~(modify-phases %standard-phases 1256 #~(modify-phases %standard-phases
1257 (add-before 'configure 'disable-broken-abi-check
1258 (lambda _
1259 ;; The ABI check started failing with MySQL 9.7.0 for unknown
1260 ;; reasons.
1261 (substitute* "cmake/abi_check.cmake"
1262 (("RUN_ABI_CHECK 1")
1263 "RUN_ABI_CHECK 0"))))
1230 (add-after 'install 'remove-extra-binaries 1264 (add-after 'install 'remove-extra-binaries
1231 (lambda _ 1265 (lambda _
1232 ;; Remove the 3 *_embedded files, which weigh in at 1266 ;; Remove the 3 *_embedded files, which weigh in at
@@ -1253,30 +1287,46 @@ auto-completion and syntax highlighting.")
1253 (dirname coreutils) 1287 (dirname coreutils)
1254 (dirname grep) 1288 (dirname grep)
1255 (dirname ps) 1289 (dirname ps)
1256 (dirname sed)))))))))) 1290 (dirname sed)))))))
1291 (add-after 'install 'fix-permissions
1292 ;; XXX: Otherwise, the guix daemon reports: "suspicious ownership
1293 ;; or permission on `/gnu/store/...-mysql-9.7.0'; rejecting this
1294 ;; build output".
1295 (lambda _
1296 (chmod #$output #o755))))))
1257 (native-inputs 1297 (native-inputs
1258 (list bison perl pkg-config)) 1298 (list bison perl pkg-config))
1259 (inputs 1299 (inputs
1260 (list bash-minimal 1300 (list bash-minimal
1261 boost-for-mysql 1301 boost
1262 coreutils 1302 coreutils
1303 curl
1304 cyrus-sasl
1263 gawk 1305 gawk
1264 grep 1306 grep
1307 icu4c
1265 libaio 1308 libaio
1309 libedit
1310 libfido2
1266 libtirpc 1311 libtirpc
1312 lz4
1313 mit-krb5
1267 ncurses 1314 ncurses
1268 openssl-1.1 1315 openldap
1316 openssl
1317 protobuf
1269 procps 1318 procps
1270 rpcsvc-proto ; rpcgen 1319 rpcsvc-proto ; rpcgen
1271 sed 1320 sed
1272 zlib)) 1321 zlib
1322 `(,zstd "lib")))
1273 (home-page "https://www.mysql.com/") 1323 (home-page "https://www.mysql.com/")
1274 (synopsis "Fast, easy to use, and popular database") 1324 (synopsis "Fast, easy to use, and popular database")
1275 (description 1325 (description
1276 "MySQL is a fast, reliable, and easy to use relational database 1326 "MySQL is a fast, reliable, and easy to use relational database
1277management system that supports the standardized Structured Query 1327management system that supports the standardized Structured Query
1278Language.") 1328Language.")
1279 (license license:gpl2))) 1329 (license license:gpl2))) ;v2 only -- see 'Election of GPLv2' in LICENSE
1280 1330
1281(define-public mysql-connector-python 1331(define-public mysql-connector-python
1282 (package 1332 (package