Hi, since the "Python 3 as a Default" change [1] has been accepted and Fedora 22 is slowly approaching, I'd like to ask you to port unbound to Python 3. The guidelines are pretty simple ATM - if it makes sense to provide bindings to both Python 2 and Python 3 at the same time, you can add python3- subpackage already. If the package is more of an "application" than "library" and it only makes sense for it to compile/run with one Python release, please make sure that it's Python 3 compatible and keep building it with Python 2 at least until Fedora 21 is branched and then switch. Thanks! [1] https://fedoraproject.org/wiki/Changes/Python_3_as_Default
Started working on this. After first steps, it looks like unbound supports some sort of python plugins plus there's a pythonic API for libunbound. More details coming soon. The configure script fails badly with Python 3.x, so we'll see what can be done.
Created attachment 938042 [details] handle python 3.x in configure
Created attachment 938094 [details] use Python 2.x/3.x C API correctly
Created attachment 938995 [details] fedora dist-git patch to build against python3 The former two patches were both accepted upstream. Replacing with a patch for dist-git. Not pushing yet, as it won't build against the current python3 package, let's see what python3 maintainer can say about this.
As you replied to the blocker, we can move forward and see all the stuff that's wrong with: http://unbound.nlnetlabs.nl/svn/trunk/acx_python.m4
(In reply to Pavel Šimerda (pavlix) from comment #5) > As you replied to the blocker, we can move forward and see all the stuff > that's wrong with: > > http://unbound.nlnetlabs.nl/svn/trunk/acx_python.m4 There is one problem that I can see: Using "print(conf('LOCALMODLIBS'), conf('LIBS'))" in Python 2 prints: ('', '-lpthread -ldl -lutil') and in Python 3 it (correctly) prints: -lpthread -ldl -lutil You should put "from __future__ import print_function" in the beginning of every python invocation that uses print() to print multiple values in order to make this run properly on Python 2.6 and 2.7. Otherwise it looks fine to me.
Created attachment 939159 [details] fedora dist-git patch to build against python3 Updated the patch to get over the py3 library path issue.
Scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=7628455
Fixed also the swig templates and examples, almost all of them work, there's still a swig issue of not accepting a file for logging in python 3.x but that seems to be independent of unbound. All patches were accepted upstream and propagated to Fedora using the following command: git diff 25746188a0a207d57bd245a6bcc461e3bcd199e2..890249811e656c612100bce0f3907927e6044778 -- acx_python.m4 configure.ac libunbound/python pythonmod > ~/fedora/unbound/unbound-1.4.22-python3.patch http://koji.fedoraproject.org/koji/buildinfo?buildID=580571
*** Bug 1173867 has been marked as a duplicate of this bug. ***