Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 688572 - mail-mta/exim-4.92-r1 uses /usr/include/exim headers during build
Summary: mail-mta/exim-4.92-r1 uses /usr/include/exim headers during build
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-23 22:52 UTC by Andreas Steinmetz
Modified: 2019-06-28 13:50 UTC (History)
1 user (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 Andreas Steinmetz 2019-06-23 22:52:30 UTC
The exim ebuild causes /usr/include/exim to be included prior to the ebuild header files, leading to unexpected results, as e.g. config.h is used from there. In my case this config.h didn't have HAVE_LOCAL_SCAN set, leading to spam filter failure...
Comment 1 Fabian Groffen gentoo-dev 2019-06-25 11:01:48 UTC
interesting, will have a look, do you have a buildlog by chance?
Comment 2 Andreas Steinmetz 2019-06-25 12:01:25 UTC
Unfortunately not, as the spam filter was affected I had to act rapidly :-(
I still have the results of a manual "gcc -E" which I required to trace down the problem and this shows (excerpt):

# 1 "local_scan.h" 1
# 20 "local_scan.h"
# 1 "/usr/include/exim/config.h" 1 3 4
# 21 "local_scan.h" 2
# 1 "/usr/include/exim/mytypes.h" 1 3 4
# 53 "/usr/include/exim/mytypes.h" 3 4
typedef unsigned char uschar;
typedef unsigned BOOL;
# 22 "local_scan.h" 2
# 1 "/usr/include/exim/store.h" 1 3 4
# 15 "/usr/include/exim/store.h" 3 4
enum { POOL_MAIN, POOL_PERM, POOL_SEARCH };
Comment 3 Fabian Groffen gentoo-dev 2019-06-25 12:03:42 UTC
what USE-flags do you have enabled for Exim?

can you post the output of `qlist exim | grep /usr/include`?
Comment 4 Andreas Steinmetz 2019-06-25 12:12:12 UTC
# equery uses exim
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for mail-mta/exim-4.92-r1:
 U I
 - - X            : Add support for X11
 - - arc          : Adds support for Authenticated Receive Chain (ARC)
 - - dane         : Adds support for DNS-based Authentication of Named Entities
 - - dcc          : Adds support for Distributed Checksum Clearinghouse (DCC)
 + + dkim         : Adds support for DomainKeys Identified Mail (DKIM)
 + + dlfunc       : Install local_scan.h header to compile separate dlfunc
                    libraries
 - - dmarc        : Adds support for DMARC
 + + dnsdb        : Adds support for a DNS search for a record whose domain
                    name is the supplied query
 - - doc          : Add extra documentation (API, Javadoc, etc). It is
                    recommended to enable per package instead of globally
 - - dovecot-sasl : Adds support for Dovecot's authentication
 - - dsn          : Adds support for Delivery Status Notifications (DSN)
 + + exiscan-acl  : Patch providing support for content scanning
 - - gnutls       : Prefer net-libs/gnutls as SSL/TLS provider (ineffective
                    with USE=-ssl)
 + + idn          : Enable support for Internationalized Domain Names
 + + ipv6         : Add support for IP version 6
 + + ldap         : Add LDAP support (Lightweight Directory Access Protocol)
 - - libressl     : Use dev-libs/libressl instead of dev-libs/openssl when
                    applicable (see also the ssl useflag)
 + + lmtp         : Adds support for lmtp
 - - maildir      : Add support for maildir (~/.maildir) style mail spools
 - - mbx          : Adds support for UW's mbx format
 + + mysql        : Add mySQL Database support
 - - nis          : Support for NIS/YP services
 + + pam          : Add support for PAM (Pluggable Authentication Modules) -
                    DANGEROUS to arbitrarily flip
 - - perl         : Add optional support/bindings for the Perl language
 - - pkcs11       : Require pkcs11 support in net-libs/gnutls with USE=gnutls
 - - postgres     : Add support for the postgresql database
 + + prdr         : Adds support for Per-Recipient Data Response
 - - proxy        : Add support for being behind a proxy, such as HAProxy
 - - radius       : Add support for RADIUS authentication
 - - redis        : Adds support for querying dev-db/redis
 + + sasl         : Add support for the Simple Authentication and Security
                    Layer
 + + spf          : Adds support for Sender Policy Framework
 - - sqlite       : Add support for sqlite - embedded sql database
 - - srs          : Adds support for Sender Rewriting Scheme
 + + ssl          : Add support for SSL/TLS connections (Secure Socket Layer /
                    Transport Layer Security)
 + + syslog       : Enable support for syslog
 + + tcpd         : Add support for TCP wrappers
 + + tpda         : Adds support for Transport Post-Delivery Actions

# qlist exim | grep /usr/include
/usr/include/exim/local_scan.h
/usr/include/exim/config.h
/usr/include/exim/store.h
/usr/include/exim/mytypes.h
Comment 5 Alexander Tsoy 2019-06-25 23:19:40 UTC
It seems that ebuild should just append HAVE_LOCAL_SCAN=yes to Makefile if dlfunc USE-flag is enabled. This is due to the following change in 4.92:
https://github.com/Exim/exim/commit/9723f9667322bf96db786fa49d53139a48fabc5e

I don't see how it can include /usr/include/exim/config.h.
Comment 6 Alexander Tsoy 2019-06-25 23:35:18 UTC
(In reply to Andreas Steinmetz from comment #2)
> Unfortunately not, as the spam filter was affected I had to act rapidly :-(
> I still have the results of a manual "gcc -E" which I required to trace down
> the problem and this shows (excerpt):
> 
> # 1 "local_scan.h" 1
> # 20 "local_scan.h"
> # 1 "/usr/include/exim/config.h" 1 3 4
> # 21 "local_scan.h" 2
> # 1 "/usr/include/exim/mytypes.h" 1 3 4
> # 53 "/usr/include/exim/mytypes.h" 3 4
> typedef unsigned char uschar;
> typedef unsigned BOOL;
> # 22 "local_scan.h" 2
> # 1 "/usr/include/exim/store.h" 1 3 4
> # 15 "/usr/include/exim/store.h" 3 4
> enum { POOL_MAIN, POOL_PERM, POOL_SEARCH };
I guess you have run gcc after src_install phase where ebuild modifies local_scan.h to include <exim/config.h>.
Comment 7 Andreas Steinmetz 2019-06-26 17:34:29 UTC
Narrowed it down further.

I did a complete exim rebuild with identical configuration.
The problem is in config.h:

#define DLOPEN_LOCAL_SCAN     yes
/* HAVE_LOCAL_SCAN not set */

So HAVE_LOCAL_SCAN is not set during the ebuild which causes the code calling local_scan() in receive.c not being built.

In other words, due to the missing definition of HAVE_LOCAL_SCAN the whole exim-4.92-localscan_dlopen.patch will never work.
Comment 8 Fabian Groffen gentoo-dev 2019-06-26 19:12:03 UTC
Thanks, does this work for you?

--- a/mail-mta/exim/files/exim-4.74-localscan_dlopen.patch
+++ b/mail-mta/exim/files/exim-4.74-localscan_dlopen.patch
@@ -29,11 +29,12 @@ diff -Naur exim-4.32/src/EDITME exim-4.32-dlopen/src/EDITME
 diff -Naur exim-4.32/src/config.h.defaults exim-4.32-dlopen/src/config.h.defaults
 --- src/config.h.defaults      2004-04-15 08:27:01.000000000 +0000
 +++ src/config.h.defaults      2004-05-06 16:16:30.000000000 +0000
-@@ -20,6 +20,8 @@
+@@ -20,6 +20,9 @@
  #define AUTH_PLAINTEXT
  #define AUTH_SPA
  
 +#define DLOPEN_LOCAL_SCAN
++#define HAVE_LOCAL_SCAN
 +
  #define BIN_DIRECTORY
Comment 9 Andreas Steinmetz 2019-06-26 19:34:01 UTC
Unfortunately not. The modified patch gets applied but then in ./build-exim-gentoo/config.h:

#define DLOPEN_LOCAL_SCAN     yes
/* HAVE_LOCAL_SCAN not set */

I checked src/config.h.defaults:

#define DLOPEN_LOCAL_SCAN
#define HAVE_LOCAL_SCAN

Something creating config.h from config.h.defaults seems to disable HAVE_LOCAL_SCAN.
Comment 10 Andreas Steinmetz 2019-06-26 19:45:28 UTC
It seems, the culprit is Local/Makefile which has DLOPEN_LOCAL_SCAN=yes but not HAVE_LOCAL_SCAN.
Comment 11 Fabian Groffen gentoo-dev 2019-06-28 08:43:35 UTC
@@ -365,6 +365,8 @@ src_configure() {
        if use dlfunc; then
                cat >> Makefile <<- EOC
                        EXPAND_DLFUNC=yes
+                       HAVE_LOCAL_SCAN=yes
+                       DLOPEN_LOCAL_SCAN=yes
                EOC
        fi
 

That bit should do it then for you.

I'll commit this as -r2.
Comment 12 Larry the Git Cow gentoo-dev 2019-06-28 13:50:55 UTC
The bug has been closed via the following commit(s):

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

commit 47afd5252208d69ef4df50a86442bdd73287530e
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2019-06-28 13:50:23 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2019-06-28 13:50:40 +0000

    mail-mta/exim: fix USE=dlfunc
    
    Closes: https://bugs.gentoo.org/688572
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>
    Package-Manager: Portage-2.3.66, Repoman-2.3.11

 .../{exim-4.92-r1.ebuild => exim-4.92-r2.ebuild}   | 59 ++++++++++++++--------
 mail-mta/exim/exim-4.92.ebuild                     |  2 +
 .../exim/files/exim-4.92-localscan_dlopen.patch    |  2 +-
 3 files changed, 40 insertions(+), 23 deletions(-)