Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ebd745a
packaging: consolidate cmake flags, modernize debian, wire PGO+LTO
EvgeniyPatlan Apr 28, 2026
591fc45
deb: split server and client packages to mirror upstream MySQL layout
EvgeniyPatlan Apr 28, 2026
ef216bb
deb: ensure debian/compat doesn't conflict with debhelper-compat=13
EvgeniyPatlan Apr 28, 2026
3a8d650
deb: install dh-apparmor, libsystemd-dev, pkg-config in install_deps
EvgeniyPatlan Apr 29, 2026
0ed3b18
rpm: factor telemetry into helper scripts, drop call-home.sh
EvgeniyPatlan Apr 29, 2026
853fe2a
deb: tolerate flat PXB layout (no lib/xtrabackup/ subdir)
EvgeniyPatlan Apr 29, 2026
4e49fe5
rpm: align PXC spec with Percona Server modernization
EvgeniyPatlan Apr 29, 2026
f6bfc8c
packaging: migrate spec from @@VAR@@ sed pattern to spec.in/@VAR@ tem…
EvgeniyPatlan Apr 29, 2026
cb556b1
deb: fix server-core/client-plugins install file paths
EvgeniyPatlan Apr 30, 2026
7fa5f42
builder: source mysqlrouter systemd templates from scripts/systemd/
EvgeniyPatlan Apr 30, 2026
a6b42d1
builder: drop legacy call-home.sh injection blocks in pxc_builder.sh
EvgeniyPatlan May 10, 2026
9a04345
packaging: fix tarball name case mismatch between builder and spec
EvgeniyPatlan May 11, 2026
bb03e75
builder: fix telemetry helper extraction strip-components in build_srpm
EvgeniyPatlan May 11, 2026
79f5dc4
spec: fix compat-libs rpm2cpio filename for EL8+ and quiet macro-in-c…
EvgeniyPatlan May 11, 2026
3dc9f2d
deb: skip build-deps check for source-only build, install debhelper-c…
EvgeniyPatlan May 11, 2026
2811de8
deb: skip dh clean pre-pass on source-only build to support old debhe…
EvgeniyPatlan May 11, 2026
351bcba
spec: install correct libmysqlclient soname for EL8+ compat-libs
EvgeniyPatlan May 11, 2026
ba5f24b
spec: fix duplicate share/ listings and drop EL8+ libmysqlclient_r re…
EvgeniyPatlan May 11, 2026
6794922
deb: align install-file naming with control, claim orphaned files
EvgeniyPatlan May 11, 2026
9072f82
spec: claim libicu private libs, fix compat-symlink glob, allow dupli…
EvgeniyPatlan May 12, 2026
255de6d
packaging: drop MySQL Router from PXC distribution (rpm + deb + tarball)
EvgeniyPatlan May 12, 2026
004854a
Revert "packaging: drop MySQL Router from PXC distribution (rpm + deb…
EvgeniyPatlan May 12, 2026
8a2b2ab
deb: exclude all mysqlrouter files from packaging to match release-9.6.0
EvgeniyPatlan May 12, 2026
1b7f5f8
spec: remove _build_id_links alldebug — rpmbuild -bs spec-parse regre…
EvgeniyPatlan May 12, 2026
5669365
spec: escape % in comment block to stop %package being parsed as dire…
EvgeniyPatlan May 12, 2026
05fabc4
spec: restore _build_id_links none from release-9.6.0 to fix rpmbuild…
EvgeniyPatlan May 12, 2026
2fc3fe7
spec: disable auto-debuginfo subpackage to work around Jenkins rpm re…
EvgeniyPatlan May 12, 2026
b0b4abf
spec: escape %install / %check / %post / %postun in comments
EvgeniyPatlan May 12, 2026
d23237f
spec: scrub leftover MTR core dumps from BUILDROOT before check-build…
EvgeniyPatlan May 12, 2026
a4435a6
deb: package libicu in server-core, exclude mysql-test tree and daemo…
EvgeniyPatlan May 12, 2026
158d8a7
deb: exclude galera/garb source artifacts, root-level docs, and test …
EvgeniyPatlan May 13, 2026
d12dffc
deb: skip dh_dwz to avoid abort on PGO+LTO mysqld
EvgeniyPatlan May 13, 2026
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
95 changes: 95 additions & 0 deletions build-ps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Generate percona-xtradb-cluster.spec from template
# This file is processed by CMake's CONFIGURE_FILE with @ONLY mode,
# substituting @VARIABLE@ markers with CMake variable values.
# Mirrors the Percona Server packaging template-generation pattern.

IF(NOT LINUX)
RETURN()
ENDIF()

# Derive Percona XtraDB Cluster version from MYSQL_VERSION_EXTRA (strip leading dash)
STRING(REGEX REPLACE "^-" "" PERCONA_SERVER_VERSION "${MYSQL_VERSION_EXTRA}")

# Backwards-compat alias: the spec template uses @PERCONA_VERSION@
# (matches the historical sed-substitution pattern). PS migrated to
# PERCONA_SERVER_VERSION; PXC keeps both as aliases during the transition.
SET(PERCONA_VERSION "${PERCONA_SERVER_VERSION}")

# Git revision for the spec
IF(NOT DEFINED PERCONA_REVISION)
EXECUTE_PROCESS(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE PERCONA_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
IF(NOT PERCONA_REVISION)
SET(PERCONA_REVISION "unknown")
ENDIF()
ENDIF()
# Backwards-compat alias for spec's @REVISION@ marker
SET(REVISION "${PERCONA_REVISION}")

# RPM release number
IF(NOT DEFINED RPM_RELEASE)
SET(RPM_RELEASE "1")
ENDIF()

# DEB release number
IF(NOT DEFINED DEB_RELEASE)
SET(DEB_RELEASE "1")
ENDIF()

# WSREP version: derived from wsrep-API header + cmake/wsrep-lib.cmake.
# Prefer caller-provided value; fall back to extraction at configure time.
IF(NOT DEFINED WSREP_VERSION)
SET(WSREP_API_HEADER "${CMAKE_SOURCE_DIR}/wsrep-lib/wsrep-API/v26/wsrep_api.h")
SET(WSREP_LIB_CMAKE "${CMAKE_SOURCE_DIR}/cmake/wsrep-lib.cmake")
IF(EXISTS "${WSREP_API_HEADER}" AND EXISTS "${WSREP_LIB_CMAKE}")
EXECUTE_PROCESS(
COMMAND grep WSREP_INTERFACE_VERSION ${WSREP_API_HEADER}
COMMAND cut -d "\"" -f 2
OUTPUT_VARIABLE WSREP_INTERFACE_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
EXECUTE_PROCESS(
COMMAND grep "SET(WSREP_PATCH_VERSION" ${WSREP_LIB_CMAKE}
COMMAND cut -d "\"" -f 2
OUTPUT_VARIABLE WSREP_PATCH_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
IF(WSREP_INTERFACE_VERSION AND WSREP_PATCH_VERSION)
SET(WSREP_VERSION "${WSREP_INTERFACE_VERSION}.${WSREP_PATCH_VERSION}")
ENDIF()
ENDIF()
IF(NOT WSREP_VERSION)
SET(WSREP_VERSION "unknown")
ENDIF()
ENDIF()

# Copyright year (matches PS spec.in's @MYSQL_COPYRIGHT_YEAR@)
STRING(TIMESTAMP MYSQL_COPYRIGHT_YEAR "%Y")

# Generate the RPM spec
SET(SPECFILENAME "percona-xtradb-cluster.spec")
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/percona-xtradb-cluster.spec.in")
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/percona-xtradb-cluster.spec.in
${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME}
@ONLY
)
MESSAGE(STATUS "Generated ${SPECFILENAME} (PERCONA_VERSION=${PERCONA_SERVER_VERSION}, REVISION=${PERCONA_REVISION}, WSREP=${WSREP_VERSION})")
ENDIF()

# Generate debian/rules from template if .in exists
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/debian/rules.in")
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/debian/rules.in
${CMAKE_CURRENT_BINARY_DIR}/debian/rules
@ONLY
)
MESSAGE(STATUS "Generated debian/rules from rules.in")
ENDIF()
135 changes: 81 additions & 54 deletions build-ps/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -416,80 +416,107 @@ fi
add_fido_plugin="bundled"
fi

# Profile-Guided Optimization toggle.
# Default = on. Set WITH_PGO=0 to disable. Auto-disabled for Debug builds
# (no value profiling unoptimized code).
WITH_PGO="${WITH_PGO:-1}"
if [[ $CMAKE_BUILD_TYPE == 'Debug' ]]; then
cmake $SOURCEDIR/ ${CMAKE_OPTS:-} -DBUILD_CONFIG=mysql_release \
WITH_PGO=0
fi

# Suppress GCC false positives that fire during LTO link on Bison-generated
# parsers — distros add these via redhat-hardened-cc1/dpkg-buildflags;
# the standalone tarball build doesn't, so add them explicitly.
TARBALL_WARN_SUPPRESS="-Wno-free-nonheap-object -Wno-stringop-overflow -Wno-stringop-overread -Wno-alloc-size-larger-than -Wno-array-bounds"

# Common cmake flags shared across debug, release, and PGO 3-pass builds.
# Each invocation appends pass-specific flags (build type, profile flag,
# compilation comment).
CMAKE_COMMON_FLAGS=(
"$SOURCEDIR/"
${CMAKE_OPTS:-}
-DBUILD_CONFIG=mysql_release
-DCMAKE_INSTALL_PREFIX="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME"
-DMYSQL_DATADIR="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME/data"
-DCMAKE_C_FLAGS="${TARBALL_WARN_SUPPRESS}"
-DCMAKE_CXX_FLAGS="${TARBALL_WARN_SUPPRESS}"
-DWITH_PAM=ON
-DWITHOUT_ROCKSDB=ON
-DWITHOUT_TOKUDB=ON
-DWITH_INNODB_MEMCACHED=ON
-DDOWNLOAD_BOOST=1
-DFORCE_INSOURCE_BUILD=1
-DWITH_SYSTEM_LIBS=ON
-DWITH_PROTOBUF=bundled
-DWITH_RAPIDJSON=bundled
-DWITH_ICU=bundled
-DWITH_LZ4=bundled
-DWITH_EDITLINE=bundled
-DWITH_LIBEVENT=bundled
-DWITH_ZLIB=bundled
-DWITH_ZSTD=bundled
-DWITH_FIDO="$add_fido_plugin"
-DWITH_NUMA=ON
-DWITH_LDAP=system
-DWITH_BOOST="$TARGETDIR/libboost"
-DWITH_PACKAGE_FLAGS=OFF
-DMYSQL_SERVER_SUFFIX=".$TAG"
-DWITH_WSREP=ON
-DWITH_PERCONA_TELEMETRY=ON
-DWITH_UNIT_TESTS=0
-DWITH_LTO=ON
)

if [[ $CMAKE_BUILD_TYPE == 'Debug' ]]; then
cmake "${CMAKE_COMMON_FLAGS[@]}" \
-DCMAKE_BUILD_TYPE=Debug \
$DEBUG_EXTRA \
-DCMAKE_INSTALL_PREFIX="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME" \
-DMYSQL_DATADIR="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME/data" \
-DCOMPILATION_COMMENT="$COMMENT - UNIV_DEBUG ON" \
-DWITH_PAM=ON \
-DWITHOUT_ROCKSDB=ON \
-DWITHOUT_TOKUDB=ON \
-DWITH_INNODB_MEMCACHED=ON \
-DDOWNLOAD_BOOST=1 \
-DFORCE_INSOURCE_BUILD=1 \
-DWITH_SYSTEM_LIBS=ON \
-DWITH_PROTOBUF=bundled \
-DWITH_RAPIDJSON=bundled \
-DWITH_ICU=bundled \
-DWITH_LZ4=bundled \
-DWITH_LIBEVENT=bundled \
-DWITH_EDITLINE=bundled \
-DWITH_ZLIB=bundled \
-DWITH_ZSTD=bundled \
-DWITH_FIDO="$add_fido_plugin" \
-DWITH_NUMA=ON \
-DWITH_LDAP=system \
-DWITH_BOOST="$TARGETDIR/libboost" \
-DWITH_PACKAGE_FLAGS=OFF \
-DMYSQL_SERVER_SUFFIX=".$TAG" \
-DWITH_WSREP=ON \
-DWITH_UNIT_TESTS=0 \
-DWITH_DEBUG=ON \
-DWITH_PERCONA_TELEMETRY=ON \
$WITH_MECAB_OPTION $OPENSSL_INCLUDE $OPENSSL_LIBRARY $CRYPTO_LIBRARY

(make $MAKE_JFLAG $QUIET) || exit 1
(make install) || exit 1
(cp -v runtime_output_directory/mysqld-debug $TARGETDIR/usr/local/$PRODUCT_FULL_NAME/bin/mysqld) || true
echo "mysqld in build in debug mode"
else
cmake $SOURCEDIR/ ${CMAKE_OPTS:-} -DBUILD_CONFIG=mysql_release \
# Pass 1: configure (instrumentation pass if PGO enabled)
PGO_FIRST_FLAG=""
[ "${WITH_PGO}" = "1" ] && PGO_FIRST_FLAG="-DFPROFILE_GENERATE=1"

cmake "${CMAKE_COMMON_FLAGS[@]}" \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-RelWithDebInfo} \
-DMINIMAL_RELWITHDEBINFO=OFF \
-DCMAKE_INSTALL_PREFIX="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME" \
-DMYSQL_DATADIR="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME/data" \
$PGO_FIRST_FLAG \
-DROUTER_INSTALL_LIBDIR="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME/lib/mysqlrouter/private" \
-DROUTER_INSTALL_PLUGINDIR="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME/lib/mysqlrouter/plugin" \
-DCOMPILATION_COMMENT="$COMMENT" \
-DWITH_PAM=ON \
-DWITHOUT_ROCKSDB=ON \
-DWITHOUT_TOKUDB=ON \
-DWITH_INNODB_MEMCACHED=ON \
-DDOWNLOAD_BOOST=1 \
-DFORCE_INSOURCE_BUILD=1 \
-DWITH_SYSTEM_LIBS=ON \
-DWITH_PROTOBUF=bundled \
-DWITH_RAPIDJSON=bundled \
-DWITH_ICU=bundled \
-DWITH_LZ4=bundled \
-DWITH_EDITLINE=bundled \
-DWITH_LIBEVENT=bundled \
-DWITH_ZLIB=bundled \
-DWITH_ZSTD=bundled \
-DWITH_FIDO="$add_fido_plugin" \
-DWITH_NUMA=ON \
-DWITH_LDAP=system \
-DWITH_BOOST="$TARGETDIR/libboost" \
-DWITH_PACKAGE_FLAGS=OFF \
-DMYSQL_SERVER_SUFFIX=".$TAG" \
-DWITH_WSREP=ON \
-DWITH_PERCONA_TELEMETRY=ON \
-DWITH_UNIT_TESTS=0 \
$WITH_MECAB_OPTION $OPENSSL_INCLUDE $OPENSSL_LIBRARY $CRYPTO_LIBRARY

(make $MAKE_JFLAG $QUIET) || exit 1

# Passes 2 & 3: profile + consume (skipped if WITH_PGO=0)
if [ "${WITH_PGO}" = "1" ]; then
echo "PGO: running MTR profile suite to generate .gcda profile data"
(make run-profile-suite) || exit 1

echo "PGO: rebuilding with profile data (-DFPROFILE_USE=1)"
cd "$TARGETDIR"
rm -rf bld
mkdir bld
cd bld
cmake "${CMAKE_COMMON_FLAGS[@]}" \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-RelWithDebInfo} \
-DMINIMAL_RELWITHDEBINFO=OFF \
-DFPROFILE_USE=1 \
-DROUTER_INSTALL_LIBDIR="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME/lib/mysqlrouter/private" \
-DROUTER_INSTALL_PLUGINDIR="$TARGETDIR/usr/local/$PRODUCT_FULL_NAME/lib/mysqlrouter/plugin" \
-DCOMPILATION_COMMENT="$COMMENT" \
$WITH_MECAB_OPTION $OPENSSL_INCLUDE $OPENSSL_LIBRARY $CRYPTO_LIBRARY

(make $MAKE_JFLAG $QUIET) || exit 1
fi

(make install) || exit 1
echo "mysqld in build in release mode"
fi
Expand Down
1 change: 0 additions & 1 deletion build-ps/debian/compat

This file was deleted.

73 changes: 70 additions & 3 deletions build-ps/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ Uploaders: George Lorch <george.lorch@percona.com>,
Krunal Bauskar <krunal.bauskar@percona.com>
Build-Depends: libtool (>= 1.4.2-7),
procps,
debhelper (>= 7.0.50~),
debhelper-compat (= 13),
file (>= 3.28),
bison,
cmake,
debhelper (>= 9.0.0),
fakeroot,
dh-apparmor,
pkg-config,
libsystemd-dev,
libaio-dev[linux-any],
libmecab-dev,
libwrap0-dev,
Expand Down Expand Up @@ -120,6 +122,8 @@ Description: Percona XtraDB Cluster database common files (e.g. /etc/mysql/my.cn
Package: percona-xtradb-cluster-client
Architecture: any
Depends: percona-xtradb-cluster-common (= ${binary:Version}),
percona-xtradb-cluster-client-core (= ${binary:Version}),
percona-xtradb-cluster-client-plugins (= ${binary:Version}),
${shlibs:Depends}, ${misc:Depends}
debianutils (>=1.6),
libdbi-perl,
Expand Down Expand Up @@ -190,7 +194,9 @@ Pre-Depends: percona-xtradb-cluster-common (= ${binary:Version}),
adduser,
libdbd-mysql-perl,
debconf (>= 0.2.17)
Depends: percona-xtradb-cluster-client (>= ${binary:Version}),
Depends: percona-xtradb-cluster-server-core (= ${binary:Version}),
percona-xtradb-cluster-client (>= ${binary:Version}),
percona-xtradb-cluster-client-plugins (= ${binary:Version}),
percona-telemetry-agent,
libdbi-perl,
perl (>= 5.6),
Expand Down Expand Up @@ -364,3 +370,64 @@ Replaces: percona-galera-arbitrator-3-dbg
Depends: percona-xtradb-cluster-garbd (= ${binary:Version}), ${misc:Depends}
Description: Debugging package for Percona XtraDB Cluster Garbd.

# ============================================================================
# Split packages — introduced in 9.7.0 to mirror upstream MySQL package
# layout (server-core / client-core / client-plugins). Existing -server and
# -client packages now depend on these and contain only the non-binary
# portions (config files, scripts, init).
# ============================================================================

Package: percona-xtradb-cluster-server-core
Architecture: any
Depends: percona-xtradb-cluster-common (= ${binary:Version}),
percona-xtradb-cluster-client-plugins (= ${binary:Version}),
${shlibs:Depends}, ${misc:Depends}
Provides: virtual-mysql-server-core,
mysql-server-core-8.0
Conflicts: mysql-server-core-8.0,
virtual-mysql-server-core
Replaces: mysql-server-core-8.0,
virtual-mysql-server-core
Description: Percona XtraDB Cluster - Server core binaries
Percona XtraDB Cluster is based on the Percona Server database
server and provides a High Availability solution.
Percona XtraDB Cluster provides synchronous replication, supports
multi-master replication, parallel applying on slaves, automatic
node provisioning with primary focus on data consistency.
.
This package contains the server binaries (mysqld, myisamchk, etc.)
and shared libraries. Configuration files, init scripts, and AppArmor
profiles are in the percona-xtradb-cluster-server package.

Package: percona-xtradb-cluster-client-core
Architecture: any
Depends: percona-xtradb-cluster-common (= ${binary:Version}),
percona-xtradb-cluster-client-plugins (= ${binary:Version}),
${shlibs:Depends}, ${misc:Depends}
Provides: virtual-mysql-client-core,
mysql-client-core-8.0
Conflicts: mysql-client-core-8.0,
virtual-mysql-client-core
Replaces: mysql-client-core-8.0,
virtual-mysql-client-core
Description: Percona XtraDB Cluster - Core client binaries
Percona XtraDB Cluster is based on the Percona Server database
server and provides a High Availability solution.
.
This package contains the core client binaries: mysql and mysqldump.
Auxiliary client tools (mysqladmin, mysqlcheck, etc.) are in the
percona-xtradb-cluster-client package.

Package: percona-xtradb-cluster-client-plugins
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Percona XtraDB Cluster - Client plugins
Percona XtraDB Cluster is based on the Percona Server database
server and provides a High Availability solution.
.
This package contains the client-side authentication plugins
(LDAP, Kerberos, WebAuthn, OpenID Connect, OCI, native password,
dialog) and the bundled libfido2. Both client and server packages
depend on this package so the plugins are always available.

3 changes: 3 additions & 0 deletions build-ps/debian/extra/percona-telemetry-cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
# Cleanup Percona telemetry directory on package removal
rm -rf /usr/local/percona/telemetry/pxc
15 changes: 15 additions & 0 deletions build-ps/debian/extra/percona-telemetry-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
# Setup Percona telemetry directory with proper ownership and SELinux context
PS_TELEMETRY=/usr/local/percona/telemetry/pxc

mkdir -p "$PS_TELEMETRY"
chown mysql:percona-telemetry "$PS_TELEMETRY" 2>/dev/null || :
chmod 775 "$PS_TELEMETRY" 2>/dev/null || :
chmod g+s "$PS_TELEMETRY" 2>/dev/null || :
chmod u+s "$PS_TELEMETRY" 2>/dev/null || :
chcon -t mysqld_db_t "$PS_TELEMETRY" 2>/dev/null || :
chcon -u system_u "$PS_TELEMETRY" 2>/dev/null || :

# Setup telemetry UUID file
chgrp percona-telemetry /usr/local/percona/telemetry_uuid 2>/dev/null || :
chmod 664 /usr/local/percona/telemetry_uuid 2>/dev/null || :
Loading