Bug 666297 - python3-cairo contains (buggy) embedded copy of waf
Summary: python3-cairo contains (buggy) embedded copy of waf
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python3-cairo
Version: rawhide
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: ---
Assignee: John (J5) Palmieri
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-30 02:05 UTC by Dave Malcolm
Modified: 2013-03-13 04:51 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-02-10 21:34:08 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
use python-config to find name of python lib (1.95 KB, patch)
2011-01-30 16:14 UTC, Karsten Hopp
no flags Details | Diff
Log of waf build from git (6.12 KB, text/plain)
2011-02-10 19:47 UTC, John (J5) Palmieri
no flags Details
Work in progress patch to specfile (735 bytes, patch)
2011-02-10 20:03 UTC, Dave Malcolm
no flags Details | Diff

Description Dave Malcolm 2010-12-30 02:05:54 UTC
Description of problem:
waf is in Fedora:
  https://admin.fedoraproject.org/pkgdb/acls/name/waf

but python3-cairo contains an embedded copy:

$ less pycairo-1.8.10.tar.bz2 | grep waf
-rwxr-x--- dev/user      92546 2010-09-11 03:14 pycairo-1.8.10/waf


Presumably we should remove the embedded "waf" during %prep and use a shared version.

Note that the embedded copy appears to be buggy: I'm attempting to recompile python3-cairo against the latest python3 in rawhide (3.2b2) for the PEP 3149 ABI changes, but it's not finding the python headers:


+ python3 ./waf --prefix=/usr --libdir=/usr/lib64 configure
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for gcc                         : ok  
Checking for program python              : /usr/bin/python3 
Checking for Python version >= 3.1.0     : ok 3.2.0 
Checking for library python3.2           : not found 
Checking for library python3.2           : not found 
Checking for library python32            : not found 
Checking for program python3.2-config    : /usr/bin/python3.2-config 
Checking for custom code                 : Could not find the python development headers 
/home/david/dist-git/python3-cairo/master/pycairo-1.8.10/wscript:37: error: the configuration failed (see '/home/david/dist-git/python3-cairo/master/pycairo-1.8.10/build_directory/config.log')
  ./set_options()
  ./init()
  ./configure()

Version-Release number of selected component (if applicable):
1.8.10-9

Comment 1 John (J5) Palmieri 2011-01-04 17:05:00 UTC
We had this debate between shared version and packaged version.  In the end package version was the only thing that worked.  From my sketchy recollection, the system version did not support Python 3 or have all of the plugins needed.  Btw, if the headers can not be found I would think this is an issue with /usr/bin/python3.2-config.  In any case can you track down why the headers are not being found before we take any actions?  If the system waf works, I would say it is fine to use that.

Comment 2 Karsten Hopp 2011-01-21 19:06:40 UTC
waf tries to build a test-binary with linker flags
-lpython3.2
-lpython3.2   and
-lpython32

The latest python3 has renamed the libs to libpython3.2mu.so, so this will fail:

[1/2] cc: build_directory/.conf_check_0/test.c -> build_directory/.conf_check_0/testbuild/default/test_1.o
'/usr/bin/gcc', '../test.c', '-c', '-o', 'default/test_1.o']
[2/2] cc_link: build_directory/.conf_check_0/testbuild/default/test_1.o -> build_directory/.conf_check_0/testbuild/default/testprog
/usr/bin/ld: cannot find -lpython3.2
collect2: ld returned 1 exit status
['/usr/bin/gcc', 'default/test_1.o', '-o', '/builddir/build/BUILD/pycairo-1.8.10/build_directory/.conf_check_0/testbuild/default/testprog', '-L/usr/lib64', '-Wl,-Bdynamic', '-lpython3.2', '-lm', '-lpthread', '-ldl', '-lutil']
command returned 'Build failed:  -> task failed (err #1): \n\t{task: cc_link test_1.o -> testprog}'not found


https://bugzilla.redhat.com/show_bug.cgi?id=670478 shows a similar problem and has a pointer to the reason for the name change, the proper fix is the same: use pkg-config or python3.2-config --libs instead of trying to figure out the paths on your own.
> pkg-config --libs python3
-lpython3.2mu  

> python3.2-config --libs
-lpthread -ldl -lutil -lm -lpython3.2mu

The same problem will probably show up with the include directory, it got moved to /usr/include/python3.2mu:
> pkg-config --cflags-only-I python3
-I/usr/include/python3.2mu
> python3.2-config --include
-I/usr/include/python3.2mu -I/usr/include/python3.2mu

Comment 3 Karsten Hopp 2011-01-30 16:14:25 UTC
Created attachment 476051 [details]
use python-config to find name of python lib

something like this will work, but applying it to the embedded copy of waf will require to unpack that first

Comment 4 John (J5) Palmieri 2011-02-10 19:12:44 UTC
Ah, after updating to rawhide I now understand the issue.  How would we go about applying this?  e.g. what format is waf packed in?  Can we just patch the system waf and use that?  Upstream pycairo is pretty unresponsive these days.

Comment 5 John (J5) Palmieri 2011-02-10 19:47:02 UTC
Created attachment 478104 [details]
Log of waf build from git

It seems that the git version of pycairo does find the correct directories but doesn't use them when compiling.


python3 waf configure --prefix /home/johnp/devel/gnome/install --libdir /home/johnp/devel/gnome/install/lib64

Comment 6 Dave Malcolm 2011-02-10 20:03:19 UTC
Created attachment 478110 [details]
Work in progress patch to specfile

Here's a possible approach for how to patch waf from the rpm build (assuming a patch to the unpacked waf sources)

Comment 7 Dave Malcolm 2011-02-10 20:52:58 UTC
I've combined my specfile patch from comment #6 and a version of Karsten's patch from comment #3 and it builds locally; I can instantiate objects from the cairo._cairo shared library.

Committed & pushed as:

http://pkgs.fedoraproject.org/gitweb/?p=python3-cairo.git;a=commit;h=c572cc4dd4bb5cca1aba48d7315079fa0f2694de

Building python3-cairo-1.8.10-11.fc16 for dist-rawhide
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=2830881

Comment 8 John (J5) Palmieri 2011-02-10 21:34:08 UTC
built in rawhide and F15 updates-candidates


Note You need to log in before you can comment on or make changes to this bug.