Skip to content

Commit

Permalink
Merge 10.7 into 10.8
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Nov 17, 2022
2 parents 038cd51 + d533208 commit f46efb4
Show file tree
Hide file tree
Showing 98 changed files with 2,997 additions and 3,548 deletions.
39 changes: 29 additions & 10 deletions debian/autobake-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ then
sed '/Add support for verbose builds/,/^$/d' -i debian/rules
elif [ -d storage/columnstore/columnstore/debian ]
then
# ColumnStore is explicitly disabled in the native Debian build, so allow it
# ColumnStore is explicitly disabled in the native Debian build. Enable it
# now when build is triggered by autobake-deb.sh (MariaDB.org) and when the
# build is not running on Travis or Gitlab-CI
# build is not running on Gitlab-CI.
sed '/-DPLUGIN_COLUMNSTORE=NO/d' -i debian/rules
# Take the files and part of control from MCS directory
if [ ! -f debian/mariadb-plugin-columnstore.install ]
Expand Down Expand Up @@ -59,13 +59,13 @@ replace_uring_with_aio()
{
sed 's/liburing-dev/libaio-dev/g' -i debian/control
sed -e '/-DIGNORE_AIO_CHECK=YES/d' \
-e '/-DWITH_URING=yes/d' -i debian/rules
-e '/-DWITH_URING=YES/d' -i debian/rules
}

disable_pmem()
{
sed '/libpmem-dev/d' -i debian/control
sed '/-DWITH_PMEM=yes/d' -i debian/rules
sed '/-DWITH_PMEM=YES/d' -i debian/rules
}

disable_libfmt()
Expand All @@ -76,15 +76,34 @@ disable_libfmt()

architecture=$(dpkg-architecture -q DEB_BUILD_ARCH)

# Parse release name and number from Linux standard base release
# Example:
# $ lsb_release -a
# No LSB modules are available.
# Distributor ID: Debian
# Description: Debian GNU/Linux bookworm/sid
# Release: n/a
# Codename: n/a
LSBID="$(lsb_release -si | tr '[:upper:]' '[:lower:]')"
LSBVERSION="$(lsb_release -sr | sed -e "s#\.##g")"
LSBNAME="$(lsb_release -sc)"

# If 'n/a', assume 'sid'
if [ "${LSBVERSION}" == "n/a" ] || [ "${LSBNAME}" == "n/a" ]
then
LSBVERSION="sid"
LSBNAME="sid"
fi

# If not known, use 'unknown' in .deb version identifier
if [ -z "${LSBID}" ]
then
LSBID="unknown"
fi
case "${LSBNAME}" in

case "${LSBNAME}"
in
# Debian
stretch)
# MDEV-16525 libzstd-dev-1.1.3 minimum version
sed -e '/libzstd-dev/d' \
Expand Down Expand Up @@ -113,10 +132,10 @@ case "${LSBNAME}" in
fi
;&
sid)
# should always be empty here.
# need to match here to avoid the default Error however
# The default packaging should always target Debian Sid, so in this case
# there is intentionally no customizations whatsoever.
;;
# UBUNTU
# Ubuntu
bionic)
remove_rocksdb_tools
[ "$architecture" != amd64 ] && disable_pmem
Expand All @@ -143,7 +162,7 @@ case "${LSBNAME}" in
fi
;;
*)
echo "Error - unknown release codename $LSBNAME" >&2
echo "Error: Unknown release '$LSBNAME'" >&2
exit 1
esac

Expand All @@ -162,7 +181,7 @@ LOGSTRING="MariaDB build"
EPOCH="1:"
VERSION="${EPOCH}${UPSTREAM}${PATCHLEVEL}~${LSBID:0:3}${LSBVERSION}"

dch -b -D ${LSBNAME} -v "${VERSION}" "Automatic build with ${LOGSTRING}." --controlmaint
dch -b -D "${LSBNAME}" -v "${VERSION}" "Automatic build with ${LOGSTRING}." --controlmaint

echo "Creating package version ${VERSION} ... "

Expand Down
15 changes: 12 additions & 3 deletions debian/mariadb-server-10.8.mariadb.init
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ test -x /usr/sbin/mariadbd || exit 0

. /lib/lsb/init-functions

SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)

MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
SELF=$(cd "$(dirname $0)"; pwd -P)/$(basename $0)

if [ -f /usr/bin/mariadb-admin ]
then
MYADMIN="/usr/bin/mariadb-admin --defaults-file=/etc/mysql/debian.cnf"
elif [ -f /usr/bin/mysqladmin ]
then
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
else
log_failure_msg "Command mariadb-admin/mysqladmin not found! This SysV init script depends on it."
exit -1
fi

# priority can be overridden and "-s" adds output to stderr
ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mariadb -i"
Expand Down
21 changes: 12 additions & 9 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ export DEB_BUILD_HARDENING=1

# enable Debian Hardening
# see: https://wiki.debian.org/Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Disable LTO on Ubuntu, see LP: #1970634 and https://jira.mariadb.org/browse/MDEV-25633
ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes), yes)
export DEB_BUILD_MAINT_OPTIONS += optimize=-lto
endif

DPKG_EXPORT_BUILDFLAGS = 1
# Include all defaults, including buildflags.mk
include /usr/share/dpkg/default.mk
Expand Down Expand Up @@ -46,11 +52,6 @@ ifeq (32,$(DEB_HOST_ARCH_BITS))
CMAKEFLAGS += -DPLUGIN_ROCKSDB=NO
endif

# ColumnStore can build only on amd64 and arm64
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),amd64 arm64))
CMAKEFLAGS += -DPLUGIN_COLUMNSTORE=NO
endif

# Cross building requires stack direction instruction
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),alpha amd64 arm arm64 i386 ia64 m68k mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64))
Expand All @@ -64,7 +65,7 @@ endif
# Only attempt to build with PMEM on archs that have package libpmem-dev available
# See https://packages.debian.org/search?searchon=names&keywords=libpmem-dev
ifneq (,$(filter $(DEB_HOST_ARCH_CPU),amd64 arm64 ppc64el riscv64))
CMAKEFLAGS += -DWITH_PMEM=yes
CMAKEFLAGS += -DWITH_PMEM=YES
endif

# Add support for verbose builds
Expand Down Expand Up @@ -105,9 +106,9 @@ endif
-DBUILD_CONFIG=mysql_release \
-DCONC_DEFAULT_CHARSET=utf8mb4 \
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
-DPLUGIN_COLUMNSTORE=NO \
-DPLUGIN_COLUMNSTORE=NO \
-DIGNORE_AIO_CHECK=YES \
-DWITH_URING=yes \
-DWITH_URING=YES \
-DDEB=$(DEB_VENDOR)

# This is needed, otherwise 'make test' will run before binaries have been built
Expand All @@ -120,6 +121,7 @@ override_dh_auto_build:
override_dh_auto_test:
@echo "RULES.$@"
dh_testdir
# Ensure at least an empty file exists
touch mysql-test/unstable-tests
[ ! -f debian/unstable-tests.$(DEB_HOST_ARCH) ] || cat debian/unstable-tests.$(DEB_HOST_ARCH) >> mysql-test/unstable-tests
# Run testsuite
Expand Down Expand Up @@ -203,6 +205,7 @@ override_dh_installinit-arch:
dh_installinit --name=mariadb --no-start -- defaults 19 21
dh_systemd_start --restart-after-upgrade

# Use custom server version string variable
override_dh_gencontrol:
dh_gencontrol -- -Tdebian/substvars

Expand Down
77 changes: 52 additions & 25 deletions debian/salsa-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@ variables:
GIT_SUBMODULE_STRATEGY: recursive
SALSA_CI_GBP_BUILDPACKAGE_ARGS: "--git-submodules" # did not apply to extract-sources

# Extend Salsa-CI build jobs to have longer timeout as the default GitLab
# timeout (1h) is often not enough
.build-package:
timeout: 3h

stages:
- provisioning
- build
- test
- upgrade in Sid
- upgrade from Bullseye/Buster
- upgrade from Bullseye
- upgrade extras
- test extras
- publish # Stage referenced by Salsa-CI template aptly stanza, so must exist even though not used
Expand Down Expand Up @@ -134,6 +139,17 @@ blhc:
apt-get update
apt-get install -y apt

.test-enable-buster-backports-repos: &test-enable-buster-backports-repos |
# Enable buster-backports (assumes environment already Debian Buster)
echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/buster-backports.list
# Increase default backports priority policy from '100' to '500' so it can actually be used
cat << EOF > /etc/apt/preferences.d/enable-backports-to-satisfy-dependencies
Package: *
Pin: release n=buster-*
Pin-Priority: 500
EOF
apt-get update

.test-install: &test-install |
# Install MariaDB built in this commit
apt-get install -y ./*.deb
Expand Down Expand Up @@ -213,7 +229,7 @@ fresh install:
script:
- *test-prepare-container
- *test-install
- service mariadb status # There is no init.d/mysql in MariaDB 10.8
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
variables:
GIT_STRATEGY: none
Expand All @@ -234,7 +250,7 @@ mariadb-10.8 Sid upgrade:
script:
- *test-prepare-container
- *test-install
- service mariadb status # There is no init.d/mysql in MariaDB 10.8
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
variables:
GIT_STRATEGY: none
Expand All @@ -243,7 +259,7 @@ mariadb-10.8 Sid upgrade:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/

mariadb-10.5 Bullseye to mariadb-10.8 upgrade:
stage: upgrade from Bullseye/Buster
stage: upgrade from Bullseye
needs:
- job: build
image: debian:bullseye
Expand All @@ -268,10 +284,12 @@ mariadb-10.5 Bullseye to mariadb-10.8 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/

mariadb-10.3 Buster to mariadb-10.8 upgrade:
stage: upgrade from Bullseye/Buster
# Upgrade of libcrypt.so.1 no longer possible from Buster to Sid,
# so test upgrade only inside Buster (https://bugs.debian.org/993755)
mariadb-10.3 to mariadb-10.8 upgrade in Buster:
stage: upgrade extras
needs:
- job: build
- job: build buster-backports
image: debian:buster
artifacts:
when: always
Expand All @@ -284,7 +302,7 @@ mariadb-10.3 Buster to mariadb-10.8 upgrade:
- apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*'
# Verify installation of MariaDB from Buster
- *test-verify-initial
- *test-enable-sid-repos
- *test-enable-buster-backports-repos
- *test-install
- service mysql status
- *test-verify-final
Expand All @@ -307,7 +325,7 @@ test basic features:
script:
- *test-prepare-container
- *test-install
- service mariadb status # There is no init.d/mysql in MariaDB 10.8
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
- |
# Print info about server
Expand Down Expand Up @@ -452,7 +470,7 @@ default-libmysqlclient-dev Sid upgrade:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/

default-libmysqlclient-dev Bullseye upgrade:
stage: upgrade from Bullseye/Buster
stage: upgrade from Bullseye
needs:
- job: build
image: debian:bullseye
Expand All @@ -472,10 +490,12 @@ default-libmysqlclient-dev Bullseye upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/

default-libmysqlclient-dev Buster upgrade:
stage: upgrade from Bullseye/Buster
# Upgrade of libcrypt.so.1 no longer possible from Buster to Sid,
# so test upgrade only inside Buster (https://bugs.debian.org/993755)
default-libmysqlclient-dev upgrade in Buster:
stage: upgrade extras
needs:
- job: build
- job: build buster-backports
image: debian:buster
artifacts:
when: always
Expand All @@ -486,7 +506,7 @@ default-libmysqlclient-dev Buster upgrade:
- *test-prepare-container
- apt-get install -y pkg-config default-libmysqlclient-dev
- pkg-config --list-all
- *test-enable-sid-repos
- *test-enable-buster-backports-repos
- *test-install-all-libs
- *test-verify-libs
except:
Expand All @@ -511,8 +531,20 @@ mysql-8.0 Sid to mariadb-10.8 upgrade:
- apt-get install -y procps mysql-server 'libmysqlc*'
- *test-verify-initial
- *test-install
- service mysql status
# The Debian version of MariaDB 10.6 still maintains compatibility and there
# running 'service mysql status' in Salsa-CI job 'mysql-8.0 Sid to
# mariadb-10.6 upgrade' still works.
#
# However, due to debian/control changes, the upstream MariaDB 10.6 when
# installed on a system with a previous installation of MySQL 8.0 will first
# fully remove MySQL, including the /etc/init.d/mysql file, so previous
# techniques in mariadb-server-10.6.postinst to maintain backwards
# compatibility with 'service mysql status' after installing MariaDB on top
# MySQL no longer works, and thus the step to test it now intentionally has
# a fallback to use the service name 'mariadb' instead, and the fallback is
# always used.
- sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server
- service mysql status || service mariadb status
- *test-verify-final
variables:
GIT_STRATEGY: none
Expand All @@ -522,7 +554,7 @@ mysql-8.0 Sid to mariadb-10.8 upgrade:

# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump.
# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh.
mysql-8.0 Focal to mariadb-10.8 upgrade:
mysql-8.0 Focal to mariadb-10.8 upgrade in Buster:
stage: upgrade extras
needs:
- job: build buster-backports
Expand Down Expand Up @@ -622,18 +654,13 @@ mariadb.org-10.6 to mariadb-10.8 upgrade:
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- service mariadb status # There is no init.d/mysql in MariaDB 10.8
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
variables:
GIT_STRATEGY: none
except:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/
allow_failure: true
# Installation on Sid fails on missing liburing1 because upstream 10.8
# MariaDB.org buildbot has not run 'apt upgrade' for a long time.
# Remove this allow_failure once buildbot has built a new 10.8
# release using latest liburing-dev in Debian Sid.

mariadb.org-10.5 to mariadb-10.8 upgrade:
stage: upgrade extras
Expand All @@ -657,7 +684,7 @@ mariadb.org-10.5 to mariadb-10.8 upgrade:
# Verify installation of MariaDB built in this commit
- dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed
- mariadb --version # Client version
- service mariadb status # There is no init.d/mysql in MariaDB 10.5
- service mariadb status # There is no init.d/mysql in MariaDB 10.5+
- *test-verify-final
variables:
GIT_STRATEGY: none
Expand Down Expand Up @@ -768,7 +795,7 @@ mariadb.org-10.2 to mariadb-10.8 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/

mysql.com-5.7 to mariadb-10.8 upgrade:
mysql.com-5.7 to mariadb-10.8 upgrade in Buster:
stage: upgrade extras
needs:
- job: build buster-backports
Expand Down Expand Up @@ -799,7 +826,7 @@ mysql.com-5.7 to mariadb-10.8 upgrade:
variables:
- $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/

percona-xtradb-5.7 to mariadb-10.8 upgrade (MDEV-22679):
percona-xtradb-5.7 to mariadb-10.8 upgrade in Buster (MDEV-22679):
stage: upgrade extras
needs:
- job: build buster-backports
Expand Down
Loading

0 comments on commit f46efb4

Please sign in to comment.