From bdb1bc72309f43864b361442a5d90c7247ea80d3 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 9 Apr 2017 20:05:30 +0300 Subject: [PATCH 01/12] Add i386 Travis build matrix. --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 02a4f4a..d2b66d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,16 @@ env: - OS=ubuntu DIST=yakkety - OS=debian DIST=wheezy - OS=debian DIST=jessie + - OS=el DIST=6 ARCH=i386 + - OS=el DIST=7 ARCH=i386 + - OS=fedora DIST=24 ARCH=i386 + - OS=fedora DIST=25 ARCH=i386 + - OS=ubuntu DIST=precise ARCH=i386 + - OS=ubuntu DIST=trusty ARCH=i386 + - OS=ubuntu DIST=xenial ARCH=i386 + - OS=ubuntu DIST=yakkety ARCH=i386 + - OS=debian DIST=wheezy ARCH=i386 + - OS=debian DIST=jessie ARCH=i386 matrix: exclude: From b2ddd3f96e16a5cebecc46c9b5e6a87e542ac5f8 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 9 Apr 2017 21:39:05 +0300 Subject: [PATCH 02/12] Use --without-gcc-arch for Travis packaging. --- .travis.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2b66d4..e711f61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,15 +112,6 @@ addons: - clang-3.6 before_install: - # Upload builds corresponding to release tags to the 'sysbench' - # repository, push other ones to 'sysbench-prereleases' - - commits=$(git describe --long --always | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\2/p') - - > - if [ ${commits:-0} = 0 ]; then - PACKAGECLOUD_REPO=sysbench - else - PACKAGECLOUD_REPO=sysbench-prereleases - fi - > if [ "x$TARGET" = "xtest" ]; then case "${TRAVIS_OS_NAME:-linux}" in @@ -160,6 +151,18 @@ install: esac before_script: + # Upload builds corresponding to release tags to the 'sysbench' + # repository, push other ones to 'sysbench-prereleases' + - commits=$(git describe --long --always | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\2/p') + - > + if [ ${commits:-0} = 0 ]; then + PACKAGECLOUD_REPO=sysbench + else + PACKAGECLOUD_REPO=sysbench-prereleases + fi + # AX_GCC_ARCH cannot be used for packaging, need generic/native + # instruction sets + - CONFIGURE_FLAGS="--without-gcc-arch" - mysql -u root -e 'CREATE DATABASE sbtest' - psql -U postgres -c 'CREATE DATABASE sbtest' @@ -168,17 +171,17 @@ script: if [ -n "$TARGET" ]; then case "$TARGET" in test) - ./autogen.sh && ./configure --with-mysql --with-pgsql + ./autogen.sh && ./configure $CONFIGURE_FLAGS --with-mysql --with-pgsql make SBTEST_MYSQL_ARGS="--mysql-user=root" SBTEST_PGSQL_ARGS="--pgsql-user=postgres" make test ;; distcheck) - ./autogen.sh && ./configure --without-mysql + ./autogen.sh && ./configure $CONFIGURE_FLAGS --without-mysql make make distcheck ;; coverage) - ./autogen.sh && ./configure --enable-coverage --enable-asan --enable-msan --with-mysql --with-pgsql + ./autogen.sh && ./configure $CONFIGURE_FLAGS --enable-coverage --enable-asan --enable-msan --with-mysql --with-pgsql make -j2 SBTEST_MYSQL_ARGS="--mysql-user=root" SBTEST_PGSQL_ARGS="--pgsql-user=postgres" make test ;; From f5a9b34a616672eb35aca57b8d33e1bb85c6acef Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 9 Apr 2017 22:09:55 +0300 Subject: [PATCH 03/12] Remove unsupported i386 distributions from Travis build matrix. --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e711f61..6730055 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,10 +35,6 @@ env: - OS=ubuntu DIST=yakkety - OS=debian DIST=wheezy - OS=debian DIST=jessie - - OS=el DIST=6 ARCH=i386 - - OS=el DIST=7 ARCH=i386 - - OS=fedora DIST=24 ARCH=i386 - - OS=fedora DIST=25 ARCH=i386 - OS=ubuntu DIST=precise ARCH=i386 - OS=ubuntu DIST=trusty ARCH=i386 - OS=ubuntu DIST=xenial ARCH=i386 From 8ef8ed002d955da30ec8b5346452ffe9bec8041e Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 9 Apr 2017 22:11:02 +0300 Subject: [PATCH 04/12] Revert "Use --without-gcc-arch for Travis packaging." This reverts commit b2ddd3f96e16a5cebecc46c9b5e6a87e542ac5f8. --- .travis.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6730055..58a9861 100644 --- a/.travis.yml +++ b/.travis.yml @@ -108,6 +108,15 @@ addons: - clang-3.6 before_install: + # Upload builds corresponding to release tags to the 'sysbench' + # repository, push other ones to 'sysbench-prereleases' + - commits=$(git describe --long --always | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\2/p') + - > + if [ ${commits:-0} = 0 ]; then + PACKAGECLOUD_REPO=sysbench + else + PACKAGECLOUD_REPO=sysbench-prereleases + fi - > if [ "x$TARGET" = "xtest" ]; then case "${TRAVIS_OS_NAME:-linux}" in @@ -147,18 +156,6 @@ install: esac before_script: - # Upload builds corresponding to release tags to the 'sysbench' - # repository, push other ones to 'sysbench-prereleases' - - commits=$(git describe --long --always | sed -n 's/^\([0-9\.]*\)-\([0-9]*\)-\([a-z0-9]*\)/\2/p') - - > - if [ ${commits:-0} = 0 ]; then - PACKAGECLOUD_REPO=sysbench - else - PACKAGECLOUD_REPO=sysbench-prereleases - fi - # AX_GCC_ARCH cannot be used for packaging, need generic/native - # instruction sets - - CONFIGURE_FLAGS="--without-gcc-arch" - mysql -u root -e 'CREATE DATABASE sbtest' - psql -U postgres -c 'CREATE DATABASE sbtest' @@ -167,17 +164,17 @@ script: if [ -n "$TARGET" ]; then case "$TARGET" in test) - ./autogen.sh && ./configure $CONFIGURE_FLAGS --with-mysql --with-pgsql + ./autogen.sh && ./configure --with-mysql --with-pgsql make SBTEST_MYSQL_ARGS="--mysql-user=root" SBTEST_PGSQL_ARGS="--pgsql-user=postgres" make test ;; distcheck) - ./autogen.sh && ./configure $CONFIGURE_FLAGS --without-mysql + ./autogen.sh && ./configure --without-mysql make make distcheck ;; coverage) - ./autogen.sh && ./configure $CONFIGURE_FLAGS --enable-coverage --enable-asan --enable-msan --with-mysql --with-pgsql + ./autogen.sh && ./configure --enable-coverage --enable-asan --enable-msan --with-mysql --with-pgsql make -j2 SBTEST_MYSQL_ARGS="--mysql-user=root" SBTEST_PGSQL_ARGS="--pgsql-user=postgres" make test ;; From ec90a29d026ceb20f2e74d7403d164beb35f7634 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 9 Apr 2017 22:14:11 +0300 Subject: [PATCH 05/12] Pass --without-gcc-arch in packaging specifications, rather than .travis.yml. --- debian/rules | 2 +- rpm/sysbench.spec | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index af2cecd..8012a70 100755 --- a/debian/rules +++ b/debian/rules @@ -6,7 +6,7 @@ override_dh_auto_configure: dh_testdir autoreconf -vif - dh_auto_configure + dh_auto_configure -- --with-mysql --with-pgsql --without-gcc-arch override_dh_compress: dh_compress -X.lua diff --git a/rpm/sysbench.spec b/rpm/sysbench.spec index 75c286d..2ca481d 100644 --- a/rpm/sysbench.spec +++ b/rpm/sysbench.spec @@ -54,6 +54,7 @@ export CFLAGS="%{optflags}" autoreconf -vif %configure --with-mysql \ --with-pgsql \ + --without-gcc-arch %if 0%{?el6} make -j2 From 1a3e4a7e7c256e899b30ce5328db353c7f42aed9 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 9 Apr 2017 22:17:46 +0300 Subject: [PATCH 06/12] Exclude clang from i386 builds. --- .travis.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.travis.yml b/.travis.yml index 58a9861..e767534 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,6 +66,20 @@ matrix: compiler: clang - env: OS=debian DIST=stretch compiler: clang + - env: OS=ubuntu DIST=precise ARCH=i386 + compiler: clang + - env: OS=ubuntu DIST=trusty ARCH=i386 + compiler: clang + - env: OS=ubuntu DIST=xenial ARCH=i386 + compiler: clang + - env: OS=ubuntu DIST=yakkety ARCH=i386 + compiler: clang + - env: OS=debian DIST=wheezy ARCH=i386 + compiler: clang + - env: OS=debian DIST=jessie ARCH=i386 + compiler: clang + - env: OS=debian DIST=stretch ARCH=i386 + compiler: clang - env: OS=el DIST=6 os: osx - env: OS=el DIST=7 From a0374d46e02d29b3e5fd6bb80868b467659e1837 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 9 Apr 2017 22:37:38 +0300 Subject: [PATCH 07/12] Add libpq-dev to Debian/Ubuntu build dependencies. --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 248d647..4d41fbc 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: sysbench Section: misc Priority: extra Maintainer: Alexey Kopytov -Build-Depends: debhelper, autoconf, automake, libtool, libmysqlclient-dev, pkg-config, vim-common, python-minimal +Build-Depends: debhelper, autoconf, automake, libtool, libmysqlclient-dev, libpq-dev, pkg-config, vim-common, python-minimal Standards-Version: 3.9.5 Homepage: https://github.com/akopytov/sysbench From 94e48982c8919ebe77fcb513043e825feac0ccdf Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 9 Apr 2017 23:44:38 +0300 Subject: [PATCH 08/12] Force --platform=i686 for bundled CK to avoid its own autodetection. --- m4/sb_concurrency_kit.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/m4/sb_concurrency_kit.m4 b/m4/sb_concurrency_kit.m4 index dfcada2..f67ffcc 100644 --- a/m4/sb_concurrency_kit.m4 +++ b/m4/sb_concurrency_kit.m4 @@ -1,4 +1,4 @@ -# Copyright (C) 2016 Alexey Kopytov +# Copyright (C) 2016-2017 Alexey Kopytov # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,11 +43,16 @@ AS_IF([test "x$sb_cv_lib_ck" = "xsystem"], CK_CFLAGS="-I\$(abs_top_builddir)/third_party/concurrency_kit/include" CK_LIBS="\$(abs_top_builddir)/third_party/concurrency_kit/lib/libck.a" - # Assume 128-byte cache line on AArch64 and PowerPC case $target_cpu in powerpc*|aarch64) + # Assume 128-byte cache line on AArch64 and PowerPC CPPFLAGS="${CPPFLAGS} -DCK_MD_CACHELINE=128" ;; + i686*) + # Force --platform=i686 for CK, otherwise its configure script + # autodetects target based on 'uname -m' which doesn't work for + # cross-compiliation + CK_CONFIGURE_FLAGS="--platform=i686" esac # Add --enable-lse to CK build flags, if LSE instructions are supported by # the target architecture From 1a73781a16bdb8159c3d916758275fa1f91e1869 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Mon, 10 Apr 2017 07:03:55 +0300 Subject: [PATCH 09/12] Force --platform=i587 for bundled CK for i486 and i586 targets. --- m4/sb_concurrency_kit.m4 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/m4/sb_concurrency_kit.m4 b/m4/sb_concurrency_kit.m4 index f67ffcc..b5dbf14 100644 --- a/m4/sb_concurrency_kit.m4 +++ b/m4/sb_concurrency_kit.m4 @@ -48,11 +48,15 @@ AS_IF([test "x$sb_cv_lib_ck" = "xsystem"], # Assume 128-byte cache line on AArch64 and PowerPC CPPFLAGS="${CPPFLAGS} -DCK_MD_CACHELINE=128" ;; - i686*) - # Force --platform=i686 for CK, otherwise its configure script + # Force --platform=i*86 for CK, otherwise its configure script # autodetects target based on 'uname -m' which doesn't work for # cross-compiliation + i486*|i586*) + CK_CONFIGURE_FLAGS="--platform=i586" + ;; + i686*) CK_CONFIGURE_FLAGS="--platform=i686" + ;; esac # Add --enable-lse to CK build flags, if LSE instructions are supported by # the target architecture From 14ee3375f1f9185316233406123484bd5625aaae Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Mon, 10 Apr 2017 08:46:24 +0300 Subject: [PATCH 10/12] Avoid name conflicts for non-x86_64 architectures when deploying to packagecloud. --- .travis.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e767534..0d0a7f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -196,6 +196,15 @@ script: else git clone https://github.com/akopytov/packpack.git packpack packpack/packpack + + # To avoid name conflicts, deploy source packages only for + # "default", i.e. x86_64 architecture + if [[ -z "${ARCH}" ]]; then + PACKAGECLOUD_GLOB='build/*.{rpm,deb,dsc}' + else + # Exclude *.src.rpm and *.dsc + PACKAGECLOUD_GLOB='build/*{[^c].rpm,.deb}' + fi fi deploy: @@ -205,7 +214,7 @@ deploy: repository: "${PACKAGECLOUD_REPO}" token: "${PACKAGECLOUD_TOKEN}" dist: "${OS}/${DIST}" - package_glob: build/*.{rpm,deb,dsc} + package_glob: "${PACKAGECLOUD_GLOB}" skip_cleanup: true on: all_branches: true From 3348e8dfa3f3e587c9a01374f8c7764848cd05e7 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Wed, 12 Apr 2017 00:21:46 +0300 Subject: [PATCH 11/12] Remove unused gresults variable from drv_mysql.c. --- src/drivers/mysql/drv_mysql.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/drivers/mysql/drv_mysql.c b/src/drivers/mysql/drv_mysql.c index c9780f2..23e0c8a 100644 --- a/src/drivers/mysql/drv_mysql.c +++ b/src/drivers/mysql/drv_mysql.c @@ -49,9 +49,6 @@ #define SAFESTR(s) ((s != NULL) ? (s) : "(null)") -/* FIXME */ -db_bind_t *gresults; - /* MySQL driver arguments */ static sb_arg_t mysql_drv_args[] = @@ -651,9 +648,6 @@ int mysql_drv_bind_result(db_stmt_t *stmt, db_bind_t *params, size_t len) bind[i].is_null = params[i].is_null; } - /* FIXME */ - gresults = params; - rc = mysql_stmt_bind_result(stmt->ptr, bind); DEBUG("mysql_stmt_bind_result(%p, %p) = %d", stmt->ptr, bind, rc); if (rc) From 6ad3f09a0790ba983b364222045ea2f6007d609b Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Wed, 12 Apr 2017 00:24:34 +0300 Subject: [PATCH 12/12] Fix builds with MySQL 8.0.1 client libraries. my_bool has been replaced with bool in MySQL 8.0.1. --- src/drivers/mysql/drv_mysql.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/mysql/drv_mysql.c b/src/drivers/mysql/drv_mysql.c index 23e0c8a..0617904 100644 --- a/src/drivers/mysql/drv_mysql.c +++ b/src/drivers/mysql/drv_mysql.c @@ -49,6 +49,10 @@ #define SAFESTR(s) ((s != NULL) ? (s) : "(null)") +#if MYSQL_VERSION_ID >= 80001 +typedef bool my_bool; +#endif + /* MySQL driver arguments */ static sb_arg_t mysql_drv_args[] =