Bug 1469993 - mariadb library upgrade to 10.2 causes lua-sql FTBFS
Summary: mariadb library upgrade to 10.2 causes lua-sql FTBFS
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: lua-sql
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tim Niemueller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1467297
TreeView+ depends on / blocked
 
Reported: 2017-07-12 08:50 UTC by Augusto Caringi
Modified: 2017-10-26 15:53 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-10-26 15:53:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch to allow compilation of lua-sql with MariaDB 10.2 (233 bytes, patch)
2017-07-12 08:50 UTC, Augusto Caringi
no flags Details | Diff

Description Augusto Caringi 2017-07-12 08:50:03 UTC
Created attachment 1296782 [details]
Patch to allow compilation of lua-sql with MariaDB 10.2

Trying to build lua-sql with the new version of MariaDB 10.2 causes the following errors:

src/ls_mysql.c: In function 'conn_commit':
src/ls_mysql.c:427:21: error: invalid use of void expression
  lua_pushboolean(L, !mysql_commit(conn->my_conn));
                     ^
src/ls_mysql.c: In function 'conn_rollback':
src/ls_mysql.c:437:21: error: invalid use of void expression
  lua_pushboolean(L, !mysql_rollback(conn->my_conn));
                     ^
In file included from src/ls_mysql.c:21:0:
src/ls_mysql.c: In function 'luaopen_luasql_mysql':
src/ls_mysql.c:605:25: error: expected ')' before 'MYSQL_SERVER_VERSION'
     lua_pushliteral (L, MYSQL_SERVER_VERSION);
                         ^

In this new version of MariaDB they introduced a new mariadb_version.h header and mysql.h includes this header instead of mysql_version.h.
But the mysql_version.h is still present.

I'm attaching a simple patch proposal to fix the problem (I'm not sure if it's the best solution)

We are tracking all the possible problems regarding this MariaDB upgrade in the bug 1467297.

Copr build: https://copr.fedorainfracloud.org/coprs/g/db-sig/mariadb-10.2/package/lua-sql/

Comment 1 Adam Williamson 2017-07-21 21:13:05 UTC
So, I think there's actually a subtle *MariaDB* build system bug behind this (and all the other bugs where the problem is stuff from mysql_version.h):

https://jira.mariadb.org/browse/MDEV-13370

The mysql.h from *MariaDB itself* - that is, include/mysql.h in the tarball - actually does #include mysql_version.h . The problem is that we're not actually *getting* that mysql.h installed (and ultimately in the mariadb-devel package). Instead we're getting the mysql.h from libmariadb/include/mysql.h . libmariadb/ is in fact mariadb-connector-c included as a subproject. It seems that both libmariadb/include/CMakeLists.txt and include/CMakeLists.txt attempt to install their own mysql.h to the same place, so which one you get is ultimately a race. It looks to me like the build process happens to install the one from libmariadb/include first, and then declines to overwrite it with the one from include/ later, so we're actually ultimately shipping *the wrong mysql.h* - the one we're shipping is really from mariadb-connector-c , it's not MariaDB's own mysql.h . Because the one from mariadb-connector-c is only meant for building *client* applications, it doesn't include all the server symbols; it has its own mariadb_version.h file that doesn't define as much stuff as the server's mysql_version.h does.

Until upstream looks at this, I suggest we patch our mariadb package to get the right headers installed. I'll try and find a good way to do this. Once that's done, this kind of build failure *should* go away with no patching required...if I'm right.

Comment 2 Adam Williamson 2017-07-26 21:50:49 UTC
So, I did rebuild lua-sql while the mariadb build with the server headers installed was current. We switched it back to the client headers again, so for now lua-sql will again fail to build unless an explicit #include mysql_version.h is added, which doesn't really seem correct. I'm now waiting on upstream's response to MDEV-13370 before making any further changes.

Comment 3 Jan Kurik 2017-08-15 07:54:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 4 Augusto Caringi 2017-10-09 15:53:44 UTC
I think that we can close this bug, right?

It seems that Florian Weimer <fweimer> solved the problem on commit 379747177beb31132af65e13c27e8fd491085234

Comment 5 Michal Schorm 2017-10-26 15:53:31 UTC
This should be already solved for several weeks.


Note You need to log in before you can comment on or make changes to this bug.