Bug 666429 - Issue building znc against newest python3: PySlice_GetIndices changed API in 3.2 relative to pycontainer.swg
Summary: Issue building znc against newest python3: PySlice_GetIndices changed API in ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: swig
Version: rawhide
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: ---
Assignee: Adam Tkac
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 665953 675620
TreeView+ depends on / blocked
 
Reported: 2010-12-30 17:28 UTC by Dave Malcolm
Modified: 2013-04-30 23:48 UTC (History)
8 users (show)

Fixed In Version: swig-2.0.2-1.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-03 03:21:17 UTC


Attachments (Terms of Use)

Description Dave Malcolm 2010-12-30 17:28:47 UTC
Description of problem:

python3 changed ABI in rawhide, leading to dependency errors of the form:

I'm attempting to rebuild znc against the latest python3 

However, I run into errors of this form:
Building ZNC python bindings library...
modpython/_znc_core.cpp: In function 'std::list<CString, std::allocator<CString> >* std_list_Sl_CString_Sg____getitem____SWIG_0(std::list<CString, std::allocator<CString> >*, PySliceObject*)':
modpython/_znc_core.cpp:4468:60: error: cannot convert 'PySliceObject*' to 'PyObject*' for argument '1' to 'int PySlice_GetIndices(PyObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)'


This appears to be due to this change in python 3:
http://bugs.python.org/issue10681

I'm not yet sure if this is an issue with znc or with swig.


Version-Release number of selected component (if applicable):
znc-0.097-2.svn2214

Comment 1 Dave Malcolm 2010-12-30 17:36:45 UTC
Looks like the issue is in swig, the code is being injected from:
  /usr/share/swig/2.0.1/python/pycontainer.swg
from
  swig-2.0.1-1.fc15.x86_64

Comment 2 Adam Tkac 2011-01-03 13:21:05 UTC
(In reply to comment #1)
> Looks like the issue is in swig, the code is being injected from:
>   /usr/share/swig/2.0.1/python/pycontainer.swg
> from
>   swig-2.0.1-1.fc15.x86_64

Can you verify if znc's python module compiled via the latest swig-2.0.1-2.fc15 works fine, please? Thank you in advance.

Comment 3 Dave Malcolm 2011-01-04 00:02:26 UTC
swig-2.0.1-2.fc15 seems to fix the compilation error; thanks.

Comment 4 Dave Malcolm 2011-01-04 00:18:36 UTC
I've rebuilt znc-0.097-3.svn2214.fc15 for dist-rawhide (using the new swig)
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=2699642

Comment 5 Adam Tkac 2011-01-05 10:04:55 UTC
Ok, thanks for feedback, closing. Please reopen this bug if the python plugin doesn't work fine.

Comment 6 Petr Machata 2011-02-06 23:34:56 UTC
I seem to be hitting another instance of this bug:
http://koji.fedoraproject.org/koji/getfile?taskID=2765865&name=build.log

Comment 7 Petr Machata 2011-02-07 15:06:42 UTC
It in fact seems to be the same bug, but the other way around.  In my mock rawhide, the API again is:
  int PySlice_GetIndices(PySliceObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)

> rpm -q python-devel
python-devel-2.7.1-5.fc15.x86_64
... which, per koji, is the latest greatest

Comment 8 Petr Machata 2011-02-07 15:52:37 UTC
Ok, so the problem is that the API change took place in python3 package.  python kept the API intact.  Thus the simple solution in SWIG won't work.  Either you break one, or the other.  Note that this issue arises only in C++, so passing the "slice" object as void* won't work either.

Comment 9 Jaroslav Škarvada 2011-02-15 23:34:42 UTC
It is also blocking rebuild of gnuradio, please drop the swig200-rh666429.patch for f15/f16

Comment 10 Dave Malcolm 2011-02-15 23:47:13 UTC
Does the patch need some nasty C preprocessor hackery to conditionalize based on the python versions?

Something like:
#if PY_MAJOR_VERSION == 3
  #if PY_VERSION_HEX > 0x0302000
     /* >= 3.2 */
  #else 
     /* 3.0, 3.1*/
  #endif
#else
  /* 2.x */
#endif

Comment 11 Dave Malcolm 2011-02-15 23:48:28 UTC
(In reply to comment #10)
Oops, wrong number of zeroes
>   #if PY_VERSION_HEX > 0x0302000
    #if PY_VERSION_HEX > 0x03020000
...I think.

Comment 12 Adam Tkac 2011-02-16 12:23:59 UTC
I built improved swig-2.0.1-4.fc16/swig-2.0.1-4.fc15 packages which should fix both gnuradio & znc builds (i.e. new swig should be compatible with both python 2.x and 3.x).

Comment 13 Fedora Update System 2011-02-16 12:58:54 UTC
swig-2.0.1-4.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/swig-2.0.1-4.fc15

Comment 14 Fedora Update System 2011-02-16 14:20:34 UTC
swig-2.0.1-4.fc15 has been pushed to the Fedora 15 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update swig'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/swig-2.0.1-4.fc15

Comment 15 Jaroslav Škarvada 2011-02-16 22:58:29 UTC
For gnuradio it works, thanks.

Comment 16 Fedora Update System 2011-02-21 15:11:10 UTC
swig-2.0.2-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/swig-2.0.2-1.fc15

Comment 17 Fedora Update System 2011-03-03 03:21:10 UTC
swig-2.0.2-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 bouloumag 2011-03-16 11:01:56 UTC
It seems that this patch as not been sent upstream. Any reason for that ?


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