-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Ma27
merged 4 commits into
NixOS:master
from
flyingcircusio:PL-132430-percona-innovation
May 16, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = '' | ||
''; | ||
}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 athrow
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.
There was a problem hiding this comment.
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.