Red Hat Bugzilla – Bug 1014549
Update gdb to Python 3
Last modified: 2015-02-16 11:16:57 EST
Congratulations! Your package has been chosen as a MUST to be updated to Python 3 :)
The goal here is, that this package uses Python 3 as default in Fedora 22.
And how to do it? Follows those easy steps:
1. Check if upstream already support Python 3, if yes, use it
2. If upstream doesn't support Python 3 yet, encourage it to do so by sending patches and offering your help, then go to 1.
If you end up in infinite loop, there's something broken. I.e. upstream is dead or unwilling to support Python 3. In that case, you'll need to patch this package on Fedora level. Try to avoid this as much as you can, but use it, if it's the last option.
Chances are, that you ARE the upstream. In that case, everything is easier, just do it yourself.
Once Python 3 is supported, check your package, if it works with it. If you don't want to switch to Python 3 yet as a default (that's still against guidelines), I recommend to prepare your spec and conditionalize the thing with something like %global default_python 2.
There is a table on wiki, that should list your package. Chances are, that you can see an upstream link that covers the problem. Anyway, please update the table with information you know.
And, of course, if you need help, that's why I am here :)
(As you've already realized, this is a bulk text, so if something is not quite exact about your package, sorry for that, just ask)
Upstream GDB should support Python 3, Rawhide is still for F-21 so there is currently nothing to do.
Agreed. I opened this sooner, in case you want to prepare for the update before rawhide becomes F22. Otherwise, just let it be until then.
Thanks for fast reply.
It's worth noting that if gdb switches, then any pretty-printers
or other gdb plugins must also be updated.
Pretty printers appear in Python itself (including Python 2.x),
glib, gcc, mono, and others.
For gdb plugins I only know of gdb-heap.
Our team will most likely handle gcc, but the other packages
haven't historically been our purview.
Noting this for people who might run across this via web searches; since we're fixing this via an upstream update this shouldn't be an issue here:
Note: do not follow this portion of the advice as it is against the Packaging Guidelines: "When upstream is dead or unwilling to support Python 3, you'll need to patch this package on Fedora level. Try to avoid this as much as you can, but use it, if it's the last option."
If you are in this situation, you'll essentially be forking upstream in order to produce a python3 port. In that situation, the proper thing to do is to create a new package with the python3 port. It would be even better to create the proper upstream infrastructure as well (new upstream scm and issue tracker) but that isn't 100% required by the guidelines.
FWIW there's already a port of the libstdc++ printers to Python 3:
Doko said he'll send the patch upstream when it is ready.
Hi, since we're nearing Fedora 22 alpha and packages should now be preferably built with Python 3 , I'd like to ask you to rebuild gdb with Python 3.
Just Rawhide is not yet rebuilt due to Koji:
DEBUG util.py:389: 4:texlive-cm-super-svn15878.0-6.fc22.noarch: [Errno 256] No more mirrors to try.
gdb-188.8.131.5250214-7.fc23 is also built now, it was only some temporary Koji issue.