Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 563680 - <app-portage/eix-0.31.1 USE="-nls" - /usr/include/libintl.h:39:42: error: macro "gettext" requires 3 arguments, but only 1 given
Summary: <app-portage/eix-0.31.1 USE="-nls" - /usr/include/libintl.h:39:42: error: mac...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-21 12:47 UTC by Tomáš Mózes
Modified: 2016-01-18 06:52 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,17.03 KB, text/plain)
2015-10-21 12:48 UTC, Tomáš Mózes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Mózes 2015-10-21 12:47:58 UTC
Portage 2.2.23 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.3, glibc-2.21-r1, 4.1.6-gentoo x86_64)
=================================================================
System uname: Linux-4.1.6-gentoo-x86_64-Intel-R-_Core-TM-_i5-3570_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16327540 total,   2000188 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Wed, 21 Oct 2015 01:45:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.10::gentoo, 3.4.3::gentoo, 3.5.0-r1::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r3::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-mtune=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://tux.rainside.sk/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 berkdb branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gpm gtk iconv jpeg lcms ldap libnotify mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt3support qt4 readline sdl seccomp session sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64 32" 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" APACHE2_MODULES="access_compat authn_core authz_core authz_host dir mime unixd socache_shmcb log_config rewrite vhost_alias log_forensic proxy proxy_fcgi info status deflate filter auth_digest authn_file authz_user actions alias auth_basic authn_alias authn_anon env expires headers mime_magic negotiation reqtimeout setenvif unique_id version cgi http2" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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 ublox ubx" GRUB_PLATFORMS="efi-64 xen pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-0 php5-6 php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4 python3_5" QEMU_SOFTMMU_TARGETS="x86_64 i386" QEMU_USER_TARGETS="x86_64 i386" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="intel i915" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Tomáš Mózes 2015-10-21 12:48:25 UTC
Created attachment 415092 [details]
build.log
Comment 2 Tomáš Mózes 2015-10-21 13:02:27 UTC
Merging 0.30.11 works fine.
Comment 3 Neil Bothwick 2015-10-21 13:42:43 UTC
This is because of USE="-nls", turning on this USE flag results in successful merging.
Comment 4 Ian Stakenvicius (RETIRED) gentoo-dev 2015-10-21 14:00:40 UTC
(In reply to Neil Bothwick from comment #3)
> This is because of USE="-nls", turning on this USE flag results in
> successful merging.

Do you happen to know if this is because of a mismatch in the flag's setting between eix and gettext?  Generally having a use flag off shouldn't cause a compile failure, so if we need to adjust deps to ensure more strict enforcement I'd like to do that.
Comment 5 Martin Väth 2015-10-21 14:16:07 UTC
(In reply to Neil Bothwick from comment #3)
> This is because of USE=-nls

Yes, this is the reason - this case was no tested.

The technical cause of the error is that, even if libintl.h is not included, including <cstdin> apparently magically includes libintl.h (on glibc), thus trying to provide ngettext(), although eix explicitly avoids including libintl.h and provides a macro substitute for ngettext(); of course this macro then causes all sort of random errors near the function declaration.

I am not sure how this bug can be fixed reliably so that:

1. An ngettext() substitute is provided also on non-GNU-systems, in particular:
2. It does not link against some libintl-substitute on non-GNU systems.
3. In the main source text the function ngettext can be used.

The requirement 3. might appear strange, but I did not succeed to use any other macro in place of ngettext() so that the xgettext binary can be used with the source code: The xgettext arguments --keyword=N_, e.g., makes the macro N_ behave like gettext() but not like ngettext() (despite this solution seems to be suggest by the gettext developers).

The obvious attempt to define ngettext as a macro fails, as we see in this bug, because after the redefinition still some include might implicitly include libintl.h, causing breakage. Currently, I see only one solution: I must redefine ngettext with a macro after *all* includes. Such a solution, relying on a tricky order of include files, is of course more a hack than a clean solution...
Comment 6 Martin Väth 2015-10-21 14:18:58 UTC
I try to release a new version with this hackish solution soon, but I would be grateful for ideas for a better solution.
Comment 7 Martin Väth 2015-10-21 15:44:33 UTC
eix-0.31.1 with the hackish fix is released.
Please bump the ebuild to that version
(and remove the ebuild for the broken version). Thanks
Comment 8 Felix Janda 2015-10-21 18:28:46 UTC
Isn't what the gettext documentation suggests "xgettext --keyword=eix_ngettext:1,2"?
Comment 9 Neil Bothwick 2015-10-21 22:27:55 UTC
(In reply to Ian Stakenvicius from comment #4)
> (In reply to Neil Bothwick from comment #3)
> > This is because of USE="-nls", turning on this USE flag results in
> > successful merging.
> 
> Do you happen to know if this is because of a mismatch in the flag's setting
> between eix and gettext?  Generally having a use flag off shouldn't cause a
> compile failure, so if we need to adjust deps to ensure more strict
> enforcement I'd like to do that.

No mismatch, two systems were affected by this and both had USE="-nls" globally.
Comment 10 Neil Bothwick 2015-10-21 22:29:06 UTC
I can confirm that the new version installs fine and appears to work well.
Comment 11 Tomáš Mózes 2015-10-22 05:12:59 UTC
Yes I can too confirm that 0.31.1 works fine, can we get it to portage please?
Comment 12 Martin Väth 2015-10-22 05:33:06 UTC
(In reply to Felix Janda from comment #8)
> xgettext --keyword=eix_ngettext:1,2

Thanks, I did not know about that. (The manpage does not mention, and apparently also the documentation where I saw --keyword=N_ seems to be very outdated.)

So I will work on it to fix the issue in >=eix-0.31.2 non-hackishly.

However, there is no hurry with it: for the moment, eix-0.31.1 will do.
Please bump! Thanks in advance.
Comment 13 Ian Stakenvicius (RETIRED) gentoo-dev 2015-10-22 16:50:14 UTC
commit 2956fc66e49e9d2ab5ded8cd6b293c86875e2025
Author: Ian Stakenvicius <axs@gentoo.org>
Date:   Thu Oct 22 12:07:39 2015 -0400

    app-portage/eix: workaround gettext issue when USE=-nls
    
    Gentoo bug 563680

..leaving bug open to track the "non-hacky fix" as martin described it :)
Comment 14 Tomáš Mózes 2016-01-18 06:52:20 UTC
Thank you