dev-python/m2crypto-0.13 fails to emerge with a swig error. I am using python-2.4.1 and swig-1.3.21 Reproducible: Always Steps to Reproduce: 1. emerge =m2crypto-0.13 Actual Results: copying M2Crypto/PGP/packet.py -> build/lib.linux-i686-2.4/M2Crypto/PGP copying M2Crypto/PGP/__init__.py -> build/lib.linux-i686-2.4/M2Crypto/PGP running build_ext building '__m2crypto' extension Traceback (most recent call last): File "setup.py", line 96, in ? ext_modules = [m2crypto] File "/usr/lib/python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib/python2.4/distutils/command/build.py", line 112, in run self.run_command(cmd_name) File "/usr/lib/python2.4/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib/python2.4/distutils/command/build_ext.py", line 279, in run self.build_extensions() File "/usr/lib/python2.4/distutils/command/build_ext.py", line 405, in build_extensions self.build_extension(ext) File "/usr/lib/python2.4/distutils/command/build_ext.py", line 442, in build_extension sources = self.swig_sources(sources, ext) TypeError: swig_sources() takes exactly 2 arguments (3 given) !!! ERROR: dev-python/m2crypto-0.13 failed. Expected Results: successful emerge Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.4.4-vanilla, glibc-2.3.5-r0, 2.6.11-gentoo-r9 i686) ================================================================= System uname: 2.6.11-gentoo-r9 i686 AMD Athlon(tm) XP 2500+ Gentoo Base System version 1.6.12 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [enabled] dev-lang/python: 2.3.5, 2.4.1 sys-apps/sandbox: 1.2.1-r2 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.16-r1 sys-devel/libtool: 1.5.18 virtual/os-headers: 2.6.11-r1 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=athlon-xp -O2 -pipe -frename-registers -fomit-frame-pointer " CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d" CXXFLAGS="-march=athlon-xp -O2 -pipe -frename-registers -fomit-frame-pointer " DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://ftp-mirror.internap.com/pub/gentoo/ http://gentoo.binarycompass.org http://mirror.datapipe.net/gentoo http://www.ibiblio.org/pub/Linux/distributions/gentoo http://gentoo.osuosl.org" LANG="en_US.utf8" LC_ALL="en_US.utf8" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="x86 3dnow X aac aalib acl acpi adns aim alsa apache2 apm arts avi bash-completion berkdb bitmap-fonts bonobo cdr cjk cmucl crypt cscope cups curl dnd doc dumb-allegro dvd dvdr editor eds emacs emboss encode erandom esd ethereal evo fam fbcon ffmpeg fftw flac foomaticdb fortran gd gdbm ggi gif gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hal hardened imagemagick imlib ipv6 ithreads jack java jce jpeg junit kde kerberos lcms ldap libg++ libwww mad mbox mikmod mmx mng mono motif mozdevelop mozilla moznocompose moznoirc moznomail mozxmlterm mp3 mpeg mule mysql nas ncurses nls nntp nptl oav odbc ogg oggvorbis opengl opie oss pam pcre pda pdflib perl pic plotutils png postgres python qt quicktime readline samba scanner sdl slang slp snmp speex spell sqlite sse ssl svg tcltk tcpd tetex threads tiff truetype truetype-fonts type1-fonts unicode usb vorbis win32codecs wmf xface xine xinerama xml xml2 xmms xprint xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LDFLAGS, LINGUAS
Looks like a distutils error for Python 2.4, need to make a patch if 2.4* - def swig_sources (self, sources): + def swig_sources (self, sources, extension=None): if not self.extensions: return
After getting distutils working there seems to be an httpslib problem in 2.4 which hasn't been fixed upstream yet, in case anyone else is looking into this.
I've looked at m2 svn - http://sandbox.rulemaker.net/ngps/m2/ svn co http://svn.osafoundation.org/m2crypto/trunk m2 it seems to work with new python and swig versions. until 0.15 is released a svn snapshot might be the best "bugfix"
I'm still seeing the exact same error message as the original poster. I first saw it when I ran python-updater. Repeating the rebuild as "emerge -v m2crypto" also repeated the error. I understand that there is/was some sort of problem with a piece of software at version x.15 that is related to python ebuilds. However, I don't know which app and exactly which version that we are talking about. Is there some place that I can research the topic? TIA
This is still an issue. After setting ~x86 for m2crypto, I get errors like this for 0.13.1: creating build/temp.linux-i686-2.4/SWIG i686-pc-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -march=pentium3 -fomit-frame-pointer -falign-labels=8 -falign-functions=32 -pipe -fPIC -I/var/tmp/portage/m2crypto-0.13.1/work/m2crypto-0.13/SWIG -I/usr/include -I/usr/include/python2.4 -c SWIG/_m2crypto.c -o build/temp.linux-i686-2.4/SWIG/_m2crypto.o -DTHREADING SWIG/_m2crypto.c:3912: error: conflicting types for `SSL_get_error' /usr/include/openssl/ssl.h:1325: error: previous declaration of `SSL_get_error' SWIG/_m2crypto.c:3926: error: conflicting types for `SSL_CTX_get_verify_depth' /usr/include/openssl/ssl.h:1280: error: previous declaration of `SSL_CTX_get_verify_depth' SWIG/_m2crypto.c:3927: error: conflicting types for `SSL_CTX_get_verify_mode' /usr/include/openssl/ssl.h:1279: error: previous declaration of `SSL_CTX_get_verify_mode' SWIG/_m2crypto.c:3937: error: conflicting types for `SSL_CTX_get_timeout' /usr/include/openssl/ssl.h:1175: error: previous declaration of `SSL_CTX_get_timeout' I'm wondering if the openssl version is an issue, though this seems unlikely as I have had openssl-0.9.7e for nearly a year. I also tried updating swig to the current ~x86 version, and this didn't help. I'll try some more tests later; I don't have time to look at this just now.
after setting openssl to ~x86 and updating it to openssl-0.9.7i, m2crypto emerged successful.
*** Bug 117381 has been marked as a duplicate of this bug. ***
(In reply to comment #6) > after setting openssl to ~x86 and updating it to openssl-0.9.7i, > m2crypto emerged successful. > thank you, very good advice, solved my problem too! this is one of bugs which I think we can put into FIXED state now
It does emerge, but it appears to be broken. An existing application of mine does this: from M2Crypto import ftpslib ftp = ftpslib.FTP_TLS(hostname) This results in an exception: File "/usr/lib/python2.4/site-packages/M2Crypto/ftpslib.py", line 56, in __init__ self.ssl_ctx = SSL.Context(DEFAULT_PROTOCOL) File "/usr/lib/python2.4/site-packages/M2Crypto/SSL/Context.py", line 42, in __init__ map()[self.ctx] = self File "/usr/lib/python2.4/site-packages/M2Crypto/SSL/Context.py", line 21, in __setitem__ self.map[key] = value TypeError: unhashable type I added a bit of debugging code to M2Crypto.SSL.Context and found that the unhashable object in question is <Swig Object at _d0af0708_p_SSL_CTX>, which is of type PySwigObject. My system has swig-1.3.35 and python-2.4.2 and m2crypto-0.13.1 (0.13 does not build, same error as original report) and openssl-0.9.7i. I suspect something has changed between Python 2.3 and 2.4, or maybe between swig-1.3.21 and .25, that affects the hashability of swig types (not in general).
Created attachment 83207 [details, diff] patch to m2crypto-0.13/setup.py m2crypto had copied a swig_sources method from Python 2.2 distutils. From Python 2.2 to 2.4, that method was modified (among other things, now takes a third parameter). I diff'd the m2crypto version against the 2.2 to determine the mods that m2crypto itself needed, and merged those into a Python 2.4 copy of the swig_sources method. With this patch, the emerge now succeeds (for me, anyway). I'm not versed enough to know how you'd detect versions of Python installed to make this change conditional, though.
What's the status here?
On ~amd64, if I emerge =m2crypto-0.13.1, it works with python-2.4.3-r1 and swig-1.3.21. The aforementioned SFTP problem seems to be fixed too. However I previously had problems with swig-1.3.25. See comment #10.
Version 0.13 just left the tree and 0.16/0.17 seem to compile perfectly.