[debian-mysql] Bug#920365: Bug#920365: Bug#920365: mariadb_config: improve cross compilation support

Helmut Grohne helmut at subdivi.de
Mon Sep 28 21:57:28 BST 2020


Hi Otto,

On Mon, Sep 28, 2020 at 10:24:16PM +0300, Otto Kekäläinen wrote:
> > While looking into it anyway, I was wondering why you are running cmake
> > directly instead of running it through dh_auto_configure. Can you shed
> > light on that question? Using dh_auto_configure would automatically pass
> > -DCMAKE_SYSTEM_NAME=..., which is required for cross compiling mariadb.
> 
> The cmake line has been manually defined in the debian/rules files
> since the beginning of time and mysql-5.0 packaging or something.
> There are so many customizations – I don't know if we can dismantle
> it.

Yeah, but that seems like "historical cruft" to me. I'm attaching a
patch that makes it use dh_auto_configure. Unfortunately, when I build
it with that patch, I get test suite failures about "debug_sync" being
unknown. I'm not sure whether that is caused by my build environment or
the change. Can you make that work?

For amd64, the generated cmake invocation becomes:

	install -d builddir
	cd builddir && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu "-DCOMPILATION_COMMENT=Debian unstable " -DMYSQL_SERVER_SUFFIX=-1.1 -DSYSTEM_TYPE=debian-linux-gnu -DBUILD_CONFIG=mysql_release -DWITH_SSL=bundled -DPLUGIN_TOKUDB=NO -DPLUGIN_CASSANDRA=NO -DPLUGIN_AWS_KEY_MANAGEMENT=NO -DPLUGIN_COLUMNSTORE=NO -DWITH_INNODB_SNAPPY=ON -DDEB=Debian ..

The stuff that comes before -DCOMPILATION_COMMENT=... is inserted by
debhelper.

Helmut
-------------- next part --------------
diff --minimal -Nru mariadb-10.5-10.5.5/debian/changelog mariadb-10.5-10.5.5/debian/changelog
--- mariadb-10.5-10.5.5/debian/changelog	2020-09-25 18:56:59.000000000 +0200
+++ mariadb-10.5-10.5.5/debian/changelog	2020-09-28 22:22:58.000000000 +0200
@@ -1,3 +1,10 @@
+mariadb-10.5 (1:10.5.5-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use dh_auto_configure.
+
+ -- Helmut Grohne <helmut at subdivi.de>  Mon, 28 Sep 2020 22:22:58 +0200
+
 mariadb-10.5 (1:10.5.5-1) unstable; urgency=medium
 
   * New upstream version 10.5.5 (Closes: #968895)
diff --minimal -Nru mariadb-10.5-10.5.5/debian/rules mariadb-10.5-10.5.5/debian/rules
--- mariadb-10.5-10.5.5/debian/rules	2020-09-17 22:17:28.000000000 +0200
+++ mariadb-10.5-10.5.5/debian/rules	2020-09-28 22:22:57.000000000 +0200
@@ -22,9 +22,6 @@
 RELEASE := $(shell lsb_release -r -s) # Use changelog based DEB_DISTRIBUTION instead?
 TMP:=$(CURDIR)/debian/tmp
 
-CC := $(DEB_HOST_GNU_TYPE)-gcc
-CXX := $(DEB_HOST_GNU_TYPE)-g++
-
 # According to Debian Policy version 4.2.0 builds should be as verbose as
 # possible unless 'terse' is specifically passed.
 ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
@@ -94,18 +91,14 @@
 	# Remove -DWITH_SSL=bundle if you want to use system OpenSSL, otherwise
 	# the server will use YaSSL and Connector/C will use GnuTLS.
 	# Don't build ColumnStore, not mature enough for Debian yet.
-	mkdir -p $(BUILDDIR) && cd $(BUILDDIR) && \
-	sh -c  'PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \
-	    	CC=${CC} \
-	    	CXX=${CXX} \
-	    	NO_UPDATE_BUILD_VERSION=1 \
-	    cmake -DCMAKE_INSTALL_PREFIX=/usr \
+	PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \
+	    NO_UPDATE_BUILD_VERSION=1 \
+	    dh_auto_configure --builddirectory=$(BUILDDIR) -- \
 	    $(CMAKEFLAGS) \
 	    $(if $(filter $(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)),,-DIMPORT_EXECUTABLES=$(CURDIR)/builddir-native/import_executables.cmake) \
 	    -DCOMPILATION_COMMENT="$(DEB_VENDOR) $(RELEASE)" \
 	    -DMYSQL_SERVER_SUFFIX="-$(DEB_VERSION_REVISION)" \
 	    -DSYSTEM_TYPE="debian-$(DEB_HOST_GNU_SYSTEM)" \
-	    -DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_ARCH) \
 	    -DBUILD_CONFIG=mysql_release \
 	    -DWITH_SSL=bundled \
 	    -DPLUGIN_TOKUDB=NO \
@@ -113,7 +106,7 @@
 	    -DPLUGIN_AWS_KEY_MANAGEMENT=NO \
 	    -DPLUGIN_COLUMNSTORE=NO \
 	    -DWITH_INNODB_SNAPPY=ON \
-	    -DDEB=$(DEB_VENDOR) ..'
+	    -DDEB=$(DEB_VENDOR)
 
 # This is needed, otherwise 'make test' will run before binaries have been built
 override_dh_auto_build:


More information about the pkg-mysql-maint mailing list