Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 321051 - python-2.6.5 fails to build on AIX-5.2 unless applying the new patch
Summary: python-2.6.5 fails to build on AIX-5.2 unless applying the new patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: PPC AIX
: High major (vote)
Assignee: Gentoo Prefix
URL: http://bugs.python.org/issue3876
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-22 14:15 UTC by Benda Xu
Modified: 2010-06-11 20:35 UTC (History)
0 users

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


Attachments
build log (build.log,130.96 KB, text/plain)
2010-05-22 14:18 UTC, Benda Xu
Details
the patch (python-2.6-aix-multiprocessing.patch,1.29 KB, patch)
2010-05-23 11:00 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2010-05-22 14:15:46 UTC
_multiprocessing fails to build because AIX-5.2 does not support sem_timedwait call.

A work around is possible from python bugzilla.

Reproducible: Always

Steps to Reproduce:
1. emerge -1ua dev-lang/python:2.6


Actual Results:  
_multiprocessing module fails

Expected Results:  
successfully compile

emerge --info output


Portage 2.2.00.15842-prefix (prefix/aix/5.2.0.0/ppc, gcc-4.2.4, unavailable, 2 00393D2D4C00)
=================================================================
System uname: AIX-2-00393D2D4C00-32bit
Timestamp of tree: Sat, 22 May 2010 12:38:11 +0000
app-shells/bash:     4.0_p37
dev-lang/python:     2.6.4-r1
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.4_p6-r1, 1.5-r1, 1.6.3-r1, 1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.2-r00.1, 1.11.1
sys-devel/gcc:       4.2.4-r01.2, 4.4.3
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:   2.2.6b
ACCEPT_KEYWORDS="~ppc-aix"
ACCEPT_LICENSE="* -@EULA"
CBUILD="powerpc-ibm-aix5.2.0.0"
CFLAGS="-O2"
CHOST="powerpc-ibm-aix5.2.0.0"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2"
DISTDIR="/home/k/benda/local/usr/portage/distfiles"
FEATURES="assume-digests collision-protect distlocks fixpackages news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C"
LDFLAGS=""
MAKEOPTS="-j16"
PKGDIR="/home/k/benda/local/usr/portage/packages"
PORTAGE_CONFIGROOT="/home/k/benda/local/"
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="/home/k/benda/local/var/tmp"
PORTDIR="/home/k/benda/local/usr/portage"
PORTDIR_OVERLAY="/home/k/benda/local/usr/local/portage"
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="cracklib cxx modules ncurses nls ppc-aix prefix readline ssl unicode zlib" 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 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="AIX" INPUT_DEVICES="keyboard mouse" KERNEL="AIX" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Benda Xu gentoo-dev 2010-05-22 14:18:47 UTC
Created attachment 232469 [details]
build log
Comment 2 Benda Xu gentoo-dev 2010-05-22 14:21:43 UTC
$ emerge -pqv =dev-lang/python-2.6.5-r2
 [ebuild     U ] dev-lang/python-2.6.5-r2 [2.6.4-r1] USE="ncurses readline ssl*
threads (wide-unicode) xml (-aqua) (-berkdb) -build -doc -examples -gdbm -ipv6
-sqlite -tk -wininst" 
Comment 3 Benda Xu gentoo-dev 2010-05-23 02:04:00 UTC
--- /home/k/benda/local/usr/portage/dev-lang/python/python-2.6.5-r2.ebuild      2010-05-02 21:01:47 +0900
+++ python-2.6.5-r2.ebuild      2010-05-22 23:33:16 +0900
@@ -147,6 +147,8 @@
        epatch "${FILESDIR}"/${PN}-2.6-irix-libpython2.6.patch
        # AIX sometimes keeps ".nfsXXX" files around: ignore them in distutils
        epatch "${FILESDIR}"/${PN}-2.5.1-distutils-aixnfs.patch
+       # AIX 5.2 does not support sem_timedwait for multiprocessing module
+       epatch "${FILESDIR}"/${PN}-2.6-aix-multiprocessing.patch
        # this fails to compile on OpenSolaris at least, do we need it?
        epatch "${FILESDIR}"/${PN}-2.6.2-no-sunaudiodev.patch
        # 64-bits Solaris 8-10 have a missing libcrypt symlink


$ cat python-2.6-aix-multiprocessing.patch 


diff -Naur Python-2.6/Modules/_multiprocessing/multiprocessing.c Python-2.6-clean-patch/Modules/_multiprocessing/multiprocessing.c
--- Python-2.6/Modules/_multiprocessing/multiprocessing.c       2008-06-14 00:38:33.000000000 +0200
+++ Python-2.6-clean-patch/Modules/_multiprocessing/multiprocessing.c   2008-10-07 12:23:55.000000000 +0200
@@ -8,6 +8,13 @@
 
 #include "multiprocessing.h"
 
+#ifndef CMSG_SPACE
+#define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
+#endif
+#ifndef CMSG_LEN
+#define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+#endif
+
 PyObject *create_win32_namespace(void);
 
 PyObject *pickle_dumps, *pickle_loads, *pickle_protocol;
diff -Naur Python-2.6/setup.py Python-2.6-clean-patch/setup.py
--- Python-2.6/setup.py 2008-09-30 02:15:45.000000000 +0200
+++ Python-2.6-clean-patch/setup.py     2008-10-07 12:23:34.000000000 +0200
@@ -1277,6 +1277,14 @@
                 )
             libraries = []
 
+        elif platform.startswith('aix'):
+            macros = dict(
+                HAVE_SEM_OPEN=1,
+                HAVE_SEM_TIMEDWAIT=0,
+                HAVE_FD_TRANSFER=1
+                )
+            libraries = ['rt']
+
         else:                                   # Linux and other unices
             macros = dict(
                 HAVE_SEM_OPEN=1,

Comment 4 Fabian Groffen gentoo-dev 2010-05-23 09:39:46 UTC
can you please attach the patch, then I can easily add it to the tree
Comment 5 Benda Xu gentoo-dev 2010-05-23 10:45:51 UTC
(In reply to comment #4)
> can you please attach the patch, then I can easily add it to the tree
> 

Hi  Fabian, thank you for the explanation.

The patch is included in "Comment  #3" just above you. Do I have to make it as an attachment?
Comment 6 Fabian Groffen gentoo-dev 2010-05-23 10:48:10 UTC
yes, otherwise I have to cut and paste, and that doesn't retain whitespace correctly in all cases, which then causes patch failures all over, while it could be as simple as just downloading an attachment :)
Comment 7 Benda Xu gentoo-dev 2010-05-23 11:00:15 UTC
Created attachment 232557 [details, diff]
the patch
Comment 8 Benda Xu gentoo-dev 2010-05-23 11:01:08 UTC
(In reply to comment #6)
> yes, otherwise I have to cut and paste, and that doesn't retain whitespace
> correctly in all cases, which then causes patch failures all over, while it
> could be as simple as just downloading an attachment :)
> 

ok, done. plz check :)
Comment 9 Fabian Groffen gentoo-dev 2010-06-11 20:35:45 UTC
ok, thanks.

In the future, please if you grab a patch from somewhere else, just add a reference to that place in your patch.  In this case "http://bugs.python.org/issue3876".

I added the patch to the 2.6.5 ebuild.