[Bug 1840511] Re: Eoan FTBFS with gcc-9 and MySQL 8
Rafael David Tinoco
rafaeldtinoco at kernelpath.com
Tue Aug 20 12:58:17 UTC 2019
Im attaching 2 patches to the case:
- Fixing MySQL building issue (proposed upstream)
- Mitigating GCC 9 issue (reported upstream)
Package maintainer already mitigated both with different patches.
clickhouse (18.16.1+ds-4ubuntu1) eoan; urgency=medium
* Use gcc-8 to build: see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91500
* Patch to make it build with mysql
-- Gianfranco Costamagna <locutusofborg at debian.org> Tue, 20 Aug 2019
13:39:54 +0200
Forcing GCC 8 instead and including mysql.h to a C++ header. These 2
patches could be considered now or in a near future merge, when upstream
issues are addressed.
** Also affects: clickhouse (Ubuntu Eoan)
Importance: Medium
Assignee: Rafael David Tinoco (rafaeldtinoco)
Status: In Progress
** Also affects: mysql-8.0 (Ubuntu)
Importance: Undecided
Status: New
** Also affects: gcc-9 (Ubuntu)
Importance: Undecided
Status: New
** Bug watch added: GCC Bugzilla #91500
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91500
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-9 in Ubuntu.
https://bugs.launchpad.net/bugs/1840511
Title:
Eoan FTBFS with gcc-9 and MySQL 8
Status in clickhouse package in Ubuntu:
Fix Released
Status in gcc-9 package in Ubuntu:
In Progress
Status in mysql-8.0 package in Ubuntu:
Fix Released
Status in clickhouse source package in Eoan:
Fix Released
Status in gcc-9 source package in Eoan:
In Progress
Status in mysql-8.0 source package in Eoan:
Fix Released
Bug description:
C and C++ differ in the form of types being defined. While C++ structs are defined also as new types, in C you have to explicitly typedef the struct to have a new type. From clickhouse source code, we are getting:
https://launchpadlibrarian.net/429654087/buildlog_ubuntu-eoan-
amd64.clickhouse_18.16.1+ds-4build1_BUILDING.txt.gz
----
[ 6%] Building CXX object libs/libmysqlxx/CMakeFiles/mysqlxx.dir/src/Connection.cpp.o
cd /<<BUILDDIR>>/clickhouse-18.16.1+ds/obj-x86_64-linux-gnu/libs/libmysqlxx && /usr/bin/c++ -I/<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libmysqlxx/include -I/<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libcommon/include -I/<<BUILDDIR>>/clickhouse-18.16.1+ds/obj-x86_64-linux-gnu/libs/libcommon/include -I/<<BUILDDIR>>/clickhouse-18.16.1+ds/contrib/cityhash102/include -g -O2 -fdebug-prefix-map=/<<BUILDDIR>>/clickhouse-18.16.1+ds=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -pipe -fno-omit-frame-pointer -Wall -Wnon-virtual-dtor -O2 -g -DNDEBUG -O3 -flto -fno-fat-lto-objects -fPIC -std=c++17 -o CMakeFiles/mysqlxx.dir/src/Connection.cpp.o -c /<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libmysqlxx/src/Connection.cpp
In file included from /<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libmysqlxx/include/mysqlxx/ResultBase.h:4,
from /<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libmysqlxx/include/mysqlxx/UseQueryResult.h:3,
from /<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libmysqlxx/include/mysqlxx/Query.h:6,
from /<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libmysqlxx/include/mysqlxx/Connection.h:10,
from /<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libmysqlxx/src/Connection.cpp:7:
/<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libmysqlxx/include/mysqlxx/Types.h:7:23: error: conflicting declaration ‘using MYSQL = struct st_mysql’
using MYSQL = st_mysql;
^
In file included from /<<BUILDDIR>>/clickhouse-18.16.1+ds/libs/libmysqlxx/src/Connection.cpp:4:
/usr/include/mysql/mysql.h:335:3: note: previous declaration as ‘typedef struct MYSQL MYSQL’
} MYSQL;
----
If I edit file libs/libmysqlxx/include/mysqlxx/Types.h and comment the
following lines:
//struct st_mysql;
//using MYSQL = st_mysql;
//
//struct st_mysql_res;
//using MYSQL_RES = st_mysql_res;
//
//using MYSQL_ROW = char**;
//
//struct st_mysql_field;
//using MYSQL_FIELD = st_mysql_field;
and add
#include <mysql/mysql.h>
I solve the issue, as MYSQL, MYSQL_RES, MYSQL_ROW and MYSQL_FIELD
types are defined by the mysql.h header file (as C++ would expect).
----
Unfortunately doing that with gcc-9 was not successful not because of
the change, per se, but gcc-9 crashed during clickhouse compilation.
When changing gcc-9 to gcc-8 as the default compiler (Ubuntu Eoan
userland) I was able to compile clickhouse libmysqlxx library
successfully.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/clickhouse/+bug/1840511/+subscriptions
More information about the foundations-bugs
mailing list