Bug 1469993 - mariadb library upgrade to 10.2 causes lua-sql FTBFS [NEEDINFO]
mariadb library upgrade to 10.2 causes lua-sql FTBFS
Status: NEW
Product: Fedora
Classification: Fedora
Component: lua-sql (Show other bugs)
27
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tim Niemueller
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 1467297
  Show dependency treegraph
 
Reported: 2017-07-12 04:50 EDT by Augusto Caringi
Modified: 2017-10-09 11:53 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
acaringi: needinfo? (tim)
acaringi: needinfo? (tim)


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

  None (edit)
Description Augusto Caringi 2017-07-12 04:50:03 EDT
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 17:13:05 EDT
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 17:50:49 EDT
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 03:54:35 EDT
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 11:53:44 EDT
I think that we can close this bug, right?

It seems that Florian Weimer <fweimer@redhat.com> solved the problem on commit 379747177beb31132af65e13c27e8fd491085234

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