Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 692644 - dev-db/mysql-connector-c-8.0.17-r1: '#include <mysql/mysql.h>' fails without -I/usr/include/mysql
Summary: dev-db/mysql-connector-c-8.0.17-r1: '#include <mysql/mysql.h>' fails without ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
: 692574 692636 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-08-20 19:07 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2019-08-23 01:00 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2019-08-20 19:07:48 UTC
With dev-db/mysql-connector-c-6.1.11-r1:

$ gcc -c -x c - -o /tmp/test.o <<< '#include <mysql/mysql.h>'
$ gcc -c -I/usr/include/mysql -x c - -o /tmp/test.o <<< '#include <mysql/mysql.h>'
$ 


With dev-db/mysql-connector-c-8.0.17-r1:
$ gcc -c -x c - -o /tmp/test.o <<< '#include <mysql/mysql.h>'
In file included from /usr/include/mysql/mysql.h:81,
                 from <stdin>:1:
/usr/include/mysql/mysql_com.h:1005:10: fatal error: mysql/udf_registration_types.h: No such file or directory
 1005 | #include <mysql/udf_registration_types.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
$ gcc -c -I/usr/include/mysql -x c - -o /tmp/test.o <<< '#include <mysql/mysql.h>'
$ 


Reference to udf_registration_types.h is the only <>-style reference to an mysql-connector-c's own header amongst its headers:
$ grep -E '#[[:space:]]*include' $(find /usr/include/mysql -type f | sort)
/usr/include/mysql/mysql.h:#include <stdbool.h>
/usr/include/mysql/mysql.h:#include <stddef.h>
/usr/include/mysql/mysql.h:#include <sys/types.h>
/usr/include/mysql/mysql.h:#include <windows.h>
/usr/include/mysql/mysql.h:#include <winsock2.h>
/usr/include/mysql/mysql.h:#include "field_types.h"
/usr/include/mysql/mysql.h:#include "my_list.h"
/usr/include/mysql/mysql.h:#include "mysql_com.h"
/usr/include/mysql/mysql.h:#include "mysql/client_plugin.h"  // IWYU pragma: keep
/usr/include/mysql/mysql.h:#include "mysql_version.h"  // IWYU pragma: keep
/usr/include/mysql/mysql.h:#include "mysql_time.h"  // IWYU pragma: keep
/usr/include/mysql/mysql.h:#include "errmsg.h"  // IWYU pragma: keep
/usr/include/mysql/mysql/client_plugin.h:#include <stdarg.h>
/usr/include/mysql/mysql/client_plugin.h:#include <stdlib.h>
/usr/include/mysql/mysql/client_plugin.h:#include "plugin_auth_common.h"
/usr/include/mysql/mysql/plugin_auth_common.h:#include <windows.h>
/usr/include/mysql/mysql/udf_registration_types.h:#include <stdbool.h>
/usr/include/mysql/mysql_com.h:#include <stdbool.h>
/usr/include/mysql/mysql_com.h:#include "my_command.h"
/usr/include/mysql/mysql_com.h:#include "my_io.h"
/usr/include/mysql/mysql_com.h:#include <stdbool.h>
/usr/include/mysql/mysql_com.h:#include <mysql/udf_registration_types.h>
$ 


If this reference is changed to ""-style, then '#include <mysql/mysql.h>' would work even without -I/usr/include/mysql:
[[[
--- /usr/include/mysql/mysql_com.h
+++ /usr/include/mysql/mysql_com.h
@@ -1004,3 +1004,3 @@
 /* Include the types here so existing UDFs can keep compiling */
-#include <mysql/udf_registration_types.h>
+#include "mysql/udf_registration_types.h"
 
]]]

$ gcc -c -x c - -o /tmp/test.o <<< '#include <mysql/mysql.h>'
$ gcc -c -I/usr/include/mysql -x c - -o /tmp/test.o <<< '#include <mysql/mysql.h>'
$
Comment 1 Larry the Git Cow gentoo-dev 2019-08-23 00:24:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5dfeaff018ab1d02b0c8cb80ed0ec1eda7af1f29

commit 5dfeaff018ab1d02b0c8cb80ed0ec1eda7af1f29
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-08-23 00:16:24 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-08-23 00:24:13 +0000

    dev-db/mysql-connector-c: Use relative include path for udf_registration_types.h
    
    Closes: https://bugs.gentoo.org/692644
    Package-Manager: Portage-2.3.72, Repoman-2.3.17
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 ...include-path-for-udf_registration_types-h.patch | 24 ++++++++++++++++++++++
 ...2.ebuild => mysql-connector-c-8.0.17-r3.ebuild} |  1 +
 2 files changed, 25 insertions(+)
Comment 2 Arfrever Frehtes Taifersar Arahesis 2019-08-23 00:59:59 UTC
*** Bug 692574 has been marked as a duplicate of this bug. ***
Comment 3 Arfrever Frehtes Taifersar Arahesis 2019-08-23 01:00:06 UTC
*** Bug 692636 has been marked as a duplicate of this bug. ***