Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 233600 - dev-python/sip-4.7.6 fails to build on MacOS 10.4/prefix - needs Python to be built as a framework
Summary: dev-python/sip-4.7.6 fails to build on MacOS 10.4/prefix - needs Python to be...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Other (show other bugs)
Hardware: x86 OS X
: High major
Assignee: Gentoo non-Linux Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-01 14:27 UTC by Gregor G.
Modified: 2008-08-02 21:42 UTC (History)
0 users

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


Attachments
Added ${EPREFIX} (sip-4.7.6.diff,344 bytes, patch)
2008-08-01 14:31 UTC, Gregor G.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gregor G. 2008-08-01 14:27:16 UTC
Configure fails with Error "Error: SIP requires Python to be built as a framework"

Reproducible: Always

Steps to Reproduce:
1. ecopy dev-python/sip
2. emerge sip


Actual Results:  
>>> Compiling source in /opt/gentoo/var/tmp/portage/dev-python/sip-4.7.6/work/sip-4.7.6 ...
This is SIP 4.7.6 for Python 2.5.2 on darwin.
The SIP code generator will be installed in /usr/bin.
The SIP module will be installed in /usr/lib/python2.5/site-packages.
The SIP header file will be installed in /usr/include/python2.5.
The default directory to install .sip files in is /usr/share/sip.
The platform/compiler configuration is macx-g++.
Creating sipconfig.py...
Creating top level Makefile...
Creating sip code generator Makefile...
Creating sip module Makefile...
Error: SIP requires Python to be built as a framework
 * ERROR: dev-python/sip-4.7.6 failed:
 *   configure failed
 * Call stack:
 *               ebuild.sh:  49: <call src_compile>
 *             environment:1228:     "${python}" configure.py -b "/usr/bin" -d "/usr/$(get_libdir)/python${PYVER}/site-packages" -e "/usr/include/python${PYVER}" -v "/usr/share/sip" ${myconf} CXXFLAGS_RELEASE="" CFLAGS_RELEASE="" LFLAGS_RELEASE="" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LFLAGS="${LDFLAGS}" CC=$(tc-getCC) CXX=$(tc-getCXX) LINK=$(tc-getCXX) LINK_SHLIB=$(tc-getCXX) STRIP="true" || die "configure failed";


Expected Results:  
sip should build

Since SIP would install in /usr/bin etc. i tried adding ${EPREFIX} to the ebuild, but to no avail:

>>> Compiling source in /opt/gentoo/var/tmp/portage/dev-python/sip-4.7.6/work/sip-4.7.6 ...
This is SIP 4.7.6 for Python 2.5.2 on darwin.
The SIP code generator will be installed in /opt/gentoo/usr/bin.
The SIP module will be installed in
/opt/gentoo/usr/lib/python2.5/site-packages.
The SIP header file will be installed in /opt/gentoo/usr/include/python2.5.
The default directory to install .sip files in is /opt/gentoo/usr/share/sip.
The platform/compiler configuration is macx-g++.
Creating sipconfig.py...
Creating top level Makefile...
Creating sip code generator Makefile...
Creating sip module Makefile...
Error: SIP requires Python to be built as a framework
 * ERROR: dev-python/sip-4.7.6 failed:
 *   configure failed
 * Call stack:
 *               ebuild.sh:  49: <call src_compile>
 *             environment:1228:     "${python}" configure.py -b "${EPREFIX}/usr/bin" -d "${EPREFIX}/usr/$(get_libdir)/python${PYVER}/site-packages" -e "${EPREFIX}/usr/include/python${PYVER}" -v "${EPREFIX}/usr/share/sip" ${myconf} CXXFLAGS_RELEASE="" CFLAGS_RELEASE="" LFLAGS_RELEASE="" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LFLAGS="${LDFLAGS}" CC=$(tc-getCC) CXX=$(tc-getCXX) LINK=$(tc-getCXX) LINK_SHLIB=$(tc-getCXX) STRIP="true" || die "configure failed";
Comment 1 Gregor G. 2008-08-01 14:31:51 UTC
Created attachment 161912 [details, diff]
Added ${EPREFIX}
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-08-01 14:46:39 UTC
We don't have this in the tree yet, unless I am going crazy. 

I look at importing it later today if someone doesn't beat me to it.
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-08-01 14:47:25 UTC
(In reply to comment #0)

> Steps to Reproduce:
> 1. ecopy dev-python/sip
> 2. emerge sip

Oh. 
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-08-01 16:37:09 UTC
Added, I don't know if it works but I can "import sip" in python. ;)

I also don't know if "python_mod_compile "${EPREFIX}"/usr/$(get_libdir)/python${pyver}/sip*.py" is needed or not. You didn't have EPREFIX in your patch but it seems wrong to omit it. *shrugs* 

Thanks.
Comment 5 Gregor G. 2008-08-01 21:48:07 UTC
(In reply to comment #4)
> I also don't know if "python_mod_compile
> "${EPREFIX}"/usr/$(get_libdir)/python${pyver}/sip*.py" is needed or not. You
> didn't have EPREFIX in your patch but it seems wrong to omit it.

Oh, i missed that.

But the problem still stands (after i sync´d and removed the package from the overlay; same error), maybe something´s wrong on my side? I have Python installed with the following flags:

[ebuild   R   ] dev-lang/python-2.5.2-r5  USE="ncurses readline ssl threads -berkdb -bootstrap -build -doc -examples -gdbm -ipv6 -sqlite -tk -ucs2 -wininst" 0 kB

This is emerge --info:

Portage 2.2.00.11287-prefix (default-prefix/darwin/macos/10.4/x86, gcc-4.0.1, unavailable, 8.11.1 i386)
=================================================================
System uname: Darwin-8.11.1-i386-32bit
Timestamp of tree: Fri, 01 Aug 2008 21:21:31 +0000
distcc 2.18.4-Apple.1 powerpc-apple-darwin8.0 (protocols 1 and 2) (default port 3632) [disabled]
app-shells/bash:     3.2_p39
dev-lang/python:     2.5.2-r5
sys-devel/autoconf:  2.61-r2
sys-devel/automake:  1.10.1-r1
sys-devel/gcc-config: 1.4.0-r04.5
sys-devel/libtool:   1.5.26
ACCEPT_KEYWORDS="~x86-macos"
CBUILD="i686-apple-darwin8"
CFLAGS="-O2 -pipe -march=prescott"
CHOST="i686-apple-darwin8"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=prescott"
DISTDIR="/opt/gentoo/usr/portage/distfiles"
EPREFIX="/opt/gentoo"
FEATURES="collision-protect distlocks nostrip parallel-fetch preserve-libs sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS=""
PKGDIR="/opt/gentoo/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="/opt/gentoo/var/tmp"
PORTDIR="/opt/gentoo/usr/portage"
PORTDIR_OVERLAY="/opt/gentoo/usr/local/portage"
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="aqua coreaudio cracklib midi mmx mmxext ncurses nls objc objc++ prefix readline sse sse2 ssl unicode x86-macos zlib" 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="Darwin" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Thank you
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-08-02 06:26:22 UTC
The problem still stands? What is the problem? 

Worked for me.
Comment 7 Gregor G. 2008-08-02 08:38:34 UTC
Configure still dies: "Error: SIP requires Python to be built as a framework"

Tried rebuilding python with all USE flags on:

[ebuild   R   ] dev-lang/python-2.5.2-r5  USE="berkdb bootstrap build doc examples gdbm ipv6 ncurses readline sqlite ssl threads tk ucs2 wininst" 0 kB

No success, same error. What else can i do to narrow down the problem? 
Comment 8 Fabian Groffen gentoo-dev 2008-08-02 10:20:13 UTC
This is a darwin specific problem.  The package in question is annoying and needs to be patched to just do what it would do on any other unix.
Comment 9 Fabian Groffen gentoo-dev 2008-08-02 15:26:35 UTC
This is a hell of an annoying package (is going to break on any platform we try), so nicely fits the python ideocracy...

Fixed for Darwin/Gentoo now.
Comment 10 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-08-02 16:13:45 UTC
(In reply to comment #9)
> This is a hell of an annoying package (is going to break on any platform we
> try), so nicely fits the python ideocracy...
> 
> Fixed for Darwin/Gentoo now.
> 

Thanks, I was confused because it worked for me.
Comment 11 Gregor G. 2008-08-02 20:35:54 UTC
(In reply to comment #9)
> Fixed for Darwin/Gentoo now.

Hm, it builds now but when i start python and "import sip" i get "Bus error" and pyhton closes?!
Comment 12 Fabian Groffen gentoo-dev 2008-08-02 20:36:44 UTC
ugh... :/
Comment 13 Fabian Groffen gentoo-dev 2008-08-02 20:46:52 UTC
I can't get a useful backtrace, seems debugging symbols are stripped regardless...

#0  0x0059fb90 in PyObject_Call ()
#1  0x00647160 in PyEval_CallObjectWithKeywords ()
#2  0x0060fc98 in mro_internal ()
#3  0x0060d4b4 in PyType_Ready ()
#4  0x00574e38 in initsip ()
#5  0x000d6b4c in _PyImport_LoadDynamicModule ()
#6  0x000d4238 in import_submodule ()
#7  0x000d48ac in load_next ()
#8  0x000d4d2c in import_module_level ()
#9  0x000d4ffc in PyImport_ImportModuleLevel ()
#10 0x000aec48 in builtin___import__ ()
#11 0x00007f98 in PyObject_Call ()
#12 0x000af520 in PyEval_CallObjectWithKeywords ()
#13 0x000b5430 in PyEval_EvalFrameEx ()
#14 0x000b8804 in PyEval_EvalCodeEx ()
#15 0x000b8910 in PyEval_EvalCode ()
#16 0x000e1370 in PyRun_InteractiveOneFlags ()
#17 0x000e15c0 in PyRun_InteractiveLoopFlags ()
#18 0x000e16c0 in PyRun_AnyFileExFlags ()
#19 0x000f1a48 in Py_Main ()
#20 0x00001a9c in _start ()
#21 0x000017a0 in start ()


This doesn't help either:

#4  0x00574e38 in initsip ()
(gdb) l
1       {standard input}: No such file or directory.
        in {standard input}
Comment 14 Fabian Groffen gentoo-dev 2008-08-02 20:58:46 UTC
    fprintf(stderr, "4\n");
    if (PyType_Ready((PyTypeObject *)&sipWrapper_Type) < 0)
        Py_FatalError("sip: Failed to initialise sip.wrapper type");

that is the statement that fails in siplib/siplib.c
Comment 15 Fabian Groffen gentoo-dev 2008-08-02 21:09:34 UTC
Ok, it looks to me as a type-pun, and it's complete voodoo, as they lay PyTypeObject over one of their own structs which has a PyHeapTypeObject, not quite the same.

It's very well possible that alignment of this is not as expected, hence why the type pun is in general not such a good idea.

This code is voodoo, and it looks like crap to me.  I'll mask it, and awelcome any fixes.
Comment 16 Gregor G. 2008-08-02 21:42:17 UTC
Well, thanks for trying!