It's not a SWIG bug but an error in the patch. I reworked it and submitted upstream (https://github.com/TresysTechnology/setools3/pull/2). I'm waiting for upstream review/feedback before including the patch to the package, alongside with what's needed to support libsepol 2.4 (https://github.com/TresysTechnology/setools/commit/3937946900cf4f8bee2fdda697831b14ab8f849d).
Search Criteria
Package Details: setools 3.3.8-5
Package Actions
| Package Base: | setools |
|---|---|
| Description: | Policy analysis tools for SELinux |
| Upstream URL: | http://oss.tresys.com/projects/setools/ |
| Category: | system |
| Licenses: | |
| Groups: | |
| Conflicts: | |
| Provides: | |
| Submitter: | Siosm |
| Maintainer: | IooNag |
| Last Packager: | IooNag |
| Votes: | 8 |
| First Submitted: | 2013-11-03 20:05 |
| Last Updated: | 2015-02-22 13:11 |
Dependencies (17)
- bison
- flex
- libselinux>=2.4
- libsepol>=2.4
- python2
- sqlite3>=3.6.20
- bwidget>=1.8 (make)
- glib2 (make)
- gtk2>=2.8 (make)
- java-environment (make)
- libglade>=2.6.4 (make)
- tk>=8.4.9 (make)
- bwidget>=1.8: needed for graphical tools (optional) – (unknown)
- glib2 (optional) – needed for graphical tools
- gtk2>=2.8: needed for graphical tools (optional) – (unknown)
- libglade>=2.6.4: needed for graphical tools (optional) – (unknown)
- tk>=8.4.9: needed for graphical tools (optional) – (unknown)
Required by (1)
Sources
- 0001-Remove-deprecated-use-of-g_cond_timed_wait-which-pre.patch
- 0002-Fix-changelog-entry.patch
- 0003-setools-APOL-Add-constraints-and-filename-transition.patch
- 0004-setools-APOL-Add-support-for-permissive-types-polcap.patch
- 0005-setools-APOL-Add-type-user-role-bounds-support.patch
- 0006-setools-APOL-Add-default_objects-and-CIL-policy-name.patch
- 0007-setools-Update-to-load-v29-policy-source-files.patch
- 0008-Change-file-name-type_transition-class-member-functi.patch
- 0009-Switching-svn-references-to-git.patch
- 0010-Add-get_object_class-function-for-role-transition-ru.patch
- 0011-Fix-missing-parentheses-in-policy_define.c.patch
- 0012-Make-the-SWIG-files-compatible-with-SWIG-3.patch
- 0013-Update-for-2015-02-02-Userspace-release-2.4.patch
- https://raw.githubusercontent.com/wiki/TresysTechnology/setools3/files/dists/setools-3.3.8/setools-3.3.8.tar.bz2
Latest Comments
Comment by IooNag
Comment by fmorris
Ok, I managed to install the package removing the extra % from the Gentoo patch. Thanks! Should I still report the bug to SWIG?
Comment by IooNag
In fact, Gentoo no longer uses the patch but forces swig 1 to be installed (https://bugs.gentoo.org/show_bug.cgi?id=430262#c10 and http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-admin/setools/setools-3.3.8-r5.ebuild?view=markup ). As there are some backward-compatibility issues and I don't want to spend much time on it alone, I may update the package to use "swig1" or "swig2" AUR package if this works.
Comment by IooNag
Ok, I found what caused the issue. The Gentoo patch contains:
+%rename(seaudit_avc_message_get_message_type) %seaudit_avc_message_wrap_get_message_type;
... the second percent sign is invalid. Without it, this line works fine:
+%rename(seaudit_avc_message_get_message_type) seaudit_avc_message_wrap_get_message_type;
I'm going to report this bug against the Gentoo package (we are using Gentoo patch because upstream only support SWIG 2).
Comment by IooNag
I can reproduce your issue but I think it is a bug in SWIG, as I can build setools with swig 3.0.3-1. For a "quick & dirty fix", you can build an older version of SWIG by using this PKGBUILD: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/swig&id=c7b7029adf16fdc65bf336e8a119e928af5d997f
The Github issue you indicated tracks an other issue, with message "Assertion failed: (b->refcount > 0), function DohDelete, file DOH/base.c, line 42.", not "swig: DOH/base.c:36: DohDelete: Assertion `0' failed.". A quick look at the code (https://github.com/swig/swig/blob/rel-3.0.4/Source/DOH/base.c#L25 ) shows that a debug build of SWIG (with SWIG_DEBUG_DELETE) can show more verbose messages.
Could you please use a debug build of SWIG and report the messages you get to SWIG bugtracker?
Comment by fmorris
Building version 3.3.8-4 of the package fails with swig 3.0.4.
swig: DOH/base.c:36: DohDelete: Assertion `0' failed.
Makefile:688: recipe for target 'seaudit_wrap.c' failed
make[4]: *** [seaudit_wrap.c] Aborted (core dumped)
The swig error seems to be related to this issue
https://github.com/swig/swig/issues/280
which seems to have been fixed back on 2014-12-18... latest swig AUR build is 2015-01-15 so it should contain the fix?
Comment by grondinm
That does the trick. Thank you for the quick fixes
Comment by IooNag
I added "--sbindir=/usr/bin" to configure parameters. This should solve your issue. Thanks for your bug report.
Comment by grondinm
this one failing as well
error: failed to commit transaction (conflicting files)
setools: /usr/sbin exists in filesystem
Errors occurred, no packages were upgraded.
Comment by Siosm
Renamed to setools
Comment by skorgon
Picking up the patch looNag points to in a modificated PKGBUILD as schown below, the package compiles w/o the downgrade of swig. Somebody might find it useful:
--- PKGBUILD.orig 2013-07-20 10:21:09.000000000 -0700
+++ PKGBUILD.new 2013-09-26 22:26:40.497646177 -0700
@@ -14,9 +14,9 @@
optdepends=('glib2: needed to build graphical tools'
'gtk2>=2.8: needed to build graphical tools'
'bwidget>=1.8: needed to build graphical tools')
-makedepends=('swig=2.0.4' 'python' 'java-environment' 'pkgconfig' 'autoconf>=2.60')
-source=("http://oss.tresys.com/projects/${_origname}/chrome/site/dists/${_origname}-${pkgver}/${_origname}-${pkgver}.tar.bz2")
-sha256sums=('44387ecc9a231ec536a937783440cd8960a72c51f14bffc1604b7525e341e999')
+makedepends=('python' 'java-environment' 'pkgconfig' 'autoconf>=2.60')
+source=("http://oss.tresys.com/projects/${_origname}/chrome/site/dists/${_origname}-${pkgver}/${_origname}-${pkgver}.tar.bz2" "http://dev.gentoo.org/~swift/patches/0008-fix_swig_build_failures_bug_430262.patch")
+sha256sums=('44387ecc9a231ec536a937783440cd8960a72c51f14bffc1604b7525e341e999' '2f314f9236bf4c5137e1e5b1dd5bc312c4ce84942238b98725468e75096eae8f')
build() {
cd "${srcdir}/${_origname}-${pkgver}"
@@ -24,8 +24,10 @@
# Python 2 fix
export PYTHON=/usr/bin/python2
+ # apply patch
+ patch -Np1 -i ../0008-fix_swig_build_failures_bug_430262.patch
+
# Fix expected version of SWIG
- sed -i -e "s|AC_PROG_SWIG(1.3.28)|AC_PROG_SWIG(2.0.0)|g" configure.ac
aclocal
autoreconf -if
automake
Comment by xangelux
lol, sorry, didn't read the patch posted by looNag
Comment by xangelux
Found a patch, was made for version 3.3.7 but lets me build 3.3.8
http://dev.gentoo.org/~swift/patches/0008-fix_swig_build_failures_bug_430262.patch
Add the file to the sources array, add the sha256 (2f314f9236bf4c5137e1e5b1dd5bc312c4ce84942238b98725468e75096eae8f)
and put patch -p1 < "${srcdir}/0008-fix_swig_build_failures_bug_430262.patch" after changing dir
Comment by Nicky726
Hi, guys, thank you for the feedback. Unfortunately, I am very busy recently, so I am afraid, I won't be able to do anything about the SELinux packages soon. If there happens to be someone willing with more time though, I could shift the maintenance of SELinux packages onto his shoulders. I could provide him with some helper scripts and local git repos which make following the Arch changes easier. Just send me a mail.
Comment by genghizkhan91
Yeah. The only other option is to downgrade the swig package (as mentioned in the wiki, I think), and doing that isn't possible with the Arch Rollback Machine offline.
Comment by IooNag
selinux-setools fails to build with lastest swig package (2.0.11-1) but with Gentoo patch from http://www.spinics.net/lists/selinux/msg12952.html (http://dev.gentoo.org/~swift/patches/0008-fix_swig_build_failures_bug_430262.patch) the build is fine. Could you add this patch and update swig version in the build dependencies?
Comment by farmerdave
Does this actually depend on selinux-refpolicy-src? Because according to all the current PKGBUILDs
selinux-usr-policycoreutils depends on selinux-setools
selinux-setools depends on selinux-refpolicy-src
and
selinux-refpolicy-src depends on selinux-usr-policycoreutils.
This does successfully build without specifying "depends=('selinux-refpolicy-src')
Comment by Draadmachine
If you try to install selinux-setools via Yaourt it goes in regression because the packages are dependencies of each other. A possible fix is to remove the dependency selinux-usr-policycoreutils>=2.1.10 from the PKGBUILD of this package.
Comment by Nicky726
So I finally got to update this...
Comment by hi117
apol requires bwidget to run.
Anonymous comment
Also, for those trying to compile: you must downgrade SWIG to 2.0.4-3. The latest versions of SWIG end up causing the selinux-setools compile to eat itself.
Comment by Nicky726
Thank you for your feedback. I'll try to incorporate it into the PKGBUILD, but unfortunately, I am very busy lately.
Anonymous comment
The makefile for libqpol is looking for SWIGTYPE_p_int.java but the file doesn't exist. It's referenced on line 442 of the libqpol/swig/java/Makefile.
Comment by Nicky726
I can't get over qpol_wrap.c build error. Both with 3.3.7 and 3.3.8. Fedora doesn't fix it in any of its patches in current version, so I guess it may be due to something being newer in Arch.
Comment by Nicky726
Yes, this will need some work, it is on my TODO list...
Comment by xangelux
Can't build it, as the other user says needs a bunch of things to build, does it need an update?
Comment by Siosm
-optdepends=('glib2:needed to build graphical tools'
-'gtk2>=2.8:needed to build graphical tools'
-'bwidget>=1.8:needed to build graphical tools')
+optdepends=('glib2: needed to build graphical tools'
+'gtk2>=2.8: needed to build graphical tools'
+'bwidget>=1.8: needed to build graphical tools')
Comment by Nicky726
Thanx, addopted your changes now builds fine.
Comment by chenxiaolong
Nevermind. It seems that running 'autoreconf -vfi' is required before the patches will work. Here's my fixed PKGBUILD with the patches from the links below: http://pastie.org/3003770
Comment by chenxiaolong
I can't seem to get patch '0006-Changes-to-support-named-file_trans-rules.patch' to work though :(
Comment by chenxiaolong
Link to source RPM: http://koji.fedoraproject.org/koji/buildinfo?buildID=273744
Comment by chenxiaolong
@Nicky726: Could you add the patches from the Fedora source RPM? http://koji.fedoraproject.org/koji/rpminfo?rpmID=2789748
That should fix the incompatibility issue.
Anonymous comment
sys: arch 3.1.2 x86_64. as advised: downloaded selinux all 20111128, tar, makepkg -s
all selinux packages installed except sysvinit (and setools)
same error as ajes 20111015
Comment by ajes
checking for corrected libsepol boolean expand behavior... configure: error: this version of libsepol is incompatible with SETools
==> ERROR: A failure occurred in build().
Anonymous comment
Same issue for me, which I fixed by reverting to --with-java-prefix=/usr/lib/jvm/java-6-openjdk.
I suspect because java was installed as a dependency during install, JAVA_HOME didn't have a sane value.
Comment by Nicky726
Builds fine with me (openjdk6). Please be more specific about your issue.
Comment by Yaro
It doesn't build with --with-java-prefix="$JAVA_HOME" for me.
Comment by Nicky726
Now builds with SWIG 2.0.0
Comment by Nicky726
Moved back to dependencies.
Comment by coolkehon
Will not finish configure without:
tcl
tk
libglade >= 2.6.4-1
Comment by Nicky726
Updated to 3.3.7, changes in PKGBUILD:
autoconf now needed as builddep;
dependencies for GUI tools moved to optdep;
--disable-bwidget-check flag used by default.
This should build ok at noGUI machine, though I didn't tested, as I have none.
Comment by Nicky726
Thanx, I changed the java-prefix stuff, and will look to other some other day. Btw. there is is still gtk2 as dependency, so does disabling bwidget help?
Anonymous comment
I had to edit PKGBUILD so that ./configure is run with the argument
--with-java-prefix="$JAVA_HOME"
instead of
--with-java-prefix=/usr/lib/jvm/java-6-openjdk
Also, it might be wise to use the --disable-bwidget-check flag by default. I imagine a lot of people would be installing SELinux in a nongraphical environment. Maybe the bwidget package could be put as an optional dependency.