please add support to build python dbg extensions

Bug #85097 reported by Matthias Klose
6
Affects Status Importance Assigned to Milestone
cdbs (Debian)
Confirmed
Unknown
cdbs (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

Binary package hint: cdbs

an update for class/python-distutils.mk would be helpful to build python extensions for the debug builds of the interpreter; two examples for changes on cdbs packages are:

http://people.ubuntu.com/~doko/python-apt.debdiff
http://people.ubuntu.com/~doko/python-crypto.debdiff

Matthias Klose (doko)
Changed in cdbs:
assignee: nobody → pitti
Changed in cdbs:
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

Can you please point out some example code? (The URLs above are 404). What needs to happen for this? How can the generated -dbg packages be tested? (this should become part of the cdbs test suite).

Changed in cdbs:
status: Confirmed → Incomplete
Revision history for this message
Gabriel de Perthuis (g2p) wrote :

Here are the python-crypt debian/rules

Build-depends include python-all-dbg, depends for the -dbg binary package are “ python-crypto (= ${Source-Version}), python-dbg, ${shlibs:Depends} ” although it's not really sure python-dbg should be part of that (it pulls python2.5-dbg; either nothing or a “python-any-dbg” make more sense).

#!/usr/bin/make -f

DEB_PYTHON_SYSTEM=pycentral

include /usr/share/cdbs/1/rules/buildcore.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

pyver := $(shell pyversions -vd)
MKHOWTO = /usr/lib/python$(pyver)/doc/tools/mkhowto

common-build-arch::
        cd Doc && $(MKHOWTO) --ps

$(patsubst %,binary-post-install/%,$(DEB_PYTHON_REAL_LIB_PACKAGES))::
        sh -e debian/pathmangle.sh /usr/bin/$(shell echo $(cdbs_curpkg) | sed 's,-crypto$$,,') debian/$(cdbs_curpkg)

build/python-crypto-dbg::
        set -e; \
        for i in $(cdbs_python_build_versions); do \
          python$$i-dbg ./setup.py build; \
        done

install/python-crypto-dbg::
        for i in $(cdbs_python_build_versions); do \
          python$$i-dbg ./setup.py install --root $(CURDIR)/debian/python-crypto-dbg; \
        done
        find debian/python-crypto-dbg \
                ! -type d ! -name '*_d.so' | xargs rm -f
        find debian/python-crypto-dbg -depth -empty -exec rmdir {} \;

binary-predeb/python-crypto-dbg::
        rm -rf debian/python-crypto-dbg/usr/share/doc/python-crypto-dbg
        ln -s python-crypto debian/python-crypto-dbg/usr/share/doc/python-crypto-dbg

clean::
        rm -rf build
        rm -f Doc/*.ps

Revision history for this message
Gabriel de Perthuis (g2p) wrote :

CDBS could be just a change in debian/control and a mostly-empty debian/rules (no reference to the dbg package in the latter), if class/python-distutils.mk's targets make use of $(is_debug_package).

Revision history for this message
Martin Pitt (pitti) wrote :

Please provide a pointer how those -dbg packages can be tested easily.

Revision history for this message
Gabriel de Perthuis (g2p) wrote :

You can put a breakpoint on symbols defined in the python extension and see if "info args" works in gdb.

Say you want to test python-apt-dbg, and have it installed.

# Prepare the gdb commands that set the breakpoints
nm -D -C --defined-only /usr/lib/python2.5/site-packages/apt_inst.so /usr/lib/python2.5/site-packages/apt_pkg.so |sed -rne "s#.* T ([^_][^']*)\$#break '\1'#p" |tee cmds
gdb --args python -c 'import apt; c = apt.Cache(); p = c["python2.5"]'

# In gdb
run
source cmds
run
# Hit a breakpoint
info args
# Displays args, only if python-apt-dbg is installed.

Martin Pitt (pitti)
Changed in cdbs:
status: Incomplete → Triaged
Revision history for this message
Matthias Klose (doko) wrote :

> Please provide a pointer how those -dbg packages can be tested easily.

you call the python-dbg interpreter (instead of the python interpreter).

Changed in cdbs (Debian):
status: Unknown → Confirmed
Martin Pitt (pitti)
Changed in cdbs (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.