Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 430262 - app-admin/setools-3.3.7-r3 fails to build
Summary: app-admin/setools-3.3.7-r3 fails to build
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard: selinux-utils
Keywords:
: 432162 433764 (view as bug list)
Depends on: 436338
Blocks:
  Show dependency tree
 
Reported: 2012-08-07 04:14 UTC by Patrick Lauer
Modified: 2012-12-30 15:30 UTC (History)
4 users (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 Patrick Lauer gentoo-dev 2012-08-07 04:14:42 UTC
Making all in tcl
make[4]: Entering directory `/var/tmp/portage/app-admin/setools-3.3.7-r3/work/setools-3.3.7/libqpol/swig/tcl'
/usr/bin/swig -tcl -pkgversion 1.6 -o qpol_wrap.c ../qpol.i
../qpol.i:241: Warning 504: Function qpol_module::qpol_module_t(char const *) must have a return type. Ignored.
../qpol.i:244: Warning 521: Illegal destructor name qpol_module::~qpol_module_t(). Ignored.
../qpol.i:343: Warning 504: Function qpol_policy::qpol_policy_t(char const *,int const) must have a return type. Ignored.
../qpol.i:346: Warning 521: Illegal destructor name qpol_policy::~qpol_policy_t(). Ignored.
../qpol.i:696: Warning 504: Function qpol_iterator::qpol_iterator_t() must have a return type. Ignored.
../qpol.i:699: Warning 521: Illegal destructor name qpol_iterator::~qpol_iterator_t(). Ignored.

[snip]

make[5]: Entering directory `/var/tmp/portage/app-admin/setools-3.3.7-r3/work/setools-3.3.7/libqpol/swig/tcl'
x86_64-pc-linux-gnu-gcc -std=gnu99 -shared -o libtqpol.so.1.6 qpol_wrap.c -fno-strict-aliasing   -I/usr/include -I/usr/include -I../../.. -fpic -I../../../libqpol/include -O2 -pipe -I"/usr/include" -DSWIGTCL=1 ../../../libqpol/src/libqpol.so -ltcl8.5 -Wl,-O1 -Wl,--as-needed -Wl,-soname,libtqpol.so.1
qpol_wrap.c:11:0: warning: "SWIGTCL" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
qpol_wrap.c:1831:24: error: conflicting types for ‘qpol_module_get_path’
../../../libqpol/include/qpol/module.h:69:13: note: previous declaration of ‘qpol_module_get_path’ was here
qpol_wrap.c: In function ‘qpol_module_get_path’:
qpol_wrap.c:1834:3: error: too many arguments to function ‘qpol_module_get_path’
qpol_wrap.c:1831:24: note: declared here
qpol_wrap.c: At top level:
qpol_wrap.c:1842:24: error: conflicting types for ‘qpol_module_get_name’
../../../libqpol/include/qpol/module.h:80:13: note: previous declaration of ‘qpol_module_get_name’ was here

[snip]

../../../libqpol/include/qpol/syn_rule_query.h:307:13: note: previous declaration of ‘qpol_syn_terule_get_is_enabled’ was here
qpol_wrap.c: In function ‘qpol_syn_terule_get_is_enabled’:
qpol_wrap.c:3828:3: warning: passing argument 1 of ‘qpol_syn_terule_get_is_enabled’ from incompatible pointer type [enabled by default]
qpol_wrap.c:3825:16: note: expected ‘struct qpol_syn_terule *’ but argument is of type ‘struct qpol_policy_t *’
qpol_wrap.c:3828:3: warning: passing argument 2 of ‘qpol_syn_terule_get_is_enabled’ from incompatible pointer type [enabled by default]
qpol_wrap.c:3825:16: note: expected ‘struct qpol_policy_t *’ but argument is of type ‘struct qpol_syn_terule *’
qpol_wrap.c:3828:3: error: too many arguments to function ‘qpol_syn_terule_get_is_enabled’
qpol_wrap.c:3825:16: note: declared here
make[5]: *** [libtqpol.so.1.6] Error 1
make[5]: Leaving directory `/var/tmp/portage/app-admin/setools-3.3.7-r3/work/setools-3.3.7/libqpol/swig/tcl'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/var/tmp/portage/app-admin/setools-3.3.7-r3/work/setools-3.3.7/libqpol/swig/tcl'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/app-admin/setools-3.3.7-r3/work/setools-3.3.7/libqpol/swig'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/app-admin/setools-3.3.7-r3/work/setools-3.3.7/libqpol'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/app-admin/setools-3.3.7-r3/work/setools-3.3.7'
make: *** [all] Error 2
emake failed
 * ERROR: app-admin/setools-3.3.7-r3 failed (compile phase):
 *   emake failed

Portage 2.2.0_alpha120 (default/linux/amd64/10.0, gcc-4.6.3, glibc-2.15-r2, 3.5.0vs2.3.4-vs2.3.4 x86_64)
=================================================================
System uname: Linux-3.5.0vs2.3.4-vs2.3.4-x86_64-AMD_Phenom-tm-_II_X4_965_Processor-with-gentoo-2.1
Timestamp of tree: Unknown
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12
dev-lang/python:          2.5.4-r4, 2.6.8, 2.7.3-r2, 3.1.5, 3.2.3-r1
dev-util/cmake:           2.8.8-r3
dev-util/pkgconfig:       0.27
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.10.5
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.2
sys-devel/binutils:       2.22.90
sys-devel/gcc:            4.5.3-r2, 4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.5 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl amd64 berkdb bzip2 cairo cli compat cracklib crypt cups cxx dbus dri fontconfig fortran gdbm gpm gudev iconv ipv6 jpeg minizip mmx modules mssql mudflap multilib ncurses nls nptl odbc opengl openmp pam pcre png pppd python qt3support readline script session sqlite sse sse2 ssl tcpd threads tiff tk truetype unicode webkit xml 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 authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" 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" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" 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"
USE_PYTHON="2.5 2.6 2.7 3.2 2.7-pypy-1.8 2.7-pypy-1.9 2.5-jython"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2012-08-18 10:09:47 UTC
Just some feedback.

One of the problems seen:
"""
typedef struct apol_vector {} apol_vector_t;
%extend apol_vector_t {
        apol_vector_t() {
                return apol_vector_create(NULL);
        };
        size_t get_size() {
                return apol_vector_get_size(self);
        };
        ~apol_vector_t() {
                apol_vector_destroy(&self);
        };
"""

Swig sees this as the "apol_vector" object, not "apol_vector_t", so it wants the constructor and destructor pair to be named similarly, like so:

"""
        apol_vector() {
                return apol_vector_create(NULL);
        };
        ~apol_vector() {
                return apol_vector_destry(&self);
        };
"""

The problem now seems to be that the get_size() method is translated by swig to apol_vector_get_size(), which already exists (in the C-code that we want to swigify). In this particular case, I think I can just drop the definition and have it called directly (swig should be sufficiently intelligent, doesn't it?) but there are others where the declaration that swig generates is different from the one in the code.

If that occurs, and I don't find a way to override this (perhaps namespaces, but that's a far stretch) then I'm even further away from home...
Comment 2 Sven Vermeulen (RETIRED) gentoo-dev 2012-08-18 12:33:07 UTC
Okay, %rename()'ing all functions (a little over 500 from the first count) and updating their wrappers... *sigh*

Hopefully that really fixes things and doesn't just fix build (but fail at runtime).
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2012-08-20 18:55:03 UTC
Got it to build again. Running regression tests against policycoreutils now (as those are the ones I know use the swig'ified interfaces of setools) and will then commit.
Comment 4 Sven Vermeulen (RETIRED) gentoo-dev 2012-08-21 17:59:03 UTC
*** Bug 432162 has been marked as a duplicate of this bug. ***
Comment 5 Sven Vermeulen (RETIRED) gentoo-dev 2012-08-24 17:06:34 UTC
setools-3.3.7-r5 in hardened-dev overlay
Comment 6 Xiang Zhai 2012-09-06 03:14:57 UTC
*** Bug 433764 has been marked as a duplicate of this bug. ***
Comment 7 Sven Vermeulen (RETIRED) gentoo-dev 2012-09-08 18:34:42 UTC
In main tree, ~arch
Comment 8 Sven Vermeulen (RETIRED) gentoo-dev 2012-09-29 08:12:44 UTC
Some reports are that this was a swig error instead of a coding error. At least with swig-2.0.4-r1 setools-3.3.7-r3 seems to build just fine (again).

Reopening
Comment 9 Sven Vermeulen (RETIRED) gentoo-dev 2012-09-29 15:53:27 UTC
ok, swig-2.0.8 still fails to build -r3
Comment 10 Sven Vermeulen (RETIRED) gentoo-dev 2012-11-18 13:14:24 UTC
So, for future reference...

swig-2.0.something started using the C++ standard for handling constructors/destructors. So in the following definition, "A" is the correct constructor:

"""
typedef struct A {
  A();
  B();
} B;
"""

However, the swig code used in setools uses "B" as the constructor:

"""
typedef struct apol_vector {
  apol_vector_t() { ... };
} apol_vector_t;
"""

This causes the code to fail with recent enough swig. Attempts to correct this code gives failures all over the map: duplicate definitions (as the code is currently interwoven with wrappers) if you correct it to one way, or unmatching functions if you correct it the other way. Also, the various setools applications use the (wrong) names too, so there a lot of work would be needed as well.

What I am going to do is to:
(1.) force building with <swig-2.0 which doesn't exhibit this behavior
(2.) force building with python-2.7 again as <swig-2.0 doesn't work with python 3.2.

This is sad to say, but I cannot devote any more time on this matter until upstream resolves this properly.
Comment 11 Sven Vermeulen (RETIRED) gentoo-dev 2012-11-18 13:18:08 UTC
In hardened-dev overlay
Comment 12 Sven Vermeulen (RETIRED) gentoo-dev 2012-11-23 20:53:19 UTC
Moved to main tree
Comment 13 eroen 2012-12-10 04:58:35 UTC
Might I suggest this be reopened since it's broken and not fixed yet in stable? At the very least it will reduce the frequency of duplicate bug reports and make the cause more visible for those who wonder why their updates keep failing.
Comment 14 Sven Vermeulen (RETIRED) gentoo-dev 2012-12-10 19:18:21 UTC
We're using the following status to allow easier follow-up of bugs:

RESOLVED:TEST-REQUEST - fix is in an overlay
VERIFIED:TEST-REQUEST - fix is in main tree, ~arch
VERIFIED:FIXED - fix is in main tree, stable
Comment 15 schmitt953 2012-12-16 02:25:53 UTC
I get a python error. I'm going to try a few things in a bit. I'll get back to you with the results shortly.
Comment 16 schmitt953 2012-12-16 02:27:26 UTC
r6 appears to work, r3 did not (r6 is still marked unstable, I updated today). I'll send you my logs, if I forget ping me on irc.
Comment 17 Sven Vermeulen (RETIRED) gentoo-dev 2012-12-16 20:35:30 UTC
@schmitt953: it is still marked unstable, hence the TEST-REQUEST part. It'll be marked as FIXED when it gets stable.
Comment 18 Sven Vermeulen (RETIRED) gentoo-dev 2012-12-30 15:30:58 UTC
Stabilized