Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 631464 - net-misc/asterisk-13.17.0|2 fails to compile with USE=mysql and latest mariadb
Summary: net-misc/asterisk-13.17.0|2 fails to compile with USE=mysql and latest mariadb
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jaco Kroon
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 630404
  Show dependency tree
 
Reported: 2017-09-20 04:52 UTC by Attila Tóth
Modified: 2019-11-30 07:49 UTC (History)
4 users (show)

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


Attachments
asterisk_mariadb_mysql_version_server_header_location.diff (asterisk_mariadb_mysql_version_server_header_location.diff,460 bytes, patch)
2017-09-20 04:52 UTC, Attila Tóth
Details | Diff
asterisk_mariadb_mysql_version_header_removal.diff (asterisk_mariadb_mysql_version_header_removal.diff,419 bytes, patch)
2017-09-20 20:51 UTC, Attila Tóth
Details | Diff
asterisk-mysql-13.17.2.patch (asterisk-mysql-13.17.2.patch,1.12 KB, patch)
2017-09-21 15:10 UTC, Brian Evans (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Attila Tóth 2017-09-20 04:52:45 UTC
Created attachment 495488 [details, diff]
asterisk_mariadb_mysql_version_server_header_location.diff

Error message:
   [CC] hash/hash_buf.c -> hash/hash_buf.o
res_config_mysql.c:38:33: fatal error: mysql/mysql_version.h: No such file or directory
 #include <mysql/mysql_version.h>
                                 ^
compilation terminated.

Reason: the location of the header file has changed. It was moved to <mysql/server/mysql_version.h>
Correcting the include line solves the problem. See patch attached.

I have to check out whether this one has addressed in asterisk-13.17.2, but only after a sync.
Comment 1 Attila Tóth 2017-09-20 08:04:20 UTC
net-misc/asterisk-13.17.2 is also affected.
Comment 2 Brian Evans (RETIRED) gentoo-dev 2017-09-20 12:34:59 UTC
(In reply to Attila Tóth from comment #0)
> Created attachment 495488 [details, diff] [details, diff]
> asterisk_mariadb_mysql_version_server_header_location.diff
> 
> Error message:
>    [CC] hash/hash_buf.c -> hash/hash_buf.o
> res_config_mysql.c:38:33: fatal error: mysql/mysql_version.h: No such file
> or directory
>  #include <mysql/mysql_version.h>
>                                  ^
> compilation terminated.
> 
> Reason: the location of the header file has changed. It was moved to
> <mysql/server/mysql_version.h>
> Correcting the include line solves the problem. See patch attached.
> 
> I have to check out whether this one has addressed in asterisk-13.17.2, but
> only after a sync.

Please don't use this patch.

This will become a warning with the upcoming MariaDB 10.2.9 to give upstreams a chance to REMOVE "#include <mysql_version.h>".  The version information is included in the "#include <mysql.h>" header call and all other headers are extraneous for client calls.
Comment 3 Brian Evans (RETIRED) gentoo-dev 2017-09-20 12:50:34 UTC
Correction "#include <mysql/errmsg.h>" is valuable to have as well if it is needed.
Comment 4 Attila Tóth 2017-09-20 12:55:35 UTC
(In reply to Brian Evans from comment #3)
> Correction "#include <mysql/errmsg.h>" is valuable to have as well if it is
> needed.

<mysql/errmsg.h> has been included right after the culprit line. Something must be done, since leaving it the way it is results in a failed compilation because of a missing header. So you are saying omitting this inclusion is simply enough? I will correct the patch according to your suggestion!
Comment 5 Stefan Briesenick 2017-09-20 15:12:15 UTC
asterisk-11 is also affected. Please fix both versions. Thanks!
Comment 6 Tony Vroon (RETIRED) gentoo-dev 2017-09-20 15:47:31 UTC
(In reply to Brian Evans from comment #2)
> Please don't use this patch.

Understood. I will await your go/no-go on the next patch before committing.
Comment 7 Tony Vroon (RETIRED) gentoo-dev 2017-09-20 15:48:17 UTC
Comment on attachment 495488 [details, diff]
asterisk_mariadb_mysql_version_server_header_location.diff

Marking vetoed patch as obsolete.
Comment 8 Attila Tóth 2017-09-20 20:51:37 UTC
Created attachment 495696 [details, diff]
asterisk_mariadb_mysql_version_header_removal.diff

According to a prior suggestion the revised patch simply removes the header no longer necessary. I'm not sure whether this will work for all version in the tree. It surely does for keyworded asterisk and mariadb.
Comment 9 Tony Vroon (RETIRED) gentoo-dev 2017-09-21 08:11:28 UTC
(In reply to Attila Tóth from comment #8)
> According to a prior suggestion the revised patch simply removes the header
> no longer necessary.

Patch review please Brian? Do you want a revbump with this?
Comment 10 Brian Evans (RETIRED) gentoo-dev 2017-09-21 12:48:04 UTC
(In reply to Tony Vroon from comment #9)
> (In reply to Attila Tóth from comment #8)
> > According to a prior suggestion the revised patch simply removes the header
> > no longer necessary.
> 
> Patch review please Brian? Do you want a revbump with this?

You can include the patch even without a revbump as I cannot find a reference to any defines in the old mysql_version.h within the source in question.

It should be removed upstream as well if possible.

This is strictly a build error with an old reference.
Comment 11 Brian Evans (RETIRED) gentoo-dev 2017-09-21 15:10:35 UTC
Created attachment 495796 [details, diff]
asterisk-mysql-13.17.2.patch

I feel this is a better patch as mysql_config is called and the includes are part of the CFLAGS imported
Comment 12 Tony Vroon (RETIRED) gentoo-dev 2017-09-22 13:52:12 UTC
(In reply to Brian Evans from comment #11)
> I feel this is a better patch as mysql_config is called and the includes are
> part of the CFLAGS imported

Attila, could you confirm that this patch still solves the issue you reported? If it does, I will commit without revbump.
Comment 13 Attila Tóth 2017-09-22 13:54:32 UTC
(In reply to Tony Vroon from comment #12)
> (In reply to Brian Evans from comment #11)
> > I feel this is a better patch as mysql_config is called and the includes are
> > part of the CFLAGS imported
> 
> Attila, could you confirm that this patch still solves the issue you
> reported? If it does, I will commit without revbump.

Brian's patch works well in my case. Note, that asterisk-11 also reported to be affected - don't forget about that! Thx, BR: Attila
Comment 14 Jaco Kroon 2018-09-22 09:35:00 UTC
Based on recent experience, and seeing this, I'm contemplating that we should completely ditch USE=mysql support and force -mysql, not sure what the impact would be for dialplan functions currently.  ODBC works better, there are a few caveats with MySQL (and/or MariaDB in the tree currently).

1.  MariaDB and MySQL are diverging, and client headers/libraries are a problem.
2.  mysql-connector-c combined with myodbc is causing severe headaches for asterisk (warnings about threads not ending etc ...)
3.  mariadb-connector-odbc (submitted to proxied maintainers) can't compile against mysql-connector-c and requires mariadb-connector-c.
4.  Loading both mariadb-connector-c and mysql-connector-c libraries into memory causes explosions.

Towards this end, and seeing that ODBC (with mariadb-connector-odbc at least) supports all (as far as I know, except perhaps for the dialplan MYSQL functions) functionality I'm thinking that we should just drop USE=mysql support and depend on ODBC.

I've already ditched use of cdr_mysql, and I've long since moved from MYSQL dialplan functions to func_odbc which are definitely more reliable.

The three things that I can see that USE=mysql enables:

1.  app_mysql  => MYSQL() application, which frankly is crap, deprecated in favour of func_odbc since at least 2011.

2.  cdr_mysql => Also deprecated in favour of cdr_adaptive_odbc.  Also since at least 2011.  I've only just switched last night though.

3.  res_config_mysql => This is in extended support (meaning it's community maintained and you can't expect/request support from Digium, they'll be ignoring you and hoping someone else can help you).  I'd recommend rather using res_config_odbc if possible.

Tony, my vote goes towards removing the USE=mysql use flag, and force-disabling those three modules.  I'd rather assist people to update their configs and get them migrated than put others through the kind of hell I've been through the last week.
Comment 15 Tomáš Mózes 2018-12-23 04:00:59 UTC
Any news here please?
Comment 16 Jaco Kroon 2019-11-14 10:49:52 UTC
Tomas,

I've ditched use of USE=mysql on asterisk - do you still need this or can I completely disable USE=mysql for asterisk on Gentoo?

(busy prepping a 13.29.1 build).

Kind Regards,
Jaco
Comment 17 Tomáš Mózes 2019-11-14 11:46:53 UTC
(In reply to Jaco Kroon from comment #16)
> Tomas,
> 
> I've ditched use of USE=mysql on asterisk - do you still need this or can I
> completely disable USE=mysql for asterisk on Gentoo?
> 
> (busy prepping a 13.29.1 build).
> 
> Kind Regards,
> Jaco

I don't use Asterisk at all, just wanted to know what's happening for MariaDB 10.2 stabilization.
Comment 18 Jaco Kroon 2019-11-14 12:57:57 UTC
(In reply to Tomáš Mózes from comment #17)
> (In reply to Jaco Kroon from comment #16)
> > Tomas,
> > 
> > I've ditched use of USE=mysql on asterisk - do you still need this or can I
> > completely disable USE=mysql for asterisk on Gentoo?
> > 
> > (busy prepping a 13.29.1 build).
> > 
> > Kind Regards,
> > Jaco
> 
> I don't use Asterisk at all, just wanted to know what's happening for
> MariaDB 10.2 stabilization.

As of right now:  nothing.  Dependency has been moved onto dev-db/mysql-connector-c as per https://bugs.gentoo.org/show_bug.cgi?id=666004

I've tagged the commit to close this bug.
Comment 19 Larry the Git Cow gentoo-dev 2019-11-30 07:49:48 UTC
The bug has been closed via the following commit(s):

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

commit b44a1be8b8e28517ce843e630e30ccc1ddf3fae4
Author:     Jaco Kroon <jaco@uls.co.za>
AuthorDate: 2019-11-10 18:29:19 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2019-11-30 07:48:56 +0000

    net-misc/asterisk: version bump to 13.29.1 + maintainership
    
    Converted to GLEP 81 for user+group.
    Consolidated a few DEPEND issues.
    Dropped pkg_config phase function.
    Took maintainership.
    Fixed a bunch of other issues from pkgcheck (${D} and ${ROOT} not having
        a / following it directly).
    Bumped to EAPI=7
    Use $ED over $D where applicable.
    Fix statsd integration.
    Update depend on virtual/mysql to db/mysql-connector-c
    Enable NOISY_BUILD as requested (instructed) by slyfox.
    Fix /usr/share/doc/${PV} being asterisk: owned.
    Make SSL optional.
    
    This commit enables progress on the GLSA bug: https://bugs.gentoo.org/689796
    
    Might close: https://bugs.gentoo.org/594160 (SIGILL, may be GRSEC, or #667498)
    
    Package-Manager: Portage-2.3.76, Repoman-2.3.16
    Closes: https://bugs.gentoo.org/631464
    Closes: https://bugs.gentoo.org/654710
    Closes: https://bugs.gentoo.org/656472
    Closes: https://bugs.gentoo.org/666004
    Closes: https://bugs.gentoo.org/667498
    Closes: https://bugs.gentoo.org/670522
    Closes: https://bugs.gentoo.org/679804
    Closes: https://bugs.gentoo.org/686906
    Closes: https://bugs.gentoo.org/692696
    Signed-off-by: Jaco Kroon <jaco@uls.co.za>
    Closes: https://github.com/gentoo/gentoo/pull/13649
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 net-misc/asterisk/Manifest                |   2 +
 net-misc/asterisk/asterisk-13.29.1.ebuild | 327 ++++++++++++++++++++++++++++++
 net-misc/asterisk/metadata.xml            |  21 +-
 3 files changed, 342 insertions(+), 8 deletions(-)