Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 355463 - mail-mta/postfix-2.7.2 with use="postgres" doesn't compile with dev-db/postgresql-base-9.0.3
Summary: mail-mta/postfix-2.7.2 with use="postgres" doesn't compile with dev-db/postgr...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High major
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-18 18:09 UTC by Giampaolo Tomassoni
Modified: 2011-02-22 16:18 UTC (History)
2 users (show)

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


Attachments
Build log, as requested (build.log,189.86 KB, text/plain)
2011-02-18 18:46 UTC, Giampaolo Tomassoni
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Giampaolo Tomassoni 2011-02-18 18:09:13 UTC
Emerging of mail-mta/postfix-2.7.2 fails with use="postgres" when the available postgres client library is dev-db/postgresql-base-9.0.3.

This actually affects all "stable" systems, since these are the relevant package versions.

Reproducible: Always

Steps to Reproduce:
On a "stable" system, do:
1.emerge dev-db/postgresql-base
2.use="postgres" emerge mail-mta/postfix

Actual Results:  
x86_64-pc-linux-gnu-gcc -DHAS_PCRE -DHAS_PGSQL -I -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\"dovecot\" -DDEF_DAEMON_DIR=
\"/usr/lib64/postfix\" -DDEF_MANPAGE_DIR=\"/usr/share/man\" -DDEF_README_DIR=\"/usr/share/doc/postfix-2.7.2/readme\" -
DDEF_HTML_DIR=\"/usr/share/doc/postfix-2.7.2/html\" -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-march=core2 -O3 -fexpensive-optimizations -fomit-frame-pointer -g0 -pipe -I. -I../../include -DLINUX2 -o master maste
r.o master_conf.o master_ent.o master_sig.o master_avail.o master_spawn.o master_service.o master_status.o master_list
en.o master_vars.o master_wakeup.o master_watch.o master_flow.o ../../lib/libglobal.a ../../lib/libutil.a -Wl,-O1 -Wl,
--as-needed -lpcre -lcrypt -lpthread -lpam -lpq -L -ldb -lnsl -lresolv
../../lib/libutil.a(dict_db.o): In function `dict_db_open':
dict_db.c:(.text+0x3e): undefined reference to `db_version'
dict_db.c:(.text+0xe7): undefined reference to `db_create'
collect2: ld returned 1 exit status
make: *** [master] Error 1
make: *** [update] Error 1
emake failed
 * ERROR: mail-mta/postfix-2.7.2 failed:
 *   emake failed
 *
 * Call stack:
 *     ebuild.sh, line   56:  Called src_compile
 *   environment, line 3006:  Called _eapi2_src_compile
 *     ebuild.sh, line  654:  Called die
 * The specific snippet of code:
 *              emake || die "emake failed"
 *
 * If you need support, post the output of 'emerge --info =mail-mta/postfix-2.7.2',
 * the complete build log and the output of 'emerge -pqv =mail-mta/postfix-2.7.2'.
 * The complete build log is located at '/var/tmp/portage/mail-mta/postfix-2.7.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/mail-mta/postfix-2.7.2/temp/environment'.
 * S: '/var/tmp/portage/mail-mta/postfix-2.7.2/work/postfix-2.7.2'


Expected Results:  
Point 2) completes successfully.

To me this problem seems due to how the postgresql libraries and includes files are detected by the ebuild script.

This is from line 23 of postfix-2.7.2.ebuild:

    if use postgres ; then
        mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
        mylibs="${mylibs} -lpq -L$(pg_config --libdir)"
    fi

Unfortunately, dev-db/postgresql-base-9.0.3 doesn't ships a pg_config file anymore...
Comment 1 Aaron W. Swenson gentoo-dev 2011-02-18 18:23:36 UTC
(In reply to comment #0)
>  * If you need support, post the output of 'emerge --info
> =mail-mta/postfix-2.7.2',
>  * the complete build log and the output of 'emerge -pqv
> =mail-mta/postfix-2.7.2'.
>  * The complete build log is located at
> '/var/tmp/portage/mail-mta/postfix-2.7.2/temp/build.log'.

I really need the information from those files to determine the issue.
Comment 2 Giampaolo Tomassoni 2011-02-18 18:32:13 UTC
Aaron, I'm going to prepare the stuff you need.

Nevertheless, it seems to me the problem is really simple to spot: @ ~ line 23 in /usr/portage/mail-mta/postfix/postfix-2.7.2.ebuild you may read:

    if use postgres ; then
        mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
        mylibs="${mylibs} -lpq -L$(pg_config --libdir)"
    fi


but the script pg_config is not shipped anymore by dev-db/postgresql-base-9.0.3, so the vars are set to something like "... -DHAS_PGSQL -I" and "... -lpq -L". The latter causes the error, because -L shall be followed by a directory name, while it is followed by chance by a "-ldb". This causes libdb to not be resolved and then the specific issue. But libdb is only a casualty here...
Comment 3 Giampaolo Tomassoni 2011-02-18 18:46:01 UTC
Created attachment 262937 [details]
Build log, as requested

# emerge --info =mail-mta/postfix-2.7.2

Portage 2.1.9.25 (default/linux/amd64/10.0, gcc-4.4.4, glibc-2.11.2-r3, 2.6.36-gentoo-r5 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.36-gentoo-r5-x86_64-Intel-R-_Xeon-R-_CPU_X3220_@_2.40GHz-with-gentoo-1.12.14
Timestamp of tree: Fri, 18 Feb 2011 09:15:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.36.1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O3 -fexpensive-optimizations -fomit-frame-pointer -g0 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O3 -fexpensive-optimizations -fomit-frame-pointer -g0 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/ http://91.121.124.139/gentoo-distfiles/ http://mirrors.linuxant.fr/distfiles.gentoo.org/ http://gentoo.modulix.net/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl acpi aio amavis amd64 apache2 ares async audit bash-completion berkdb bzip2 cairo caps clamdtop cleartype cli cracklib crypt cups cxx dar64 dell dkim dri fam fftw gd gdbm geoip gif glibc-omitfp gmp gnutls gocr gold gpm iconv icu idn java java6 jbig jce jpeg jpeg2k logrotate lzma lzo mmx modules mudflap multilib mysql ncurses nls nptl nptlonly ocrad openmp pam pcre perl pg-intdatetime php png postgres pppd python rar razor rc5 readline reiserfs rle sensord session spamassassin spell sqlite sqlite3 sse sse2 sse3 ssl ssse3 svg sysfs syslog tcpd tesseract threads tiff truetype unicode urandom usb vim-syntax xattr xinetd xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_file authz_host authz_user autoindex dav dav_fs dav_lock deflate dir env expires ext_filter filter headers include log_config log_forensic logio mime mime_magic negotiation rewrite setenvif userdir vhost_alias" APACHE2_MPMS="worker" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

=================================================================
                        Package Settings
=================================================================

mail-mta/postfix-2.7.2 was built with the following:
USE="dovecot-sasl (multilib) pam postgres -cdb -hardened -ipv6 -ldap -mbox -mysql -nis -sasl (-selinux) -ssl -vda"



# emerge -pqv =mail-mta/postfix-2.7.2
[ebuild   R   ] mail-mta/postfix-2.7.2  USE="dovecot-sasl pam postgres -cdb -hardened -ipv6 -ldap -mbox -mysql -nis -sasl (-selinux) -ssl -vda"
Comment 4 Aaron W. Swenson gentoo-dev 2011-02-18 20:16:15 UTC
(In reply to comment #2)
> Aaron, I'm going to prepare the stuff you need.
> 
> Nevertheless, it seems to me the problem is really simple to spot: @ ~ line 23
> in /usr/portage/mail-mta/postfix/postfix-2.7.2.ebuild you may read:
> 
>     if use postgres ; then
>         mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
>         mylibs="${mylibs} -lpq -L$(pg_config --libdir)"
>     fi
> 
> 
> but the script pg_config is not shipped anymore by
> dev-db/postgresql-base-9.0.3, so the vars are set to something like "...
> -DHAS_PGSQL -I" and "... -lpq -L". The latter causes the error, because -L
> shall be followed by a directory name, while it is followed by chance by a
> "-ldb". This causes libdb to not be resolved and then the specific issue. But
> libdb is only a casualty here...
> 

pg_config should be included with dev-db/postgresql-base-9.0.3. Check in /usr/lib/postgresql-9.0/bin/ to see what's there. You may need to do:

# eselect postgresql set 9.0
Comment 5 Giampaolo Tomassoni 2011-02-18 21:07:29 UTC
> (In reply to comment #4)
> pg_config should be included with dev-db/postgresql-base-9.0.3. Check in
> /usr/lib/postgresql-9.0/bin/ to see what's there. You may need to do:
> # eselect postgresql set 9.0

Well, I already did it when I switched to the 9.0.x series:

    # eselect postgresql list
    Available postgresql installations
      9.0 <-* <-S                base-9.0.3 server-9.0.3


Nevertheless, I did a:

   eselect postgresql update

and now I see a pg_config in /usr/bin .

So, thank you for your hint to look for a eselect problem: it worked.

Sorry for bothering the gentoo team for that.
Comment 6 Aaron W. Swenson gentoo-dev 2011-02-18 21:22:08 UTC
I'm glad that's resolved, nevertheless, this is a bug in the Postfix ebuild.

The full path should be defined rather than just pg_config.
So, that bit should be written as:

if use postgres ; then
    PGPATH="/usr/$(get_libdir)/postgresql/bin"
    mycc="${mycc} -DHAS_PGSQL -I$(${PGPATH}/pg_config --includedir)"
    mylibs="${mylibs} -lpq -L$(${PGPATH}/pg_config --libdir)"
fi

While the bit-ness of the headers are not much of a concern, the libraries are.
Comment 7 Tim Harder gentoo-dev 2011-02-22 16:18:45 UTC
(In reply to comment #6)
> I'm glad that's resolved, nevertheless, this is a bug in the Postfix ebuild.
> 
> The full path should be defined rather than just pg_config.
> So, that bit should be written as:
> 
> if use postgres ; then
>     PGPATH="/usr/$(get_libdir)/postgresql/bin"
>     mycc="${mycc} -DHAS_PGSQL -I$(${PGPATH}/pg_config --includedir)"
>     mylibs="${mylibs} -lpq -L$(${PGPATH}/pg_config --libdir)"
> fi
> 
> While the bit-ness of the headers are not much of a concern, the libraries are.

However, pg_config doesn't exist in /usr/$(get_libdir)/postgresql/bin. Rather, it exists in /usr/$(get_libdir)/postgresql-${PV}/bin for every version installed and that's why the ebuild relies on the symlink /usr/bin/pg_config being set properly using eselect.

Closing as invalid.