Bug 221242 - databases/mariadb102-client: MYSQL_SERVER_VERSION is not defined in mysql_version.h of mariadb102-client-10.2.9_1
Summary: databases/mariadb102-client: MYSQL_SERVER_VERSION is not defined in mysql_ver...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on: 222825
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-05 11:23 UTC by Piotr Kubaj
Modified: 2018-06-20 15:04 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
patch (1.97 KB, patch)
2017-08-05 11:23 UTC, Piotr Kubaj
no flags Details | Diff
svn diff for databases/mydumper (2.91 KB, patch)
2017-10-25 11:12 UTC, Bernard Spil
brnrd: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer freebsd_triage 2017-08-05 11:23:12 UTC
Created attachment 185042 [details]
patch

MariaDB 10.2 needs additional include.

Also, ssl is needed:
====> Running Q/A tests (stage-qa)
Warning: you need USES=ssl
Error: /usr/local/sbin/mydumper is linked to /usr/local/lib/libiconv.so.2 from converters/libiconv but it is not declared as a dependency

The port builds fine on Poudriere with 10.3-RELEASE (with default MySQL 5.6 and MariaDB 10.2).
Comment 1 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-08-05 23:45:33 UTC
I think the stage-qa result is false positive. mydumper itself does not use iconv or ssl. Those dependencies are brought from USES=gnome and USES=mysql.

I do not understand the patch as I see '#include "mysql_version.h"' in include/mysql.h in mariadb 10.2 tarball.
Comment 2 Piotr Kubaj freebsd_committer freebsd_triage 2017-08-06 08:35:38 UTC
(In reply to Po-Chuan Hsieh from comment #1)
You may be right about USES, but I have errors building against MariaDB 10.2:
(00:00:46) ===>  Building for mydumper-0.9.1
(00:00:47) [1/6] /usr/bin/cc  -I/usr/local/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Wall -Wno-deprecated-declarations -Wunused -Wwrite-strings -Wno-strict-aliasing -Wextra -Wshadow  -O3 -g -I/usr/local/include/mysql -I/usr/local/include/mysql/.. -O2 -pipe  -DHARDENEDBSD -fPIE -fPIC -fstack-protector -fno-strict-aliasing -MD -MT CMakeFiles/mydumper.dir/server_detect.c.o -MF CMakeFiles/mydumper.dir/server_detect.c.o.d -o CMakeFiles/mydumper.dir/server_detect.c.o   -c server_detect.c
(00:00:47) [2/6] /usr/bin/cc  -I/usr/local/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Wall -Wno-deprecated-declarations -Wunused -Wwrite-strings -Wno-strict-aliasing -Wextra -Wshadow  -O3 -g -I/usr/local/include/mysql -I/usr/local/include/mysql/.. -O2 -pipe  -DHARDENEDBSD -fPIE -fPIC -fstack-protector -fno-strict-aliasing -MD -MT CMakeFiles/myloader.dir/myloader.c.o -MF CMakeFiles/myloader.dir/myloader.c.o.d -o CMakeFiles/myloader.dir/myloader.c.o   -c myloader.c
(00:00:47) FAILED: CMakeFiles/myloader.dir/myloader.c.o 
(00:00:47) /usr/bin/cc  -I/usr/local/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Wall -Wno-deprecated-declarations -Wunused -Wwrite-strings -Wno-strict-aliasing -Wextra -Wshadow  -O3 -g -I/usr/local/include/mysql -I/usr/local/include/mysql/.. -O2 -pipe  -DHARDENEDBSD -fPIE -fPIC -fstack-protector -fno-strict-aliasing -MD -MT CMakeFiles/myloader.dir/myloader.c.o -MF CMakeFiles/myloader.dir/myloader.c.o.d -o CMakeFiles/myloader.dir/myloader.c.o   -c myloader.c
(00:00:47) myloader.c:117:61: error: use of undeclared identifier 'MYSQL_SERVER_VERSION'
(00:00:47)                 g_print("myloader %s, built against MySQL %s\n", VERSION, MYSQL_SERVER_VERSION);
(00:00:47)                                                                           ^
(00:00:47) 1 error generated.
(00:00:47) [3/6] /usr/bin/cc  -I/usr/local/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Wall -Wno-deprecated-declarations -Wunused -Wwrite-strings -Wno-strict-aliasing -Wextra -Wshadow  -O3 -g -I/usr/local/include/mysql -I/usr/local/include/mysql/.. -O2 -pipe  -DHARDENEDBSD -fPIE -fPIC -fstack-protector -fno-strict-aliasing -MD -MT CMakeFiles/mydumper.dir/g_unix_signal.c.o -MF CMakeFiles/mydumper.dir/g_unix_signal.c.o.d -o CMakeFiles/mydumper.dir/g_unix_signal.c.o   -c g_unix_signal.c
(00:00:47) [4/6] /usr/bin/cc  -I/usr/local/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Wall -Wno-deprecated-declarations -Wunused -Wwrite-strings -Wno-strict-aliasing -Wextra -Wshadow  -O3 -g -I/usr/local/include/mysql -I/usr/local/include/mysql/.. -O2 -pipe  -DHARDENEDBSD -fPIE -fPIC -fstack-protector -fno-strict-aliasing -MD -MT CMakeFiles/mydumper.dir/mydumper.c.o -MF CMakeFiles/mydumper.dir/mydumper.c.o.d -o CMakeFiles/mydumper.dir/mydumper.c.o   -c mydumper.c
(00:00:47) FAILED: CMakeFiles/mydumper.dir/mydumper.c.o 
(00:00:47) /usr/bin/cc  -I/usr/local/include/mysql -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -Wall -Wno-deprecated-declarations -Wunused -Wwrite-strings -Wno-strict-aliasing -Wextra -Wshadow  -O3 -g -I/usr/local/include/mysql -I/usr/local/include/mysql/.. -O2 -pipe  -DHARDENEDBSD -fPIE -fPIC -fstack-protector -fno-strict-aliasing -MD -MT CMakeFiles/mydumper.dir/mydumper.c.o -MF CMakeFiles/mydumper.dir/mydumper.c.o.d -o CMakeFiles/mydumper.dir/mydumper.c.o   -c mydumper.c
(00:00:47) mydumper.c:812:61: error: use of undeclared identifier 'MYSQL_SERVER_VERSION'
(00:00:47)                 g_print("mydumper %s, built against MySQL %s\n", VERSION, MYSQL_SERVER_VERSION);
(00:00:47)                                                                           ^
(00:00:47) 1 error generated.
Comment 3 Piotr Kubaj freebsd_committer freebsd_triage 2017-08-06 08:37:51 UTC
(In reply to Po-Chuan Hsieh from comment #1)
And there's actually no such include in ${PREFIX}/include/mysql/mysql.h:
root@db:~ # grep mysql_version.h /usr/local/include/mysql/mysql.h
root@db:~ #
Comment 4 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-09-11 13:12:11 UTC
(In reply to Piotr Kubaj from comment #3)

You're correct. I checked mariadb102-client-10.2.7.txz, mysql.h includes mariadb_version.h but MYSQL_SERVER_VERSION is only defined in mysql_version.h.

IMHO, it'd be better to patch MariaDB 10.2 client rather than individual ports.

brnrd@ (MariaDB 10.2 maintainer) is cc'd. He might give some advice/comment for this.

Thanks in advance.
Comment 5 Bernard Spil freebsd_committer freebsd_triage 2017-10-15 16:51:25 UTC
Hadn't tested but happy that the other commit fixes this too!
Comment 6 Piotr Kubaj freebsd_committer freebsd_triage 2017-10-15 20:32:57 UTC
(In reply to Bernard Spil from comment #5)
Except that it doesn't :) That was another issue, which appeared after upgrade to 10.2.9. The issue in this report still needs to be addressed.
Comment 7 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-10-24 15:55:09 UTC
The problem is changed.

Though mysql_version.h is included in mariadb102-client now, MYSQL_SERVER_VERSION is not defined in mysql_version.h of mariadb102-client-10.2.9_1.

% pkg info -x mariadb
mariadb102-client-10.2.9_1
% grep MYSQL_SERVER_VERSION `pkg info -lqx mariadb`
%
Comment 8 Bernard Spil freebsd_committer freebsd_triage 2017-10-24 17:25:30 UTC
(In reply to Po-Chuan Hsieh from comment #7)
Why would a -client port define MYSQL_SERVER_VERSION?
Comment 9 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-10-24 17:38:07 UTC
The build failure is due to the missing/undefined MYSQL_SERVER_VERSION.

% grep MYSQL_SERVER_VERSION `pkg info -lq mysql57-client`
/usr/local/include/mysql/mysql_version.h:#define MYSQL_SERVER_VERSION       "5.7.20"
Comment 10 Bernard Spil freebsd_committer freebsd_triage 2017-10-25 11:12:43 UTC
Created attachment 187459 [details]
svn diff for databases/mydumper

(In reply to Po-Chuan Hsieh from comment #9)
Yes, that I see.

When going through the code, I noticed that all it is used for is to show version output from the binary. This warrants a problem report upstream, it is not linking server but to the client(-libraries)

Reported upstream https://github.com/maxbube/mydumper/pull/71
Comment 11 Bernard Spil freebsd_committer freebsd_triage 2018-05-11 09:22:35 UTC
Upstream merged the patch I supplied.

Looks like that's part of the 0.9.5 version which was recently updated in ports too. This PR probably can be closed?
Comment 12 Po-Chuan Hsieh freebsd_committer freebsd_triage 2018-06-20 15:04:30 UTC
Thanks for fixing it. :)