Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#18848 closed defect (fixed)

python26 : no dynamic library built

Reported by: neric27@… Owned by: blb@…
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: python26

Description

python26 doesn't build any shared library (libpython2.6.dylib). Why is it so ? I mark it as defect, as it's required by other ports (samba4).

Change History (14)

comment:1 Changed 16 years ago by mf2k (Frank Schima)

Cc: mcalhoun@… macsforever2000@… erickt@… clubjuggler@… added
Owner: changed from macports-tickets@… to blb@…

comment:2 Changed 16 years ago by mf2k (Frank Schima)

Cc: macsforever2000@… erickt@… clubjuggler@… removed

comment:3 Changed 16 years ago by blb@…

Resolution: fixed
Status: newclosed

Actually the problem was that python26-config isn't providing quite the right answer; fixed in r48182.

comment:4 Changed 16 years ago by neric27@…

Hi, I just tried again to build python26 @2.6.1_1 and guess what ? no libpython2.6.dylib :-(

There is a static version, but it was also there in python 2.6.1_0

$ port installed python26
The following ports are currently installed:
  python26 @2.6.1_0
  python26 @2.6.1_1 (active)


$ port contents python26 | grep libpython
  /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config/libpython2.6.a

$ port contents python26 | grep dylib
  /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/macholib/dylib.py
  /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/macholib/dylib.pyc
  /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/macholib/dylib.pyo

Cheers,

comment:5 in reply to:  4 Changed 16 years ago by blb@…

Replying to neric27@…:

Hi, I just tried again to build python26 @2.6.1_1 and guess what ? no libpython2.6.dylib :-(

Right, there isn't one, but the update fixed what python26-config lists for proper linking flags (eg, what samba4 uses to link to it):

$ python2.6-config --ldflags
-L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -ldl -lpython2.6

Using those flags will get things to link properly.

comment:6 in reply to:  description Changed 16 years ago by neric27@…

Sorry, but it doesn't work (yes I did port clean !).

Here is an excerpt from the configure output :

checking for sys/epoll.h... no
checking for epoll_create... no
checking for swig... no
configure: WARNING: cannot find 'swig' program. You should look at http://www.swig.org
checking for python... /opt/local/bin/python
checking for a version of Python >= '2.1.0'... yes
checking for the distutils Python package... yes
checking for Python include path... -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
checking for Python library path... -L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 -lpython2.6
checking for Python site-packages path... /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
checking python extra libraries...  -ldl
checking python extra linking flags... -u _PyMac_Error  /opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python
checking whether to use pthreads... no
checking whether to search for setproctitle support... no
checking for tv_nsec nanosecond fields in struct stat... 

And here is the error :

Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_net_samba4/work/samba-4.0.0alpha2/source" && make all " returned error 2
Command output: Creating bin/ldb_repl_meta_data_init_module.c
Compiling bin/ldb_repl_meta_data_init_module.c
Linking bin/modules/ldb/repl_meta_data.dylib
Compiling dsdb/samdb/ldb_modules/kludge_acl.c
dsdb/samdb/ldb_modules/kludge_acl.c: In function 'kludge_acl_search':
dsdb/samdb/ldb_modules/kludge_acl.c:328: warning: assignment discards qualifiers from pointer target type
dsdb/samdb/ldb_modules/kludge_acl.c:367: warning: passing argument 1 of 'ldb_parse_tree_attr_replace' discards qualifiers from pointer target type
Creating bin/ldb_kludge_acl_init_module.c
Compiling bin/ldb_kludge_acl_init_module.c
Linking bin/modules/ldb/kludge_acl.dylib
Compiling dsdb/samdb/ldb_modules/local_password.c
Creating bin/ldb_local_password_init_module.c
Compiling bin/ldb_local_password_init_module.c
Linking bin/modules/ldb/local_password.dylib
Compiling dsdb/samdb/ldb_modules/schema.c
dsdb/samdb/ldb_modules/schema.c: In function 'schema_check_attributes_syntax':
dsdb/samdb/ldb_modules/schema.c:936: warning: assignment discards qualifiers from pointer target type
Compiling dsdb/samdb/ldb_modules/schema_syntax.c
Creating bin/ldb_schema_init_module.c
Compiling bin/ldb_schema_init_module.c
Linking bin/modules/ldb/schema.dylib
Compiling libcli/security/security_wrap.c
libcli/security/security_wrap.c: In function '_wrap_security_descriptor_dacl_del':
libcli/security/security_wrap.c:3203: warning: passing argument 2 of 'security_descriptor_dacl_del' from incompatible pointer type
libcli/security/security_wrap.c: In function '_wrap_security_descriptor_sacl_del':
libcli/security/security_wrap.c:3244: warning: passing argument 2 of 'security_descriptor_sacl_del' from incompatible pointer type
Linking bin/python/_security.dylib
/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: can't locate file for: -lpython2.6
collect2: ld returned 1 exit status
make: *** [bin/python/_security.dylib] Error 1

Warning: the following items did not execute (for samba4): org.macports.activate org.macports.build org.macports.destroot org.macports.archive org.macports.install
Error: Status 1 encountered during processing.

comment:7 Changed 16 years ago by blb@…

That may be a samba4 issue; I tried updating to alpha7 and it fails someplace else entirely, unrelated to python...also note that samba4 doesn't have any python ports as dependencies so that may be another issue with it.

comment:8 Changed 16 years ago by neric27@…

Please, can you make a clear statement about why no dynamic library is built ?

comment:9 in reply to:  8 Changed 16 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to neric27@…:

Please, can you make a clear statement about why no dynamic library is built ?

A dynamic library is being built, but it is not installed in the way samba4 expects.

As has been previously indicated, dynamic libraries can be installed in the form libXYZ.dylib.
They are linked in with

gcc ... -L... -lXYZ

python26 installs as a Framework.
It is inteded to be linked in as

gcc ... -F... -framework Python

Although this is only possible if python_select is installed.

To be sure to link in the correct library, you simply have to give the full path

gcc  ... ${frameworks_dir}/Python.framework/Versions/2.6/Python

${frameworks_dir}/Python.framework/Versions/2.6/Python
is the dynamic library, just with the Framework naming convention.

You can ask python how to link in the library, and it would give the correct answer.
samba4, unfortunately, does not ask python.
It simply assumes the -L .. -lxxx structure.
This is why the earlier post suggested that it was a samba4 problem.

comment:10 Changed 16 years ago by blb@…

Note that you can also use the -L... -l... method, if you use what python2.6-config tells you (which is what was fixed in r48182):

$ python2.6-config --ldflags
-L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config -ldl -lpython2.6

which, when all is said and done, ends up causing whatever was being built to be linked against the framework.

Note that my attempt at building samba4 alpha7 appeared to respect what python2.6-config said, but I'm not sure how well since it didn't get to the parts using python before it failed.

comment:11 Changed 16 years ago by neric27@…

OK, thanks you very much for the information : I would never have guessed that Python was in fact the library !

Anyway, by feeding directly the output of python2.6-config --ldflags to the configure script, I was able to build samba4@4.0.0alpha2_0. I'll file a ticket against samba4.

Thanks again for your time ;-)

comment:12 Changed 16 years ago by raimue (Rainer Müller)

Why don't we provide symlinks /opt/local/include/python2.6 and /opt/local/lib/libpython2.6.dylib? Apple's system version also ships as a framework but still has these symlinks.

comment:13 Changed 16 years ago by blb@…

I suppose we could to help those ports which don't properly query python for how to link...building the framework definitely causes odd things (eg, libpython2.6.a being symlinked to the framework binary), so links for include and the dylib wouldn't be all that strange.

comment:14 Changed 16 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.