Bug 221533 - mail/exim fails to build with mariadb 10.2
Summary: mail/exim fails to build with mariadb 10.2
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Vsevolod Stakhov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-14 22:41 UTC by Vladimir Druzenko
Modified: 2017-08-15 23:03 UTC (History)
0 users

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


Attachments
patch-src-mysql-version (307 bytes, patch)
2017-08-14 22:41 UTC, Vladimir Druzenko
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Druzenko freebsd_committer freebsd_triage 2017-08-14 22:41:15 UTC
Created attachment 185421 [details]
patch-src-mysql-version

The part of build log with error message:
============================================
mysql.c:437:9: error: use of undeclared identifier 'MYSQL_SERVER_VERSION'
        MYSQL_SERVER_VERSION, MYSQL_COMPILATION_COMMENT,
        ^
mysql.c:437:31: error: use of undeclared identifier 'MYSQL_COMPILATION_COMMENT'
        MYSQL_SERVER_VERSION, MYSQL_COMPILATION_COMMENT,
                              ^
1 warning and 2 errors generated.
*** Error code 1
============================================
Patch was tested with mariadb 10.1 too.
Comment 1 Vsevolod Stakhov freebsd_committer freebsd_triage 2017-08-15 08:14:24 UTC
It still doesn't link for me even with this patch as Exim tries to link with libmysqlclient.
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2017-08-15 10:41:33 UTC
(In reply to Vsevolod Stakhov from comment #1)
What?

$ pkg which /usr/local/include/mysql/mysql_version.h
/usr/local/include/mysql/mysql_version.h was installed by package mariadb102-client-10.2.7

$ pkg which /usr/local/include/mysql/mysql_version.h 
/usr/local/include/mysql/mysql_version.h was installed by package mariadb101-client-10.1.25

My patch added #include <mysql_version.h>, which is part of the mariadb client in both - 10.1 and 10.2.
Comment 3 Vsevolod Stakhov freebsd_committer freebsd_triage 2017-08-15 10:45:33 UTC
It doesn't fix the build with mariadb. I have installed mariadb102-client, applied your patch and tried to build Exim with mysql support. After all, I had the following error:

cc -o exim
/usr/bin/ld: cannot find -lmysqlclient


Am I missing something?
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2017-08-15 11:04:25 UTC
(In reply to Vsevolod Stakhov from comment #3)
You are describe a different bug.

No link error on my hosts: 10.3 and 11.1 amd64.
Check your mariadb installation.

And yes, you are MAINTAINER=     vsevolod@FreeBSD.org, you have to know better… :-D
I just found an error (other than you have), fixed it and ask to commit patch.
BTW, I found 100% same patch in the redhat bagzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1467312
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-08-15 20:43:40 UTC
A commit references this bug:

Author: vsevolod
Date: Tue Aug 15 20:42:40 UTC 2017
New revision: 448008
URL: https://svnweb.freebsd.org/changeset/ports/448008

Log:
  - Fix finding of mariadb headers [1]
  - Fix build with custom mysql library

  PR:		221533 [1]
  Submitted by:	vvd at unislabs.com [1]

Changes:
  head/mail/exim/Makefile
  head/mail/exim/files/patch-src-lookups-mysql.c
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2017-08-15 23:03:02 UTC
Thanks!