Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

percona: restructure releases according to upstream release policy #309953

Merged
merged 4 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions nixos/doc/manual/release-notes/rl-2405.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m

- `unrar` was updated to v7. See [changelog](https://www.rarlab.com/unrar7notes.htm) for more information.

- `percona-server` now follows [the same two-fold release cycle](https://www.percona.com/blog/lts-and-innovation-releases-for-percona-server-for-mysql/) as Oracle MySQL and provides a *Long-Term-Support (LTS)* in parallel with a continuous-delivery *Innovation* release. `percona-server` defaults to `percona-server_lts`, will be backed by the same release branch throughout the lifetime of this stable NixOS release, and is still available under the versioned attribute `percona-server_8_0`.
The `percona-server_innovation` releases however have support periods shorter than the lifetime of this NixOS release and will continuously be updated to newer Percona releases. Note that Oracle considers the *Innovation* releases to be production-grade, but each release might include backwards-incompatible changes, even in its on-disk format.
The same release scheme is applied to the supporting `percona-xtrabackup` tool as well.

- `git-town` was updated from version 11 to 13. See the [changelog](https://github.com/git-town/git-town/blob/main/CHANGELOG.md#1300-2024-03-22) for breaking changes.

- `k9s` was updated to v0.31. There have been various breaking changes in the config file format,
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/mysql/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
inherit (pkgs) mysql80;
};
perconaPackages = {
inherit (pkgs) percona-server_8_0;
inherit (pkgs) percona-server_lts percona-server_innovation;
};
mkTestName = pkg: "mariadb_${builtins.replaceStrings ["."] [""] (lib.versions.majorMinor pkg.version)}";
}
2 changes: 1 addition & 1 deletion nixos/tests/mysql/mysql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ in
}) mariadbPackages)
// (lib.mapAttrs (_: package: makeMySQLTest {
inherit package;
name = "percona_8_0";
name = builtins.replaceStrings ["-"] ["_"] package.pname;
hasMroonga = false; useSocketAuth = false;
}) perconaPackages)
15 changes: 15 additions & 0 deletions pkgs/servers/sql/percona-server/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pkgs: {
percona-server_lts = pkgs.callPackage ./lts.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;
protobuf = pkgs.protobuf_21;
};
percona-server_innovation = pkgs.callPackage ./innovation.nix {
inherit (pkgs.darwin) cctools developer_cmds DarwinTools;
inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices;
# newer versions cause linking failures against `libabsl_spinlock_wait`
protobuf = pkgs.protobuf_21;
};
}
112 changes: 112 additions & 0 deletions pkgs/servers/sql/percona-server/innovation.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{ 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;
};
})
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}:

stdenv.mkDerivation (finalAttrs: {
pname = "percona-server";
pname = "percona-server_lts";
version = "8.0.36-28";

src = fetchurl {
Expand Down Expand Up @@ -80,7 +80,7 @@ stdenv.mkDerivation (finalAttrs: {
connector-c = finalAttrs.finalPackage;
server = finalAttrs.finalPackage;
mysqlVersion = lib.versions.majorMinor finalAttrs.version;
tests = nixosTests.mysql.percona-server_8_0;
tests = nixosTests.mysql.percona-server_lts;
};

meta = with lib; {
Expand Down
6 changes: 6 additions & 0 deletions pkgs/tools/backup/percona-xtrabackup/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pkgs: {
percona-xtrabackup_lts = pkgs.callPackage ./lts.nix {
boost = pkgs.boost177;
};
percona-xtrabackup_innovation = pkgs.callPackage ./innovation.nix { };
}
8 changes: 5 additions & 3 deletions pkgs/tools/backup/percona-xtrabackup/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
, version, hash, fetchSubmodules ? false, extraPatches ? [], extraPostInstall ? "", ...
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "percona-xtrabackup";
inherit version;

src = fetchFromGitHub {
owner = "percona";
repo = "percona-xtrabackup";
rev = "${pname}-${version}";
rev = "${finalAttrs.pname}-${finalAttrs.version}";
inherit hash fetchSubmodules;
};

Expand Down Expand Up @@ -47,11 +47,13 @@ stdenv.mkDerivation rec {
rm -r "$out"/lib/plugin/debug
'' + extraPostInstall;

passthru.mysqlVersion = lib.versions.majorMinor finalAttrs.version;

meta = with lib; {
description = "Non-blocking backup tool for MySQL";
homepage = "http://www.percona.com/software/percona-xtrabackup";
license = licenses.lgpl2;
platforms = platforms.linux;
maintainers = teams.flyingcircus.members ++ [ maintainers.izorkin ];
};
}
})
15 changes: 15 additions & 0 deletions pkgs/tools/backup/percona-xtrabackup/innovation.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ 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 = ''
'';
})
2 changes: 2 additions & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,8 @@ 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
Copy link
Member

@Ma27 Ma27 May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a little dangerous: when we bump lts to 8.4, we'll must not forget to fix this, otherwise people will end up with percon 8.4 even though their config "says" 8.0.
Assuming we get this into 24.05, we should prepare a follow-up PR that replaces the aliases with a throw that will go into master after branchoff.

I think this is OK to go into 24.05 given that this isn't a breaking change (with the compat aliases). We should replace the aliases with a throw after branchoff on master though.

Copy link
Contributor Author

@osnyx osnyx May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the main question is whether we want to keep version-specific aliases for specific LTS versions.
I've seen that for Oracle MySQL there are currently two LTS versions supported in parallel, 8.0 and 8.4. Let's see how Percona might handle this, then we might even turn the aliasing around, package both 8_0 and 8_4 in parallel, and let percona_lts be the alias to one of them that stays stable throughout a release cycle.

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;
Expand Down
15 changes: 4 additions & 11 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11701,17 +11701,10 @@ with pkgs;

perceptualdiff = callPackage ../tools/graphics/perceptualdiff { };

percona-server_8_0 = callPackage ../servers/sql/percona-server/8.0.x.nix {
inherit (darwin) cctools developer_cmds DarwinTools;
inherit (darwin.apple_sdk.frameworks) CoreServices;
boost = boost177; # Configure checks for specific version.
icu = icu69;
protobuf = protobuf_21;
};
percona-xtrabackup = percona-xtrabackup_8_0;
percona-xtrabackup_8_0 = callPackage ../tools/backup/percona-xtrabackup/8_0.nix {
boost = boost177;
};
inherit (import ../servers/sql/percona-server pkgs) percona-server_lts percona-server_innovation;
percona-server = percona-server_lts;
inherit (import ../tools/backup/percona-xtrabackup pkgs) percona-xtrabackup_lts percona-xtrabackup_innovation;
percona-xtrabackup = percona-xtrabackup_lts;

pick = callPackage ../tools/misc/pick { };

Expand Down