Merge: [Backport release-24.05] percona: update packages, init 8.4 (#346437)

This commit is contained in:
Maximilian Bosch
2024-10-16 17:53:08 +02:00
committed by GitHub
14 changed files with 470 additions and 186 deletions

View File

@@ -117,3 +117,6 @@ fb0e5be84331188a69b3edd31679ca6576edb75a
# python3Packages: format with nixfmt
59b1aef59071cae6e87859dc65de973d2cc595c0
# percona: apply nixfmt
369350afcba8e6a231dd25b6a010c4e9dec713b9

View File

@@ -4,7 +4,7 @@
inherit (pkgs) mysql80;
};
perconaPackages = {
inherit (pkgs) percona-server_lts percona-server_innovation;
inherit (pkgs) percona-server_8_0 percona-server_8_4;
};
mkTestName = pkg: "mariadb_${builtins.replaceStrings ["."] [""] (lib.versions.majorMinor pkg.version)}";
}

View File

@@ -1,21 +1,64 @@
{ lib, stdenv, fetchurl, bison, cmake, pkg-config
, boost, icu, libedit, libevent, lz4, ncurses, openssl, perl, protobuf, re2, readline, zlib, zstd, libfido2
, numactl, cctools, CoreServices, developer_cmds, libtirpc, rpcsvc-proto, curl, DarwinTools, nixosTests
# Percona-specific deps
, coreutils, cyrus_sasl, gnumake, openldap
{
lib,
stdenv,
fetchurl,
bison,
cmake,
pkg-config,
boost,
icu,
libedit,
libevent,
lz4,
ncurses,
openssl,
perl,
protobuf,
re2,
readline,
zlib,
zstd,
libfido2,
numactl,
cctools,
CoreServices,
developer_cmds,
libtirpc,
rpcsvc-proto,
curl,
DarwinTools,
nixosTests,
coreutils,
procps,
gnused,
gnugrep,
hostname,
makeWrapper,
# Percona-specific deps
cyrus_sasl,
gnumake,
openldap,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "percona-server_lts";
version = "8.0.36-28";
pname = "percona-server";
version = "8.0.37-29";
src = fetchurl {
url = "https://www.percona.com/downloads/Percona-Server-8.0/Percona-Server-${finalAttrs.version}/source/tarball/percona-server-${finalAttrs.version}.tar.gz";
hash = "sha256-iktEvZz3mjjmJ16PX51OjSwwiFS3H9W/XRco//Q6aEQ=";
hash = "sha256-zZgq3AxCRYdte3dTUJiuMvVGdl9U01s8jxcAqDxZiNM=";
};
nativeBuildInputs = [ bison cmake pkg-config ]
++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ];
nativeBuildInputs = [
bison
cmake
pkg-config
makeWrapper
# required for scripts/CMakeLists.txt
coreutils
gnugrep
procps
] ++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ];
patches = [
./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch
@@ -32,16 +75,41 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "make --" "${gnumake}/bin/make --"
'';
buildInputs = [
boost (curl.override { inherit openssl; }) icu libedit libevent lz4 ncurses openssl protobuf re2 readline zlib
zstd libfido2 openldap perl cyrus_sasl
] ++ lib.optionals stdenv.isLinux [
numactl libtirpc
] ++ lib.optionals stdenv.isDarwin [
cctools CoreServices developer_cmds DarwinTools
];
buildInputs =
[
boost
(curl.override { inherit openssl; })
icu
libedit
libevent
lz4
ncurses
openssl
protobuf
re2
readline
zlib
zstd
libfido2
openldap
perl
cyrus_sasl
]
++ lib.optionals stdenv.isLinux [
numactl
libtirpc
]
++ lib.optionals stdenv.isDarwin [
cctools
CoreServices
developer_cmds
DarwinTools
];
outputs = [ "out" "static" ];
outputs = [
"out"
"static"
];
cmakeFlags = [
# Percona-specific flags.
@@ -73,6 +141,40 @@ stdenv.mkDerivation (finalAttrs: {
moveToOutput "lib/*.a" $static
so=${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s libmysqlclient$so $out/lib/libmysqlclient_r$so
wrapProgram $out/bin/mysqld_safe --prefix PATH : ${
lib.makeBinPath [
coreutils
procps
gnugrep
gnused
hostname
]
}
wrapProgram $out/bin/mysql_config --prefix PATH : ${
lib.makeBinPath [
coreutils
gnused
]
}
wrapProgram $out/bin/ps_mysqld_helper --prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
wrapProgram $out/bin/ps-admin --prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
wrapProgram $out/bin/mysqld_multi --prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
'';
passthru = {
@@ -88,6 +190,7 @@ stdenv.mkDerivation (finalAttrs: {
description = ''
A free, fully compatible, enhanced, open source drop-in replacement for
MySQL® that provides superior performance, scalability and instrumentation.
Long-term support release.
'';
license = licenses.gpl2;
maintainers = teams.flyingcircus.members;

View File

@@ -0,0 +1,221 @@
{
lib,
stdenv,
fetchurl,
bison,
cmake,
pkg-config,
boost,
icu,
libedit,
libevent,
lz4,
ncurses,
openssl,
perl,
protobuf,
re2,
readline,
zlib,
zstd,
libfido2,
numactl,
cctools,
CoreServices,
developer_cmds,
libtirpc,
rpcsvc-proto,
curl,
DarwinTools,
nixosTests,
coreutils,
procps,
gnused,
gnugrep,
hostname,
makeWrapper,
systemd,
# Percona-specific deps
cyrus_sasl,
gnumake,
openldap,
# optional: different malloc implementations
withJemalloc ? false,
withTcmalloc ? false,
jemalloc,
gperftools,
}:
assert !(withJemalloc && withTcmalloc);
stdenv.mkDerivation (finalAttrs: {
pname = "percona-server";
version = "8.4.0-1";
src = fetchurl {
url = "https://downloads.percona.com/downloads/Percona-Server-${lib.versions.majorMinor finalAttrs.version}/Percona-Server-${finalAttrs.version}/source/tarball/percona-server-${finalAttrs.version}.tar.gz";
hash = "sha256-76PXXqTNBVsD7RX2vhp7RyESiFpJL0h0zG9ucNfy3uQ=";
};
nativeBuildInputs = [
bison
cmake
pkg-config
makeWrapper
# required for scripts/CMakeLists.txt
coreutils
gnugrep
procps
] ++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ];
patches = [
./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch
];
## NOTE: MySQL upstream frequently twiddles the invocations of libtool. When updating, you might proactively grep for libtool references.
postPatch = ''
substituteInPlace cmake/libutils.cmake --replace /usr/bin/libtool libtool
substituteInPlace cmake/os/Darwin.cmake --replace /usr/bin/libtool libtool
# The rocksdb setup script is called with `env -i` and cannot find anything in PATH.
patchShebangs storage/rocksdb/get_rocksdb_files.sh
substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace mktemp ${coreutils}/bin/mktemp
substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "rm $MKFILE" "${coreutils}/bin/rm $MKFILE"
substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "make --" "${gnumake}/bin/make --"
'';
buildInputs =
[
boost
(curl.override { inherit openssl; })
icu
libedit
libevent
lz4
ncurses
openssl
protobuf
re2
readline
zlib
zstd
libfido2
openldap
perl
cyrus_sasl
]
++ lib.optionals stdenv.isLinux [
numactl
libtirpc
systemd
]
++ lib.optionals stdenv.isDarwin [
cctools
CoreServices
developer_cmds
DarwinTools
]
++ lib.optional (stdenv.isLinux && withJemalloc) jemalloc
++ lib.optional (stdenv.isLinux && withTcmalloc) gperftools;
outputs = [
"out"
"static"
];
cmakeFlags =
[
# Percona-specific flags.
"-DPORTABLE=1"
"-DWITH_LDAP=system"
"-DROCKSDB_DISABLE_AVX2=1"
"-DROCKSDB_DISABLE_MARCH_NATIVE=1"
# Flags taken from mysql package.
"-DFORCE_UNSUPPORTED_COMPILER=1" # To configure on Darwin.
"-DWITH_ROUTER=OFF" # It may be packaged separately.
"-DWITH_SYSTEM_LIBS=ON"
"-DWITH_UNIT_TESTS=OFF"
"-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
"-DMYSQL_DATADIR=/var/lib/mysql"
"-DINSTALL_INFODIR=share/mysql/docs"
"-DINSTALL_MANDIR=share/man"
"-DINSTALL_PLUGINDIR=lib/mysql/plugin"
"-DINSTALL_INCLUDEDIR=include/mysql"
"-DINSTALL_DOCREADMEDIR=share/mysql"
"-DINSTALL_SUPPORTFILESDIR=share/mysql"
"-DINSTALL_MYSQLSHAREDIR=share/mysql"
"-DINSTALL_MYSQLTESTDIR="
"-DINSTALL_DOCDIR=share/mysql/docs"
"-DINSTALL_SHAREDIR=share/mysql"
]
++ lib.optionals stdenv.isLinux [
"-DWITH_SYSTEMD=1"
"-DWITH_SYSTEMD_DEBUG=1"
]
++ lib.optional (stdenv.isLinux && withJemalloc) "-DWITH_JEMALLOC=1"
++ lib.optional (stdenv.isLinux && withTcmalloc) "-DWITH_TCMALLOC=1";
postInstall =
''
moveToOutput "lib/*.a" $static
so=${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s libmysqlclient$so $out/lib/libmysqlclient_r$so
wrapProgram $out/bin/mysqld_safe --prefix PATH : ${
lib.makeBinPath [
coreutils
procps
gnugrep
gnused
hostname
]
}
wrapProgram $out/bin/mysql_config --prefix PATH : ${
lib.makeBinPath [
coreutils
gnused
]
}
wrapProgram $out/bin/ps_mysqld_helper --prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
wrapProgram $out/bin/ps-admin --prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
''
+ lib.optionalString stdenv.isDarwin ''
wrapProgram $out/bin/mysqld_multi --prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
]
}
'';
passthru = {
client = finalAttrs.finalPackage;
connector-c = finalAttrs.finalPackage;
server = finalAttrs.finalPackage;
mysqlVersion = lib.versions.majorMinor finalAttrs.version;
tests = nixosTests.mysql.percona-server_innovation;
};
meta = with lib; {
homepage = "https://www.percona.com/software/mysql-database/percona-server";
description = ''
A free, fully compatible, enhanced, open source drop-in replacement for
MySQL® that provides superior performance, scalability and instrumentation.
Long-term support release.
'';
license = licenses.gpl2;
maintainers = teams.flyingcircus.members;
platforms = platforms.unix;
};
})

View File

@@ -1,12 +1,14 @@
pkgs: {
percona-server_lts = pkgs.callPackage ./lts.nix {
# old lts
percona-server_8_0 = pkgs.callPackage ./8_0.nix {
inherit (pkgs.darwin) cctools developer_cmds DarwinTools;
inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices;
boost = pkgs.boost177; # Configure checks for specific version.
icu = pkgs.icu69;
# newer versions cause linking failures against `libabsl_spinlock_wait`
protobuf = pkgs.protobuf_21;
};
percona-server_innovation = pkgs.callPackage ./innovation.nix {
percona-server_8_4 = pkgs.callPackage ./8_4.nix {
inherit (pkgs.darwin) cctools developer_cmds DarwinTools;
inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices;
# newer versions cause linking failures against `libabsl_spinlock_wait`

View File

@@ -1,112 +0,0 @@
{ lib, stdenv, fetchurl, bison, cmake, pkg-config
, boost, icu, libedit, libevent, lz4, ncurses, openssl, perl, protobuf, re2, readline, zlib, zstd, libfido2
, numactl, cctools, CoreServices, developer_cmds, libtirpc, rpcsvc-proto, curl, DarwinTools, nixosTests
, systemd
# Percona-specific deps
, coreutils, cyrus_sasl, gnumake, openldap
# optional: different malloc implementations
, withJemalloc ? false, withTcmalloc ? false, jemalloc, gperftools
}:
assert !(withJemalloc && withTcmalloc);
stdenv.mkDerivation (finalAttrs: {
pname = "percona-server_innovation";
version = "8.3.0-1";
src = fetchurl {
url = "https://downloads.percona.com/downloads/percona-distribution-mysql-ps/percona-distribution-mysql-ps-${builtins.head (lib.strings.split "-" finalAttrs.version)}/source/tarball/percona-server-${finalAttrs.version}.tar.gz";
hash = "sha256-GeuifzqCkStmb4qYa8147XBHvMogYwfsn0FyHdO4WEg";
};
nativeBuildInputs = [ bison cmake pkg-config ]
++ lib.optionals (!stdenv.isDarwin) [ rpcsvc-proto ];
patches = [
./no-force-outline-atomics.patch # Do not force compilers to turn on -moutline-atomics switch
];
## NOTE: MySQL upstream frequently twiddles the invocations of libtool. When updating, you might proactively grep for libtool references.
postPatch = ''
substituteInPlace cmake/libutils.cmake --replace /usr/bin/libtool libtool
substituteInPlace cmake/os/Darwin.cmake --replace /usr/bin/libtool libtool
# The rocksdb setup script is called with `env -i` and cannot find anything in PATH.
patchShebangs storage/rocksdb/get_rocksdb_files.sh
substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace mktemp ${coreutils}/bin/mktemp
substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "rm $MKFILE" "${coreutils}/bin/rm $MKFILE"
substituteInPlace storage/rocksdb/get_rocksdb_files.sh --replace "make --" "${gnumake}/bin/make --"
'';
buildInputs = [
boost (curl.override { inherit openssl; }) icu libedit libevent lz4 ncurses openssl protobuf re2 readline zlib
zstd libfido2 openldap perl cyrus_sasl
] ++ lib.optionals stdenv.isLinux [
numactl libtirpc systemd
] ++ lib.optionals stdenv.isDarwin [
cctools CoreServices developer_cmds DarwinTools
]
++ lib.optional (stdenv.isLinux && withJemalloc) jemalloc
++ lib.optional (stdenv.isLinux && withTcmalloc) gperftools;
outputs = [ "out" "static" ];
cmakeFlags = [
# Percona-specific flags.
"-DPORTABLE=1"
"-DWITH_LDAP=system"
"-DROCKSDB_DISABLE_AVX2=1"
"-DROCKSDB_DISABLE_MARCH_NATIVE=1"
# Flags taken from mysql package.
"-DFORCE_UNSUPPORTED_COMPILER=1" # To configure on Darwin.
"-DWITH_ROUTER=OFF" # It may be packaged separately.
"-DWITH_SYSTEM_LIBS=ON"
"-DWITH_UNIT_TESTS=OFF"
"-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
"-DMYSQL_DATADIR=/var/lib/mysql"
"-DINSTALL_INFODIR=share/mysql/docs"
"-DINSTALL_MANDIR=share/man"
"-DINSTALL_PLUGINDIR=lib/mysql/plugin"
"-DINSTALL_INCLUDEDIR=include/mysql"
"-DINSTALL_DOCREADMEDIR=share/mysql"
"-DINSTALL_SUPPORTFILESDIR=share/mysql"
"-DINSTALL_MYSQLSHAREDIR=share/mysql"
"-DINSTALL_MYSQLTESTDIR="
"-DINSTALL_DOCDIR=share/mysql/docs"
"-DINSTALL_SHAREDIR=share/mysql"
] ++ lib.optionals stdenv.isLinux [
"-DWITH_SYSTEMD=1"
"-DWITH_SYSTEMD_DEBUG=1"
]
++ lib.optional (stdenv.isLinux && withJemalloc) "-DWITH_JEMALLOC=1"
++ lib.optional (stdenv.isLinux && withTcmalloc) "-DWITH_TCMALLOC=1";
postInstall = ''
moveToOutput "lib/*.a" $static
so=${stdenv.hostPlatform.extensions.sharedLibrary}
ln -s libmysqlclient$so $out/lib/libmysqlclient_r$so
'';
passthru = {
client = finalAttrs.finalPackage;
connector-c = finalAttrs.finalPackage;
server = finalAttrs.finalPackage;
mysqlVersion = lib.versions.majorMinor finalAttrs.version;
tests = nixosTests.mysql.percona-server_innovation;
};
meta = with lib; {
homepage = "https://www.percona.com/software/mysql-database/percona-server";
description = ''
A free, fully compatible, enhanced, open source drop-in replacement for
MySQL® that provides superior performance, scalability and instrumentation.
'';
license = licenses.gpl2;
maintainers = teams.flyingcircus.members;
platforms = platforms.unix;
};
})

View File

@@ -0,0 +1,20 @@
{ callPackage, ... }@args:
callPackage ./generic.nix (
args
// {
version = "8.0.35-31";
hash = "sha256-KHfgSi9bQlqsi5aDRBlSpdZgMfOrAwHK51k8KhQ9Udg=";
# includes https://github.com/Percona-Lab/libkmip.git
fetchSubmodules = true;
extraPatches = [
./abi-check.patch
];
extraPostInstall = ''
rm -r "$out"/docs
'';
}
)

View File

@@ -0,0 +1,18 @@
{ callPackage, ... }@args:
callPackage ./generic.nix (
args
// {
version = "8.4.0-1";
hash = "sha256-2tWRRYH0P0HZsWTxeuvDeVWvDwqjjdv6J7YiZwoTKtM=";
# includes https://github.com/Percona-Lab/libkmip.git
fetchSubmodules = true;
extraPatches =
[
];
extraPostInstall = '''';
}
)

View File

@@ -1,6 +1,6 @@
pkgs: {
percona-xtrabackup_lts = pkgs.callPackage ./lts.nix {
percona-xtrabackup_8_0 = pkgs.callPackage ./8_0.nix {
boost = pkgs.boost177;
};
percona-xtrabackup_innovation = pkgs.callPackage ./innovation.nix { };
percona-xtrabackup_8_4 = pkgs.callPackage ./8_4.nix { };
}

View File

@@ -1,8 +1,36 @@
{ lib, stdenv, fetchFromGitHub, bison, boost, cmake, makeWrapper, pkg-config
, curl, cyrus_sasl, libaio, libedit, libev, libevent, libgcrypt, libgpg-error, lz4
, ncurses, numactl, openssl, procps, protobuf, valgrind, xxd, zlib
, perlPackages
, version, hash, fetchSubmodules ? false, extraPatches ? [], extraPostInstall ? "", ...
{
lib,
stdenv,
fetchFromGitHub,
bison,
boost,
cmake,
makeWrapper,
pkg-config,
curl,
cyrus_sasl,
libaio,
libedit,
libev,
libevent,
libgcrypt,
libgpg-error,
lz4,
ncurses,
numactl,
openssl,
procps,
protobuf,
valgrind,
xxd,
zlib,
perlPackages,
version,
hash,
fetchSubmodules ? false,
extraPatches ? [ ],
extraPostInstall ? "",
...
}:
stdenv.mkDerivation (finalAttrs: {
@@ -16,12 +44,39 @@ stdenv.mkDerivation (finalAttrs: {
inherit hash fetchSubmodules;
};
nativeBuildInputs = [ bison boost cmake makeWrapper pkg-config ];
nativeBuildInputs = [
bison
boost
cmake
makeWrapper
pkg-config
];
buildInputs = [
(curl.override { inherit openssl; }) cyrus_sasl libaio libedit libevent libev libgcrypt libgpg-error lz4
ncurses numactl openssl procps protobuf valgrind xxd zlib
] ++ (with perlPackages; [ perl DBI DBDmysql ]);
buildInputs =
[
(curl.override { inherit openssl; })
cyrus_sasl
libaio
libedit
libevent
libev
libgcrypt
libgpg-error
lz4
ncurses
numactl
openssl
procps
protobuf
valgrind
xxd
zlib
]
++ (with perlPackages; [
perl
DBI
DBDmysql
]);
patches = extraPatches;
@@ -42,10 +97,12 @@ stdenv.mkDerivation (finalAttrs: {
"-DWITH_MAN_PAGES=OFF"
];
postInstall = ''
wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB
rm -r "$out"/lib/plugin/debug
'' + extraPostInstall;
postInstall =
''
wrapProgram "$out"/bin/xtrabackup --prefix PERL5LIB : $PERL5LIB
rm -r "$out"/lib/plugin/debug
''
+ extraPostInstall;
passthru.mysqlVersion = lib.versions.majorMinor finalAttrs.version;

View File

@@ -1,15 +0,0 @@
{ callPackage, ... } @ args:
callPackage ./generic.nix (args // {
version = "8.3.0-1";
hash = "sha256-qZM2AFhpwrN0BR+DdozYn7s2I+c1tWpD5QvppTEfGEY=";
# includes https://github.com/Percona-Lab/libkmip.git
fetchSubmodules = true;
extraPatches = [
];
extraPostInstall = ''
'';
})

View File

@@ -1,17 +0,0 @@
{ callPackage, ... } @ args:
callPackage ./generic.nix (args // {
version = "8.0.35-30";
hash = "sha256-yagqBKU057Gk5pEyT2R3c5DtxNG/+TSPenFgbxUiHPo=";
# includes https://github.com/Percona-Lab/libkmip.git
fetchSubmodules = true;
extraPatches = [
./abi-check.patch
];
extraPostInstall = ''
rm -r "$out"/docs
'';
})

View File

@@ -994,8 +994,6 @@ mapAliases ({
pdf2xml = throw "'pdf2xml' was removed: abandoned for years."; # Added 2023-10-22
peach = asouldocs; # Added 2022-08-28
pentablet-driver = xp-pen-g430-driver; # Added 2022-06-23
percona-server_8_0 = percona-server_lts; # Added 2024-05-07
percona-xtrabackup_8_0 = percona-xtrabackup_lts; # Added 2024-05-07
perldevel = throw "'perldevel' has been dropped due to lack of updates in nixpkgs and lack of consistent support for devel versions by 'perl-cross' releases, use 'perl' instead";
perldevelPackages = perldevel;
pgadmin = pgadmin4;

View File

@@ -11602,9 +11602,15 @@ with pkgs;
perceptualdiff = callPackage ../tools/graphics/perceptualdiff { };
inherit (import ../servers/sql/percona-server pkgs) percona-server_lts percona-server_innovation;
inherit (import ../servers/sql/percona-server pkgs) percona-server_8_0 percona-server_8_4;
percona-server_lts = percona-server_8_0;
# temporarily, latest LTS and Innovation release are equal
percona-server_innovation = percona-server_8_4;
percona-server = percona-server_lts;
inherit (import ../tools/backup/percona-xtrabackup pkgs) percona-xtrabackup_lts percona-xtrabackup_innovation;
inherit (import ../tools/backup/percona-xtrabackup pkgs) percona-xtrabackup_8_0 percona-xtrabackup_8_4;
percona-xtrabackup_lts = percona-xtrabackup_8_0;
# temporarily, latest LTS and Innovation release are equal
percona-xtrabackup_innovation = percona-xtrabackup_8_4;
percona-xtrabackup = percona-xtrabackup_lts;
pick = callPackage ../tools/misc/pick { };