classification
Title: Python3.2rc3 fails to build on Mac OS X with a non-framework build
Type: Stage: resolved
Components: Build, macOS Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ned.deily Nosy List: georg.brandl, jszakmeister, ned.deily, pitrou, ronaldoussoren, sdaoden, vstinner
Priority: critical Keywords: patch

Created on 2011-02-16 10:54 by jszakmeister, last changed 2011-02-25 10:44 by ned.deily. This issue is now closed.

Files
File name Uploaded Description Edit
Makefile jszakmeister, 2011-02-16 11:36
darwin_ldlibrary.patch vstinner, 2011-02-16 11:46
make-install-output.txt jszakmeister, 2011-02-17 09:21
issue11222_osx_shared_build.patch ned.deily, 2011-02-17 20:00 minimal patch to fix OS X shared library build error
Messages (24)
msg128647 - (view) Author: John Szakmeister (jszakmeister) * Date: 2011-02-16 10:54
I configured the build:
    ./configure --with-system-ffi --enable-shared --with-computed-gotos --prefix=$HOME/.local/python3 

Ran make with 4 jobs (make -j4), and got:
    make: *** No rule to make target `libpython3.2m.dylib', needed by `python.exe'.  Stop.
    make: *** Waiting for unfinished jobs....

It seems there might be a $(VERSION)/$(LDVERSION) problem somewhere in the Makefile, but I'm uncertain where the issue is exactly.  Looks like using --enable-framework instead of --enable-shared works, but I'd rather not have the framework right now.
msg128648 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-02-16 11:01
I have not tried 3.2 yet, but Issue 11046 may be of interest for you!
Try the undocumented:

configure ...[other args]... MACOSX_DEPLOYMENT_TARGET=10.5

in the meanwhile - it may help you out.
msg128650 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-02-16 11:01
Can you please attach your Makefile file?

In Makefile.pre.in, I see:

libpython$(VERSION).dylib: $(LIBRARY_OBJS)

VERSION should be 3.2, only LDVERSION is the VERSION + the ABI flags (eg. 3.2dm). And I don't see any usage of libpython$(LDVERSION).dylib in Makefile(.pre.in).

(You might also try "make SHELL='bash -x'" or "make -d" to get more information)
msg128653 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-02-16 11:05
Ah, there is also Mac/Makefile.in: attach also Mac/Makefile.

(and there is also Mac/PythonLauncher/Makefile.in, but I don't think that the issue comes from this file)

((can it be related to python*-config program?))
msg128654 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-02-16 11:06
@Georg: Is this issue a release blocker?
msg128655 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-02-16 11:07
Ooops.  In fact 3.2 did well with that undocumented thing either.
msg128656 - (view) Author: John Szakmeister (jszakmeister) * Date: 2011-02-16 11:36
Here is the top-level Makefile.
msg128657 - (view) Author: John Szakmeister (jszakmeister) * Date: 2011-02-16 11:38
Interesting.  I don't see a Mac/Makefile.  Perhaps it's only pulled in with the framework build?
msg128658 - (view) Author: John Szakmeister (jszakmeister) * Date: 2011-02-16 11:41
MACOSX_DEPLOYMENT_TARGET=10.5 made no bit of difference for me.  Steffen, I take it that it didn't help you either?  You said "did well", but the rest of your text indicates otherwise. :-)
msg128659 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-02-16 11:46
Ah ok, the issue comes from configure.in near line 779:

    Darwin*)
    	LDLIBRARY='libpython$(LDVERSION).dylib'
	BLDLIBRARY='-L. -lpython$(LDVERSION)'
	RUNSHARED='DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}'
	;;

The problem is that configure.in uses libpython$(LDVERSION).dylib, whereas Makefile.pre.in uses libpython$(VERSION).dylib. Attached patch changes Makefile.pre.in to use libpython$(LDVERSION).dylib.

I don't know if this change is correct or not. I don't know if the options for the compilation in framework mode should be changed too. I don't know what is the Mac framework :-)

See also http://www.python.org/dev/peps/pep-3149/ (ABI version tagged .so files)
msg128663 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-02-16 11:59
Aeh, your patch does it.
You may be interested of all Mac OS X compilation notes??

/usr/bin/ranlib: file: libpython3.2m.a(dynamic_annotations.o) has no symbols
/usr/bin/ranlib: file: libpython3.2m.a(pymath.o) has no symbols
ranlib libpython3.2m.a
ranlib: file: libpython3.2m.a(dynamic_annotations.o) has no symbols
ranlib: file: libpython3.2m.a(pymath.o) has no symbols
/usr/bin/gcc   -framework CoreFoundation -o python.exe Modules/python.o libpython3.2m.a -ldl  -framework CoreFoundation     
building dbm using ndbm
ld: warning: directory '/usr/lib/termcap' following -L not found
In file included from /System/Library/Frameworks/Tk.framework/Headers/tk.h:78,
                 from /Users/steffen/arena/code.extern.repos/py3k.hg/Modules/_tkinter.c:67:
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:MULTIPLE: warning: function declaration isn’t a prototype
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because linking not done
In file included from /System/Library/Frameworks/Tk.framework/Headers/tk.h:78,
                 from /Users/steffen/arena/code.extern.repos/py3k.hg/Modules/tkappinit.c:17:
/System/Library/Frameworks/Tk.framework/Headers/X11/Xlib.h:MULTIPLE: warning: function declaration isn’t a prototype
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because linking not done
/Users/steffen/arena/code.extern.repos/py3k.hg/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c:49: warning: function declaration isn’t a prototype
/Users/steffen/arena/code.extern.repos/py3k.hg/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c:379: warning: function declaration isn’t a prototype
msg128706 - (view) Author: John Szakmeister (jszakmeister) * Date: 2011-02-17 00:53
The patch definitely helps.  However, once I get it installed, there seems to be no time module:
   >>> import time
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   ImportError: No module named time

So I think there's probably still something not quite right.
msg128707 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-02-17 01:03
"import time" works for me with the patched build.  There should have been a warning message during the build if the time module failed to build.  Perhaps you have a file permissions problem?  Check your lib/python3.2/lib-dynload/ for file time.so 

BTW, Victor's supplied patch is fine for fixing the shared lib target but should not include the framework build changes - that's an unrelated issue.  I will upload a revised patch for review after completing some more tests.  This should be included in 3.2final. And we have a hole in building and testing shared library configurations on OS X, even though that configuration isn't used as much as the OS X framework one.
msg128708 - (view) Author: John Szakmeister (jszakmeister) * Date: 2011-02-17 01:47
Looks like the time module is being built:
    ./build/lib.macosx-10.4-x86_64-3.2/time.so

But none of the shared modules are being installed, as lib/python3.2/lib-dynload is completely empty.
msg128712 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-02-17 08:18
You did run "sudo make install"?
msg128713 - (view) Author: John Szakmeister (jszakmeister) * Date: 2011-02-17 08:36
I'm installing into an area that I own ($HOME/.local/python3), so no need for sudo.  I just ran make install.
msg128714 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2011-02-17 09:07
'make install' works for me as well (OSX 10.6, configure --prefix=/tmp/python32).

Could you attach the output of "make install", with some luck there will be a clear indication of why the install doesn't work on your machine.
msg128716 - (view) Author: John Szakmeister (jszakmeister) * Date: 2011-02-17 09:21
Attached the output.
msg128717 - (view) Author: John Szakmeister (jszakmeister) * Date: 2011-02-17 09:32
This one is my fault.  I have a .pydistutils.cfg that was causing them to be installed somewhere else or not at all. :-(  Moving my custom config out of the way, I'm good.  I'm not sure what's happening there, but that's a different problem. :-)
msg128749 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-02-17 20:00
Here's a minimal patch (a subset of Victor's original) that fixes the release blocker issue.  It has been tested in both a shared library build (which now works) and a framework build (which is not affected as expected).  I recommend that it be applied before 3.2final.
msg128759 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-02-17 21:41
Looks good to me. I guess it needs Georg's approval, though.
msg128835 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-02-19 08:53
Committed as r88439 in py3k.
msg129347 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-02-25 10:23
Does this need to be backported?
msg129349 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-02-25 10:44
No backport is needed. The problem was introduced during the 3.2 development cycle by the ABI Version Tagged .so Files feature (PEP 3149).
History
Date User Action Args
2011-02-25 10:44:41ned.deilysetnosy: georg.brandl, ronaldoussoren, pitrou, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg129349
2011-02-25 10:23:39georg.brandlsetnosy: georg.brandl, ronaldoussoren, pitrou, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg129347
2011-02-19 09:16:28ned.deilysetstatus: open -> closed
nosy: georg.brandl, ronaldoussoren, pitrou, vstinner, jszakmeister, ned.deily, sdaoden
resolution: fixed
stage: commit review -> resolved
2011-02-19 08:53:54georg.brandlsetpriority: release blocker -> critical
nosy: georg.brandl, ronaldoussoren, pitrou, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128835
2011-02-17 21:41:37pitrousetnosy: + pitrou
messages: + msg128759
2011-02-17 20:00:52ned.deilysetfiles: + issue11222_osx_shared_build.patch
nosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128749

components: + macOS
stage: commit review
2011-02-17 09:32:34jszakmeistersetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128717
2011-02-17 09:21:27jszakmeistersetfiles: + make-install-output.txt
nosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128716
2011-02-17 09:07:07ronaldoussorensetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128714
2011-02-17 08:36:13jszakmeistersetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128713
2011-02-17 08:18:01ned.deilysetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128712
2011-02-17 01:47:02jszakmeistersetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128708
2011-02-17 01:03:13ned.deilysetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128707
2011-02-17 00:53:55jszakmeistersetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128706
2011-02-16 17:42:10georg.brandlsetpriority: normal -> release blocker
nosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
2011-02-16 16:48:07ned.deilysetassignee: ned.deily
nosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
2011-02-16 11:59:25sdaodensetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128663
2011-02-16 11:46:49vstinnersetfiles: + darwin_ldlibrary.patch

messages: + msg128659
keywords: + patch
nosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
2011-02-16 11:41:15jszakmeistersetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128658
2011-02-16 11:38:17jszakmeistersetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128657
2011-02-16 11:36:52jszakmeistersetfiles: + Makefile
nosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, ned.deily, sdaoden
messages: + msg128656
2011-02-16 11:18:57pitrousetnosy: + ned.deily
2011-02-16 11:07:04sdaodensetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, sdaoden
messages: + msg128655
2011-02-16 11:06:01vstinnersetnosy: georg.brandl, ronaldoussoren, vstinner, jszakmeister, sdaoden
messages: + msg128654
2011-02-16 11:05:42vstinnersetnosy: + georg.brandl
2011-02-16 11:05:17vstinnersetnosy: ronaldoussoren, vstinner, jszakmeister, sdaoden
messages: + msg128653
2011-02-16 11:01:55vstinnersetnosy: + vstinner
messages: + msg128650
2011-02-16 11:01:25sdaodensetnosy: + ronaldoussoren, sdaoden
messages: + msg128648
2011-02-16 10:54:06jszakmeistercreate