PythonDebugPackages

Redirected from page "PyDbgBuilds"

Clear message

python-dbg builds

The Python build flag Py_DEBUG allows for building the interpreter in debug mode; the default configuration for this debug mode builds extension modules, which are incompatible with the standard interpreter build (making python objects larger). It's not possible to mix extension modules built for a normal build with extension modules from a debug build. Using the debug build to debug an application with dozens of extension modules requires first building of these extensions. To ease this task, we want to provide often used extension modules for the debug build as well.

The python3.7 and python3.8 packages in Ubuntu 20.04 LTS "Focal" (like the contemporaneous python packages in previous Ubuntu versions) are modified to look for extension modules under a different name (normal build: foo-python-37m.so, debug build: foo-python-37dm.so), allowing installation of the extension modules into the same path (The naming is directly taken from the Windows builds which already uses this naming scheme).

Using the python-dbg builds

  • Call the python-dbg or the pythonX.Y-dbg binaries instead of the python or pythonX.Y binaries.
  • Properties of the debug build (excerpt below) are described in SpecialBuilds.txt, also included in the python3.7-dbg package.

    Py_DEBUG


    This is what is generally meant by "a debug build" of Python.

    Py_DEBUG implies LLTRACE, Py_REF_DEBUG, and PYMALLOC_DEBUG (if WITH_PYMALLOC is enabled). In addition, C assert()s are enabled (via the C way: by not defining NDEBUG), and some routines do additional sanity checks inside "#ifdef Py_DEBUG" blocks.

How to add a -dbg package

Building a -dbg package requires modification for the packaging; please don't create -dbg packages for extensions that you don't need. Track down the dependencies of a package you want to debug, then create -dbg packages for these needed extensions.

  • debian/control:

    • Add a build dependency on python3-all-dbg (>= 3.7.5-1ubuntu1) (building for more than one Python version), or python3-dbg (>= 3.7.5-1ubuntu1) (building for the current Python version).

    • python3-foo: Add a suggests to python3-foo-dbg.

    • python3-foo-dbg: New binary package

      • Priority optional

      • Section debug

      • Depends:
        • python3-foo (= ${binary:Version}), python3-dbg, ${shlibs:Depends}

        • If python3-foo depends on other packages with extensions (python3-bar), then python3-foo-dbg must depend on the corresponding -dbg packages (python3-bar-dbg).

      • Description: add (debug extension), maybe shorten the description and add This package contains the extensions built for the python debug interpreter.

  • debian/rules: Modifications depend on the packaging style, in general:

    • The interpreter python3-dbg must be used (or pythonX.Y-dbg) for build and install. Automatically done by distutils.

    • The include path must be /usr/include/pythonX.Y_d. Automatically selected by distutils. To get the include headers, you can use pythonX.Y-config --includes 2>/dev/null.

    • An extension for the debug build is named foo_d.so and is installed into the same path as the normal extension. The name is automatically selected by distutils, for other builds the extension must be renamed manually.

    • The package must hold only the extension modules and header files installed in /usr/include/pythonX.Y_d (when installed in /usr/include/pythonX.Y in the corresponding python3-foo` package).

    • The debug extension should be built without optimization (-O0), automatically done by distutils.
    • The python3-foo-dbg docdir should be symlinked to the python3-foo docdir.

    • The python3-foo-dbg can optionally contain debug symbols of the python3-foo package (generated by dh_strip -ppython3-foo --dbg-package=python3-foo-dbg)

Testing:

  • Install both the python3-foo-dbg and python3-dbg packages.

  • Try to import the extension both with the normal and the debug interpreter:
    • python3 -c 'import foo' (no output)

    • python3-dbg -c 'import foo' (one line output on stderr)

Packaging examples:

  • cdbs based (cdbs will be extended to ease this); currently you have to use some hooks:
  • distutils based, using debhelper to build for all supported python versions:
  • not using distutils, but autoconf/automake:
  • packages which should not be used as examples: libselinux, openoffice.org.

Repository:

Source packages building extensions

Our goal for feisty is to be able to use the Python debug build for desktop applications in the main repository. Having the debug builds be available for wxWidgets-based applications might help as well.

The table lists all packages which build extension modules; it does not mean that -dbg packages for all these packages must be provided; don't provide the -dbg packages on guessing, just on demand.

Pocket

Source:

Binaries

Who

Status

main

dbus-python

python-dbus

doko

DONE

main

deskbar-applet

deskbar-applet

doko

DONE

main

egenix-mx-base

python-egenix-*

doko

DONE

main

eunuchs

python-eunuchs

no rdepends

main

exo

python-exo

doko

DONE

main

file

python-magic

doko

DONE

main

gamin

python-gamin

doko

DONE

main

gnome-menus

python-gmenu

dholbach

DONE

main

gnome-orca

gnome-orca

dok

DONE

main

gnome-python

python-gconf python-gnome2 python-gnomecanvas

doko

DONE

main

gnome-python-desktop

python-gnome2-desktop

doko

DONE

main

gnome-python-extras

python-gnome2-extras python-gtkhtml2

doko

DONE

main

gst0.10-python

python-gst0.10

doko

DONE

main

hplip

hplip hplip-dbg

main

kde-guidance

kde-guidance

main

launchpad-integration

python-launchpad-integration

doko

DONE

main

libapache2-mod-python

libapache2-mod-python

main

libgpod

python-gpod

main

libxml2

python-libxml2

doko

DONE

main

libxslt

python-libxslt1

doko

DONE

main

newt

python-newt

doko

DONE

main

ocfs2-tools

ocfs2console

main

openoffice.org

python-uno

doko

main

pilot-link

python-pisock

doko

DONE

main

planner

planner

main

psycopg

python-psycopg

doko

DONE

main

pyao

python-pyao

doko

DONE

main

pycairo

python-cairo

doko

DONE

main

pycurl

python-pycurl

doko

DONE

main

pygobject

python-gobject

dholbach

DONE

main

pygresql

python-pygresql

doko

DONE

main

pygtk

python-glade2 python-gtk2

doko

DONE

main

pyogg

python-pyogg

doko

DONE

main

pyopenssl

python-pyopenssl

doko

DONE

main

pyorbit

python-pyorbit

doko

DONE

main

pyspi

python-at-spi

doko

DONE

main

python-adns

python-adns

main

python-apt

python-apt

doko

DONE

main

python-cddb

python-cddb

main

python-crypto

python-crypto

doko

DONE

main

python-cups

python-cups

main

python-gd

python-gd

doko

DONE

main

python-geoip

python-geoip

doko

DONE

main

python-imaging

python-imaging python-imaging-sane

doko

DONE

main

python-kde3

python-kde3

doko

DONE

main

python-ldap

python-ldap

doko

DONE

main

python-mysqldb

python-mysqldb

doko

DONE

main

python-numarray

python-numarray

doko

DONE

main

python-numeric

python-numeric

doko

DONE

main

python-pam

python-pam

doko

DONE

main

python-pqueue

python-pqueue

main

python-pylibacl

python-pylibacl

doko

DONE

main

python-pysqlite2

python-pysqlite2

doko

DONE

main

python-pyxattr

python-pyxattr

doko

DONE

main

python-qt3

python-qt3 python-qtext

doko

DONE

main

python-qt4

python-qt4

doko

DONE

main

python-sqlite

python-sqlite

doko

DONE

main

python-xml

python-xml

doko

DONE

main

pyvorbis

python-pyvorbis

doko

DONE

main

rdiff-backup

rdiff-backup

main

redland-bindings

python-librdf

main

sabayon

sabayon

main

samba

python-samba

main

sip4-qt3

python-sip4

doko

DONE

main

subversion

python-subversion

doko

DONE

main

twisted

python-twisted-bin

doko

DONE

main

twisted-runner

python-twisted-runner

doko

DONE

main

update-manager

update-manager-core

main

virtkey

python-virtkey

main

vte

python-vte

doko

DONE

main

zope3

python-zopeinterface

doko

DONE

main

zope3

zope3

doko

DONE

Pocket

Source:

Binaries

Who

Status

multiverse

gnuradio

python-gnuradio python-usrp

multiverse

python-cdb

python-cdb

Pocket

Source:

Binaries

Who

Status

universe

adesklets

adesklets

universe

aubio

python-aubio

universe

beagle

python-beagle

universe

celementtree

python-celementtree

doko

DONE

universe

cheetah

python-cheetah

universe

clearsilver

python-clearsilver

universe

codespeak-lib

python-codespeak-lib

universe

comedilib

python-comedilib

universe

cx-bsdiff

python-bsdiff

universe

decompyle

decompyle

universe

democracyplayer

democracyplayer

universe

diacanvas2

python-diacanvas2

universe

duplicity

duplicity

universe

eikazo

eikazo

universe

elementtidy

python-elementtidy

universe

fonttools

fonttools

universe

gadfly

python-kjbuckets

unused

universe

galago-gtk-python

galago-gtk-python

universe

galago-python

galago-python

universe

gdal

python-gdal

universe

gimmie

gimmie

universe

glom

glom

universe

gpib

python-gpib

universe

hamlib

python-libhamlib2

universe

hk-classes

python-hk-classes

universe

hocr

libhocr-python

universe

imdbpy

python-imdbpy

universe

imgseek

imgseek

universe

isomd5sum

python-pyisomd5sum

universe

jack

jack

universe

kdebindings

python-dcop

universe

lasso

python-lasso

universe

libavg

python-libavg

universe

libhdate

libhdate-python

universe

libhid

python-hid

universe

libieee1284

python-ieee1284

universe

libmetakit2.4.9.3

python-metakit

universe

libphidgets

python-phidgets

universe

libselinux

python-selinux

doko

DONE

universe

libsemanage

python-semanage

universe

libuser

python-libuser

universe

libvirt

python-libvirt

universe

linkchecker

linkchecker

universe

lxml

python-lxml

doko

DONE

universe

m2crypto

python-m2crypto

universe

mapserver

python-mapscript

universe

matplotlib

python-matplotlib

universe

memaid-pyqt

memaid-pyqt

universe

mercurial

mercurial

universe

ming

python-ming

universe

mirage

mirage

universe

mmpython

python-mmpython

universe

museek+

python-museek

universe

necpp

python-necpp

universe

nicotine

nicotine

universe

notify-python

python-notify

universe

omniorb4

omniidl4

universe

ontv

ontv

universe

opencv

python-opencv

universe

opensync

libopensync0-dbg python-opensync

universe

pcapy

python-pcapy

universe

plplot

python-plplot

universe

poker-network

python-poker2d

universe

psyco

python-psyco

universe

psycopg2

python-psycopg2

doko

DONE

universe

pyalsaaudio

python-alsaaudio

universe

pyannodex

python-annodex

universe

pybluez

python-bluez

universe

pychm

python-chm

universe

pycxx

python-cxx

doko

DONE

universe

pyenchant

python-enchant

universe

pyepl

python-pyepl

universe

pyfribidi

python-pyfribidi

universe

pygame

python-pygame

universe

pygdchart2

python-gdchart2

universe

pyinotify

python-pyinotify

universe

pykaraoke

python-pykaraoke

universe

pymad

python-pymad

universe

pyme

python-pyme

universe

pymol

pymol

universe

pynjb

python-pynjb

universe

pyode

python-pyode

universe

pyopenal

python-openal

universe

pyopengl

python-opengl

universe

pypanel

pypanel

universe

pypoker-eval

python-pypoker-eval

universe

pyprotocols

python-protocols

universe

pyqonsole

pyqonsole

universe

pyqwt

python-qwt4

universe

pyrite-publisher

pyrite-publisher

universe

pyslide

pyslide

universe

pyspeex

python-speex

universe

pystatgrab

python-statgrab

universe

pysvn

python-svn

doko

DONE

universe

pytables

python-tables

universe

python-4suite

python-4suite-rdf python-4suite-server python-4suite-xml

universe

python-apsw

python-apsw

universe

python-bibtex

python-bibtex

universe

python-biggles

python-biggles

universe

python-biopython

python-biopython

universe

python-clamav

python-clamav

universe

python-crack

python-crack

universe

python-extclass

python-extclass

no rdepends

universe

python-fam

python-fam

universe

python-fuse

python-fuse

universe

python-gammu

python-gammu

universe

python-gdchart

python-gdchart

universe

python-imaging

python-imaging-tk

universe

python-japanese-codecs

python-japanese-codecs

REMOVE

universe

python-kinterbasdb

python-kinterbasdb

universe

python-korean-codecs

python-korean-codecs

REMOVE

universe

python-numpy

python-numpy

doko

DONE

universe

python-omniorb2

python-omniorb2

universe

python-osd

python-osd

universe

python-oss

python-oss

universe

python-pgsql

python-pgsql

universe

python-pysqlite1.1

python-pysqlite1.1

universe

python-qt3

python-qt3-gl

doko

DONE

universe

python-qt4

python-qt4-gl python-qt4-sql

doko

DONE

universe

python-scientific

python-netcdf

universe

python-scipy

python-scipy

universe

python-scipy-core

python-scipy-core

universe

python-smbpasswd

python-smbpasswd

universe

python-tclink

python-tclink

universe

python-tcpwrap

python-tcpwrap

universe

python-visual

python-visual

universe

python-xattr

python-xattr

universe

pyx

python-pyx

universe

pyxfce

python-xfce

universe

pyxine

python-pyxine

universe

pyxmms

python-xmms

universe

pyxmpp

python-pyxmpp

universe

qm

python-sigmask

doko

universe

quixote

python-quixote

universe

quixote1

python-quixote1

universe

reportlab-accel

python-reportlab-accel

doko

DONE

universe

revelation

revelation

universe

rpm

python-rpm

universe

rpy

python-rpy

universe

rrdtool

python-rrd

no rdepends

universe

ruledispatch

python-dispatch

universe

scgi

python-scgi

universe

sexy-python

sexy-python

universe

smart

smartpm-core

universe

sonata

sonata

universe

soya

python-soya

universe

subterfugue

subterfugue

universe

syck

python-syck

universe

synopsis

synopsis

universe

tau

python-tau

universe

telepathy-blue

telepathy-blue

universe

tickcount

python-tickcount

universe

vtk

python-vtk

universe

wxwidgets2.6

python-wxgtk2.6

see below

universe

xapian-bindings

python-xapian

universe

xen-3.0

python-xen3.0

universe

xmldiff

xmldiff

universe

xulrunner

python-xpcom

universe

yapgvb

python-yapgvb

universe

zeroc-ice-python

python-zeroc-ice

universe

zodb

python-zodb

universe

zope-textindexng2

zope-textindexng2-lib

universe

zope2.9

zope2.9

Comments

  • wxWidgets2.6: would be very useful, wxWidgets2.8 is released as well.


CategoryDebugging