From f1ca95f5e15b152bbfcc51d63c27da11fa914dd1 Mon Sep 17 00:00:00 2001 From: Andrew Garner Date: Wed, 15 Apr 2026 00:35:40 -0500 Subject: [PATCH] support compilation on ubuntu-resolute - Workaround: https://github.com/uutils/coreutils/issues/11469 - Use dynamically linked libboost_program_options Current galera cmake configuration does not like static linking under resolute cmake+gcc toolchains. This avoids needing to custom patch (GPLv2) build configuration. The libboost_program_options.so is now installed under the Percona XtraDB Cluster lib/private directory similar to other MySQL vendored thirdparty libraries. This largely impacts the bin/garbd binary (currently unused by pxc-release) - Adjust Boost configuration to adapt to cmake v4.2 removing builtin FindBoost.cmake module in favor of the boost provided by modern boost v1.70.0+ - Workaround legacy libtirpc conventions by using -std=gnu17 CFLAGS - ubuntu-resolute stemcells no longer provide libicu-dev packages, so use the bundled version instead - replace chpst with runuser in galera-agent service script - (e2e-tests) correct too strict test assertions that fail under ubuntu-resolute and remove an unnecessary syslog test --- jobs/galera-agent/templates/service.bash | 2 +- operations/test/with-syslog.yml | 27 ------------------- packages/percona-xtrabackup-8.0/packaging | 7 +++++ packages/percona-xtrabackup-8.4/packaging | 7 +++++ packages/percona-xtradb-cluster-8.0/packaging | 15 +++++++++-- packages/percona-xtradb-cluster-8.4/packaging | 16 +++++++++-- src/e2e-tests/singlenode_test.go | 3 +-- src/e2e-tests/verification_test.go | 14 ---------- 8 files changed, 43 insertions(+), 48 deletions(-) delete mode 100644 operations/test/with-syslog.yml diff --git a/jobs/galera-agent/templates/service.bash b/jobs/galera-agent/templates/service.bash index 0d8f1e3d2..e26db8a19 100644 --- a/jobs/galera-agent/templates/service.bash +++ b/jobs/galera-agent/templates/service.bash @@ -27,6 +27,6 @@ fi mount --make-rslave /sys/fs/cgroup umount --recursive /sys/fs/cgroup umount /var/vcap/bosh/etc -exec chpst -u vcap -- /var/vcap/packages/galera-agent/bin/galera-agent \ +exec runuser -u vcap -g vcap -- /var/vcap/packages/galera-agent/bin/galera-agent \ --configPath=/var/vcap/jobs/galera-agent/config/galera-agent-config.yml \ --timeFormat="<%= p('logging.format.timestamp') %>" diff --git a/operations/test/with-syslog.yml b/operations/test/with-syslog.yml deleted file mode 100644 index dae10e16d..000000000 --- a/operations/test/with-syslog.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- type: replace - path: /releases/name=syslog? - value: - name: syslog - version: latest - url: https://bosh.io/d/github.com/cloudfoundry/syslog-release - -- type: replace - path: /instance_groups/name=mysql/jobs/name=syslog_forwarder? - value: - name: syslog_forwarder - release: syslog - -- type: replace - path: /instance_groups/name=syslog_storer? - value: - name: syslog_storer - release: syslog - instances: 1 - vm_type: ((vm_type)) - stemcell: default - networks: [{name: ((network))}] - azs: ((azs)) - jobs: - - name: syslog_storer - release: syslog diff --git a/packages/percona-xtrabackup-8.0/packaging b/packages/percona-xtrabackup-8.0/packaging index dfc6e36c7..f2c5c15b7 100755 --- a/packages/percona-xtrabackup-8.0/packaging +++ b/packages/percona-xtrabackup-8.0/packaging @@ -3,6 +3,13 @@ set -o errexit set -o nounset +# Workaround for uutils coreutils 0.7.0 (ubuntu-resolute): its `install -D` +# replaces symlink path components with real directories instead of following +# them. Resolve the real path so libaio's `make install` (which uses +# `install -D`) writes to the correct location on persistent disk. +# See https://github.com/uutils/coreutils/issues/11469 +BOSH_INSTALL_TARGET=$(readlink -f "${BOSH_INSTALL_TARGET}") + main() { install_build_dependencies unpack_source diff --git a/packages/percona-xtrabackup-8.4/packaging b/packages/percona-xtrabackup-8.4/packaging index e12f2e76b..9a677eff6 100644 --- a/packages/percona-xtrabackup-8.4/packaging +++ b/packages/percona-xtrabackup-8.4/packaging @@ -3,6 +3,13 @@ set -o errexit set -o nounset +# Workaround for uutils coreutils 0.7.0 (ubuntu-resolute): its `install -D` +# replaces symlink path components with real directories instead of following +# them. Resolve the real path so libaio's `make install` (which uses +# `install -D`) writes to the correct location on persistent disk. +# See https://github.com/uutils/coreutils/issues/11469 +BOSH_INSTALL_TARGET=$(readlink -f "${BOSH_INSTALL_TARGET}") + main() { install_build_dependencies unpack_source diff --git a/packages/percona-xtradb-cluster-8.0/packaging b/packages/percona-xtradb-cluster-8.0/packaging index d74f9acd2..41fd68547 100644 --- a/packages/percona-xtradb-cluster-8.0/packaging +++ b/packages/percona-xtradb-cluster-8.0/packaging @@ -4,6 +4,13 @@ set -o errexit set -o nounset set -o pipefail +# Workaround for uutils coreutils 0.7.0 (ubuntu-resolute): its `install -D` +# replaces symlink path components with real directories instead of following +# them. Resolve the real path so libaio's `make install` (which uses +# `install -D`) writes to the correct location on persistent disk. +# See https://github.com/uutils/coreutils/issues/11469 +BOSH_INSTALL_TARGET=$(readlink -f "${BOSH_INSTALL_TARGET}") + main() { install_build_dependencies install_runtime_dependencies @@ -29,7 +36,9 @@ install_build_dependencies() { tar -xf boost_*.tar.bz2 cd boost_*/ ./bootstrap.sh --with-libraries=program_options,system - ./b2 -j "$(nproc)" link=static + ./b2 -j "$(nproc)" cxxstd=17 cxxflags="-fPIC" cflags="-fPIC" + mkdir -p "${BOSH_INSTALL_TARGET}/lib/private" + cp --preserve=all ./stage/lib/libboost_program_options.so.* "${BOSH_INSTALL_TARGET}/lib/private/" cd - tar -xf check_*.tar.gz @@ -81,7 +90,9 @@ build() { cmake .. \ -DBUILD_CONFIG=mysql_release \ -DBOOST_ROOT="${boost_dir}" \ + -DBoost_DIR="$(readlink -f "${boost_dir}"/stage/lib/cmake/Boost-*/)" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_C_FLAGS="-std=gnu17" \ -DMINIMAL_RELWITHDEBINFO=OFF \ -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_C_COMPILER=gcc \ @@ -101,7 +112,7 @@ build() { -DWITH_AUTHENTICATION_KERBEROS=OFF \ -DWITH_PERCONA_AUTHENTICATION_LDAP=OFF \ -DWITH_BOOST="${boost_dir}" \ - -DWITH_ICU=system \ + -DWITH_ICU=bundled \ -DWITH_READLINE=system \ -DWITH_ROUTER=OFF \ -DWITH_GROUP_REPLICATION=OFF \ diff --git a/packages/percona-xtradb-cluster-8.4/packaging b/packages/percona-xtradb-cluster-8.4/packaging index 89169b81c..696ef9591 100644 --- a/packages/percona-xtradb-cluster-8.4/packaging +++ b/packages/percona-xtradb-cluster-8.4/packaging @@ -4,6 +4,13 @@ set -o errexit set -o nounset set -o pipefail +# Workaround for uutils coreutils 0.7.0 (ubuntu-resolute): its `install -D` +# replaces symlink path components with real directories instead of following +# them. Resolve the real path so libaio's `make install` (which uses +# `install -D`) writes to the correct location on persistent disk. +# See https://github.com/uutils/coreutils/issues/11469 +BOSH_INSTALL_TARGET=$(readlink -f "${BOSH_INSTALL_TARGET}") + main() { install_build_dependencies install_runtime_dependencies @@ -29,7 +36,9 @@ install_build_dependencies() { tar -xf boost_*.tar.bz2 cd boost_*/ ./bootstrap.sh --with-libraries=program_options,system - ./b2 -j "$(nproc)" link=static + ./b2 -j "$(nproc)" cxxstd=17 cxxflags="-fPIC" cflags="-fPIC" + mkdir -p "${BOSH_INSTALL_TARGET}/lib/private" + cp --preserve=all ./stage/lib/libboost_program_options.so.* "${BOSH_INSTALL_TARGET}/lib/private/" cd - tar -xf check_*.tar.gz @@ -81,7 +90,9 @@ build() { cmake .. \ -DBUILD_CONFIG=mysql_release \ -DBOOST_ROOT="${boost_dir}" \ + -DBoost_DIR="$(readlink -f "${boost_dir}"/stage/lib/cmake/Boost-*/)" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_C_FLAGS="-std=gnu17" \ -DMINIMAL_RELWITHDEBINFO=OFF \ -DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_C_COMPILER=gcc \ @@ -100,7 +111,8 @@ build() { -DWITH_AUTHENTICATION_FIDO=OFF \ -DWITH_AUTHENTICATION_KERBEROS=OFF \ -DWITH_PERCONA_AUTHENTICATION_LDAP=OFF \ - -DWITH_ICU=system \ + -DWITH_BOOST="${boost_dir}" \ + -DWITH_ICU=bundled \ -DWITH_READLINE=system \ -DWITH_ROUTER=OFF \ -DWITH_GROUP_REPLICATION=OFF \ diff --git a/src/e2e-tests/singlenode_test.go b/src/e2e-tests/singlenode_test.go index d4953b0a5..1966c8fef 100644 --- a/src/e2e-tests/singlenode_test.go +++ b/src/e2e-tests/singlenode_test.go @@ -67,8 +67,7 @@ var _ = Describe(fmt.Sprintf("Single Node for PXC version %s", expectedMysqlVers Expect(queryResultString).ToNot(BeEmpty()) }) It("does not go through crash recovery", func() { - output, err := bosh.RemoteCommand(deploymentName, "mysql/0", "stat /var/vcap/sys/log/pxc-mysql/pxc-57-recovery.log") - Expect(output).To(ContainSubstring(`stat: cannot statx '/var/vcap/sys/log/pxc-mysql/pxc-57-recovery.log': No such file or directory`)) + _, err := bosh.RemoteCommand(deploymentName, "mysql/0", "test -e /var/vcap/sys/log/pxc-mysql/pxc-57-recovery.log") Expect(err).To(HaveOccurred()) }) diff --git a/src/e2e-tests/verification_test.go b/src/e2e-tests/verification_test.go index e1160bc26..27b1a421c 100644 --- a/src/e2e-tests/verification_test.go +++ b/src/e2e-tests/verification_test.go @@ -56,7 +56,6 @@ var _ = Describe("Feature Verification", Ordered, Label("verification"), func() bosh.Operation(`test/use-mtls.yml`), bosh.Operation(`test/tune-mysql-config.yml`), bosh.Operation(`test/with-wildcard-schema-access.yml`), - bosh.Operation(`test/with-syslog.yml`), bosh.Operation(`test/optimize-vm-swappiness.yml`), bosh.Operation(`enable-jemalloc.yml`), bosh.Operation(`iaas/cluster.yml`), @@ -654,20 +653,7 @@ var _ = Describe("Feature Verification", Ordered, Label("verification"), func() Expect(contents).To(ContainSubstring("No InnoDB statistics available for this query")) Expect(contents).To(ContainSubstring("DO sleep(10);")) }) - It("syslog does not forward slow queries", func() { - // execute a slow query - Expect(db.Exec(`DO sleep(10)`)).Error().NotTo(HaveOccurred()) - // fetch forwarded logs - output, err := bosh.RemoteCommand(deploymentName, "syslog_storer", "cat /var/vcap/store/syslog_storer/syslog.log | grep '47450'") - Expect(err).NotTo(HaveOccurred()) - // assert the forwarded logs do not contain any slow queries - Expect(output).To(Not(ContainSubstring("Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0"))) - Expect(output).To(Not(ContainSubstring("Full_scan: No Full_join: No Tmp_table: No Tmp_table_on_disk: No"))) - Expect(output).To(Not(ContainSubstring("Filesort: No Filesort_on_disk: No Merge_passes: 0"))) - Expect(output).To(Not(ContainSubstring("No InnoDB statistics available for this query"))) - Expect(output).To(Not(ContainSubstring("DO sleep(10);"))) - }) It("rotates the slow query log", func() { By("allocating 51 MiB to the mysql_slow_query log") _, err := bosh.RemoteCommand(deploymentName, "mysql/0", "sudo fallocate -l 51MiB /var/vcap/sys/log/pxc-mysql/mysql_slow_query")