classification
Title: setup.py fails to find headers of system libffi
Type: compile error Stage: patch review
Components: Build Versions: Python 3.0, Python 3.1, Python 3.2, Python 2.7, Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: loewis Nosy List: Arfrever, benjamin.peterson, doko, georg.brandl, loewis
Priority: normal Keywords: easy, patch

Created on 2009-09-19 03:18 by Arfrever, last changed 2010-03-09 21:47 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
python-fix_search_for_libffi_headers.patch Arfrever, 2009-09-19 03:18 Fix for search for libffi headers
python-fix_search_for_libffi_headers.patch Arfrever, 2009-09-19 15:08 Updated fix for search for libffi header
python-fix_search_for_libffi_headers.patch Arfrever, 2010-01-01 02:56 Updated fix for search for libffi headers
python-pkg-config_detection.patch Arfrever, 2010-03-09 18:08 Fix output of configure
Messages (8)
msg92856 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2009-09-19 03:18
I use --with-system-ffi option, but setup.py fails to find headers of
system libffi which are placed outside standard include directory,
which causes using of internal copy of libffi.

In Gentoo, headers of libffi-3.0.8 are installed into
/usr/lib/libffi-3.0.8/include directory, because their content is
specific to given architecture.

I'm attaching the patch which cause using of `pkg-config libffi --
(Unfortunately subprocess module cannot be used in setup.py, so I'm
using os.popen().)
msg92857 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2009-09-19 03:21
It seems that a part of my comment has been truncated.
I meant `pkg-config libffi --cflags` command.
msg92861 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-09-19 07:43
Patch looks OK and works on my system (the listcomp should be wrapped
though).
msg97111 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2010-01-01 02:56
The previous patches don't work with Python 3, in which os.popen()
internally uses subprocess.Popen(), and also don't work during
crosscompilation, so I'm attaching the new patch.
msg97116 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-01-01 15:16
Fixed in r77212.
msg97869 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2010-01-16 10:49
this patch looks wrong, as it only works with libffi >= 3.0 (the standalone libffi releases, which introduces the pkg-config stuff).
msg100737 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2010-03-09 18:08
I noticed suboptimal output of `configure`:
checking for --with-libs... no
checking for --with-system-expat... yes
checking for --with-system-ffi... checking for x86_64-pc-linux-gnu-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
yes
checking for --with-dbmliborder... gdbm

The attached patch fixes this problem.
msg100761 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-03-09 21:47
Applied in r78819.
History
Date User Action Args
2010-03-09 21:47:13benjamin.petersonsetmessages: + msg100761
2010-03-09 18:08:01Arfreversetfiles: + python-pkg-config_detection.patch

messages: + msg100737
2010-01-16 10:49:34dokosetnosy: + doko
messages: + msg97869
2010-01-01 15:16:51benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg97116

resolution: fixed
2010-01-01 02:56:58Arfreversetfiles: + python-fix_search_for_libffi_headers.patch

messages: + msg97111
2009-09-19 15:08:33Arfreversetfiles: + python-fix_search_for_libffi_headers.patch
2009-09-19 07:43:27georg.brandlsetpriority: normal

type: compile error
assignee: loewis

keywords: + easy
nosy: + georg.brandl
messages: + msg92861
stage: patch review
2009-09-19 03:21:29Arfreversetmessages: + msg92857
2009-09-19 03:18:41Arfrevercreate