Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 219238

Summary: dev-python/wxpython-2.8.7.1 fails to build, dev-lang/python gentoo patch breaks distutils _compile interface
Product: Gentoo Linux Reporter: Helmut Jarausch <jarausch>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: normal CC: aklhfex, andrey.prok, coldwind, cuciferus, gentoo, ikelos, john, koprut, pqGungnir, python, r.a, spamdummy, wxwidgets
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 230205    
Attachments: patch for build wxPython-2.8.7.1 against python 2.5.2-r2
modified ebuild
wxpython-2.8.7.1-cxxflags.patch

Description Helmut Jarausch 2008-04-25 06:09:29 UTC
emerge dev-python/wxpython  (with USEFLAG opengl)  gives

package init file 'wx/tools/XRCed/plugins/__init__.py' not found (or not a regular file)
running build_ext
building '_core_' extension
creating build-gtk2.unicode/temp.linux-i686-2.5
creating build-gtk2.unicode/temp.linux-i686-2.5/src
creating build-gtk2.unicode/temp.linux-i686-2.5/src/gtk
Traceback (most recent call last):
  File "setup.py", line 922, in <module>
    'clean':           wx_extra_clean,
  File "/usr/lib/python2.5/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.5/distutils/dist.py", line 974, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.5/distutils/dist.py", line 994, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.5/distutils/command/build.py", line 112, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.5/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.5/distutils/dist.py", line 994, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.5/distutils/command/build_ext.py", line 290, in run
    self.build_extensions()
  File "/usr/lib/python2.5/distutils/command/build_ext.py", line 416, in build_extensions
    self.build_extension(ext)
  File "/usr/lib/python2.5/distutils/command/build_ext.py", line 481, in build_extension
    depends=ext.depends)
  File "/usr/lib/python2.5/distutils/ccompiler.py", line 700, in compile
    lang=lang)
TypeError: _compile() got an unexpected keyword argument 'lang'
 * 
 * ERROR: dev-python/wxpython-2.8.7.1 failed.


Reproducible: Always




emerge --info
Portage 2.1.5_rc6 (default-linux/x86/2007.0, gcc-4.2.3, glibc-2.7-r2, 2.6.25-gentoo-r1 i686)
=================================================================
System uname: 2.6.25-gentoo-r1 i686 Pentium III (Coppermine)
Timestamp of tree: Thu, 24 Apr 2008 13:17:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.5.2-r2
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.25-r1
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/NX/etc /usr/NX/home /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo "
LDFLAGS=""
LINGUAS="en de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.informatik.RWTH-Aachen.de/gentoo-portage"
USE="X acl alsa atm berkdb cairo cdr cli cracklib crypt cups doc dri dvd fortran gdbm gif gimp gnome gpm gtk iconv ipv6 isdnlog jpeg kde lcms midi mmx mudflap ncurses nls nptl nptlonly opengl openmp pam pcre pdf perl png pppd python qt qt4 readline reflection session spl sqlite sqlite3 sse ssl svg tcl tcpd tetex tiff tk unicode x86 xorg xulrunner zlib" ALSA_CARDS="ens1371" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de" USERLAND="GNU" VIDEO_CARDS="nv"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 manwe 2008-04-25 17:28:00 UTC
Same error.

Portage 2.1.5_rc6 (default-linux/amd64/2007.0, gcc-4.2.3, glibc-2.7-r2, 2.6.24-zen4-endar-v21 x86_64)
=================================================================
System uname: 2.6.24-zen4-endar-v21 x86_64 AMD Turion(tm) 64 Mobile Technology MT-32
Timestamp of tree: Thu, 24 Apr 2008 19:16:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.4.4-r11
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.25-r1
ABI="amd64"
ASFLAGS_x86="--32"
AUTOCLEAN="yes"
CAMERAS="canon ptp2"
CBUILD="x86_64-pc-linux-gnu"
CDEFINE_amd64="__x86_64__"
CDEFINE_x86="__i386__"
CFLAGS="-O2 -pipe -msse3 -march=athlon64"
CFLAGS_x86="-m32 -L/emul/linux/x86/lib -L/emul/linux/x86/usr/lib"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x86="i686-pc-linux-gnu"


Comment 2 Ryan Hill (RETIRED) gentoo-dev 2008-04-27 07:45:02 UTC
looks like distutils breakage.  python guys?
Comment 3 tonich 2008-04-29 05:38:43 UTC
in python-gentoo-patches-2.5.2-r2.tar.bz2 in file 18_all_distutils-cxxflags.patch

this patch adds extra argument (lang=lang) to _compile function call.

wxPython's build script defines custom _compile function without this extra argument.

Ways to solve: remove _compile related patches from python-gentoo-patches or patch _ALL_ packages, who redefines _compile function.
Comment 4 tonich 2008-04-29 06:20:00 UTC
Created attachment 151295 [details, diff]
patch for build wxPython-2.8.7.1 against python 2.5.2-r2

This patch adds extra argument to redefined in wxPython build scripst _compile() function.
Comment 5 tonich 2008-04-29 06:26:13 UTC
Created attachment 151296 [details]
modified ebuild

if distutil's patch in python 2.5.2 is persistent, then this ebuild solves the problem, else this is teporary solution.
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2008-04-30 17:08:07 UTC
*** Bug 219847 has been marked as a duplicate of this bug. ***
Comment 7 cucu ionut 2008-05-01 10:26:25 UTC
Thanks for the patch guys! It now works(although the patch could be renamed to wxpython-2.8.7-build.patch for others to get minimum fuss)
Comment 8 James Ausmus 2008-05-01 21:11:31 UTC
(In reply to comment #7)
> Thanks for the patch guys! It now works(although the patch could be renamed to
> wxpython-2.8.7-build.patch for others to get minimum fuss)
> 

Works for me on amd64.

Thanks!
Comment 9 Michael Polskienazwisko 2008-05-02 13:05:33 UTC
if this patch works it should be incorporated to portage 

Comment 10 Ryan Hill (RETIRED) gentoo-dev 2008-05-02 13:30:59 UTC
just because it works doesn't mean it's the right fix.

i need to know if the problem is with the distutils patch in python, or if the python team wants us to patch any package that uses custom _compile functions (i don't know how common this is, if at all).
Comment 11 Ali Polatel (RETIRED) gentoo-dev 2008-05-13 15:51:41 UTC
Created attachment 153063 [details, diff]
wxpython-2.8.7.1-cxxflags.patch

2.5.2-r3 and 2.4.4-r12 should work fine with wxpython. Attached is a patch for
wxpython-2.8.7.1 to respect CXXFLAGS.  This is _not_ for wxpython itself but
for packages that uses wxpython's config.py to build.
Comment 12 Mike Auty (RETIRED) gentoo-dev 2008-09-14 13:12:10 UTC
Hiya guys,

I just ran into this exact problem on python-2.6b3 and wxpython-2.8.8.1 (but then assumed it was an issue with the beta, rather than a gentoo patch).  It's in 2.6b3 as 010_all_cflags.patch.

It strikes me as a really bad idea to knowingly break an interface that people are recommended to subclass (such as the _compile interface).  No other patch (at least in 2.6b3) changes function signatures, and probably with good reason.

It might have been ok if there were a **kwargs entry in there originally, and it would just have been ignored, but this will break anyone that attempts to implement their own compiler.

Moreover, at the moment it seems that the only place the lang variable is used is to choose the compiler to use, but it's identical whether lang is c or c++.

Since we're only patching the UnixCompiler, would it not be possible to move the "lang = self.detect_language(sources)" inside the unixcompiler?  If it's subclassed, then detect_language should still be a valid call, and would save us a lot of patching other _working_ packages...
Comment 13 Ryan Hill (RETIRED) gentoo-dev 2008-09-14 18:14:22 UTC
i'd just like to go on record as finding this whole thing kind of icky.  if it's not going upstream then we should seriously question whether we should be doing it at all.
Comment 14 Mike Auty (RETIRED) gentoo-dev 2008-10-21 22:18:24 UTC
I'd also like to note that 2.8.9.1 and 2.8.9.1-r1 also both fail for exactly the same reason (on python-2.6).  Also, bug 240690 seems to be a duplicate and suggests that 2.8.8.1 fails (I don't know if it's been patched since I last tried it).

Python guys, any chance you could make a decision one way or another, so we can figure out whether to remove the offending patch from python, or keep it and fix wxpython?  It's a shame to have this hampering install for the past three versions of wxwidgets?
Comment 15 Ryan Hill (RETIRED) gentoo-dev 2008-10-21 23:24:20 UTC
*** Bug 240690 has been marked as a duplicate of this bug. ***
Comment 16 Wormo (RETIRED) gentoo-dev 2008-10-25 07:25:19 UTC
*** Bug 243796 has been marked as a duplicate of this bug. ***
Comment 17 Jesus Rivero (RETIRED) gentoo-dev 2008-11-17 21:51:48 UTC
Hello, 

   First of all, sorry for the delay on this one. 

   Here's the deal, the patch is really necessary for distutils to correctly use gentoo's cxxflags, so no icky things on this. The fact was that a proper patch was added to python-2.5.2-r3 and python-2.4.4-r12 that fixed the issue when UnixCCompiler was overridden and not properly reflected on this bug. That was the main cause why trying to get the error was difficult. However, the patch got lost with the version bump for python-2.6. 

   dev-lang/python-2.6-r5 addresses this issue, re-adds lost patch to patchset and fixes the issue with packages overriding stuff from disutils' compilers. 

  Best regards, 

PS: Closing this bug, please re-open as needed