Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 628952 - net-analyzer/net-snmp-5.7.3-r6 with dev-db/mariadb-10.2.8 - snmptrapd_sql.c:53:10: fatal error: my_global.h: No such file or directory
Summary: net-analyzer/net-snmp-5.7.3-r6 with dev-db/mariadb-10.2.8 - snmptrapd_sql.c:5...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 630404
  Show dependency tree
 
Reported: 2017-08-26 07:25 UTC by Vladimir B. Vinogradov
Modified: 2017-09-08 17:35 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,466.76 KB, text/plain)
2017-08-26 07:25 UTC, Vladimir B. Vinogradov
Details
mysql-headers.patch (mysql-headers.patch,524 bytes, patch)
2017-08-27 01:02 UTC, Brian Evans (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir B. Vinogradov 2017-08-26 07:25:46 UTC
Created attachment 490622 [details]
build.log

In dev-db/mariadb-10.2.8 most *.h files moved from:

/usr/include/mysql directory to /usr/include/mysql/server directory;
/usr/include/mysql/mysql directory to /usr/include/server/mysql directory;
/usr/include/mysql/mysql/psi directory to /usr/include/server/mysql/psi directory.

In this case net-snmp with installed mariadb-10.2.8 failed to build.

also I applied patch from https://bugs.gentoo.org/show_bug.cgi?id=627588
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2017-08-26 12:02:01 UTC
Why does this happen? mysql_config does not appear to reflect this change. Is that an oversight or should I patch net-snmp to look for both my_global.h and server/my_global.h in the include paths?
Comment 2 Vladimir B. Vinogradov 2017-08-26 13:20:19 UTC
(In reply to Jeroen Roovers from comment #1)
> Why does this happen? mysql_config does not appear to reflect this change.
> Is that an oversight or should I patch net-snmp to look for both my_global.h
> and server/my_global.h in the include paths?

This is only the first file from 'not found community'. I created this symlinks for a successful build of net-snmp:

in /usr/include/mysql:
byte_order_generic_x86_64.h -> server/byte_order_generic_x86_64.h
little_endian.h -> server/little_endian.h
m_ctype.h -> server/m_ctype.h
m_string.h -> server/m_string.h
my_alloc.h -> server/my_alloc.h
my_attribute.h -> server/my_attribute.h
my_byteorder.h -> server/my_byteorder.h
my_compiler.h -> server/my_compiler.h
my_config.h -> server/my_config.h
my_dbug.h -> server/my_dbug.h
my_decimal_limits.h -> server/my_decimal_limits.h
my_global.h -> server/my_global.h
my_pthread.h -> server/my_pthread.h
mysql_time.h -> server/mysql_time.h
mysql_version.h -> server/mysql_version.h
my_sys.h -> server/my_sys.h
my_valgrind.h -> server/my_valgrind.h
typelib.h -> server/typelib.h

in /usr/include/mysql/mysql
plugin_ftparser.h -> ../server/mysql/plugin_ftparser.h
plugin.h -> ../server/mysql/plugin.h
service_base64.h -> ../server/mysql/service_base64.h
service_debug_sync.h -> ../server/mysql/service_debug_sync.h
service_encryption.h -> ../server/mysql/service_encryption.h
service_encryption_scheme.h -> ../server/mysql/service_encryption_scheme.h
service_kill_statement.h -> ../server/mysql/service_kill_statement.h
service_logger.h -> ../server/mysql/service_logger.h
service_md5.h -> ../server/mysql/service_md5.h
service_my_crypt.h -> ../server/mysql/service_my_crypt.h
service_my_print_error.h -> ../server/mysql/service_my_print_error.h
service_my_snprintf.h -> ../server/mysql/service_my_snprintf.h
service_progress_report.h -> ../server/mysql/service_progress_report.h
services.h -> ../server/mysql/services.h
service_sha1.h -> ../server/mysql/service_sha1.h
service_sha2.h -> ../server/mysql/service_sha2.h
service_thd_alloc.h -> ../server/mysql/service_thd_alloc.h
service_thd_autoinc.h -> ../server/mysql/service_thd_autoinc.h
service_thd_error_context.h -> ../server/mysql/service_thd_error_context.h
service_thd_rnd.h -> ../server/mysql/service_thd_rnd.h
service_thd_specifics.h -> ../server/mysql/service_thd_specifics.h
service_thd_timezone.h -> ../server/mysql/service_thd_timezone.h
service_thd_wait.h -> ../server/mysql/service_thd_wait.h

in /usr/include/mysql/mysql/psi
mysql_thread.h -> ../../server/mysql/psi/mysql_thread.h
psi.h -> ../../server/mysql/psi/psi.h

As far as I understood, this is Gentoo specific location of mysql headers for mariadb-10.2.8.
Upstream mariadb release from 10.2.7 to 10.2.8 does not has any changes in /usr/lib/mysql location.
Comment 3 Brian Evans (RETIRED) gentoo-dev 2017-08-26 13:24:49 UTC
(In reply to Jeroen Roovers from comment #1)
> Why does this happen? mysql_config does not appear to reflect this change.
> Is that an oversight or should I patch net-snmp to look for both my_global.h
> and server/my_global.h in the include paths?

AFAIK, this is to indicate something that is beyond the client API and should not be used.  I will ask in #maria in Freenode when I get the chance. (Others are welcome to do the same)

(In reply to Vladimir B. Vinogradov from comment #2)
> As far as I understood, this is Gentoo specific location of mysql headers
> for mariadb-10.2.8.
> Upstream mariadb release from 10.2.7 to 10.2.8 does not has any changes in
> /usr/lib/mysql location.

This is incorrect, MariaDB upstream made this include directory change in 10.2.8, not Gentoo.
Comment 4 Brian Evans (RETIRED) gentoo-dev 2017-08-26 19:17:43 UTC
apps/snmptrapd_sql.c has too many includes for MariaDB 10.2

#include <my_global.h>
#include <my_sys.h>
#include <mysql.h>
#include <errmsg.h>

should be reduced to

#include <mysql.h>
#include <errmsg.h>

but I'll have to verify this with previous MySQL/MariaDB versions.
Comment 5 Brian Evans (RETIRED) gentoo-dev 2017-08-27 01:02:15 UTC
Created attachment 490772 [details, diff]
mysql-headers.patch

Thanks to an existing autotools macro to define HAVE_BROKEN_LIBMYSQLCLIENT, this attached patch should work for all versions.

The only apparent reasoning for my_global.h and my_sys.h is the MY_INIT macro from my_sys.h which simply sets a program name for error messages and calls my_init().  When the HAVE_BROKEN_LIBMYSQLCLIENT is set, it just calls my_init() which is in mysql.h.

I don't know the full value of setting my_progname in a 3rd party lib/program is yet.  But it should be no worse for wear to exclude unnecessary includes when macros will not be called in any case.

Tested on MySQL 5.6 and MariaDB 10.2.  Other versions should behave as they did before.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2017-08-27 11:03:48 UTC
(In reply to Brian Evans from comment #5)
> Created attachment 490772 [details, diff] [details, diff]
> mysql-headers.patch

Thanks.

Fixed without revision bump.