[Bug 1840511] Re: Eoan FTBFS with gcc-9 and MySQL 8
Gianfranco Costamagna
costamagnagianfranco at yahoo.it
Tue Oct 15 10:14:41 UTC 2019
** Changed in: clickhouse (Ubuntu Eoan)
Status: In Progress => Fix Committed
** Changed in: clickhouse (Ubuntu Eoan)
Status: Fix Committed => Fix Released
--
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 clickhouse source package in Eoan:
Fix Released
Status in gcc-9 source package in Eoan:
In Progress
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