[Pkg-libvirt-maintainers] Bug#709516: hivex: Python 3 support not fully implemented in hivex

Scott Kitterman debian at kitterman.com
Thu May 23 19:24:27 UTC 2013


On Thursday, May 23, 2013 08:34:13 PM Hilko Bengen wrote:
> * Scott Kitterman:
> > It appears that you intend (from what's in debian/rules and control) to
> > support python3, but with the current packaging no python3 bindings are
> > provided.
> 
> Actually, the python-hivex package provides them:
> 
> /usr/lib/python3/dist-packages
> /usr/lib/python3/dist-packages/hivex.py
> /usr/lib/python3/dist-packages/libhivexmod.so

I did miss that, but Python only maintains ABI per python version, so you need 
a separate .so for python3.2 and 3.3  to support both.  So something is wrong 
in that that one .so can't support both 3.2 and 3.3.  You'll see that with my 
patch, dh_python3 does act on the .so and generate correct dependencies.  It's 
now:

usr/lib/python3/dist-packages/libhivexmod.cpython-32mu.so

In python3 there is version specific ABI tagging in the .so name so that .so 
files for multiple versions can be installed in the same directory.  This is 
described in http://www.python.org/dev/peps/pep-3149/ .  

I have seen cases before where, when the upstream build system did not support 
pep-3149, the .so would be built for both python3 versions with the unadorned 
name (libhivexmod.so) and installed into the same directory so the second one 
built overwrote the first.  It make take some work in the hivex build system to 
correctly build for both versions (and I"m not sure now if you have the 
version built for 3.2 or 3.3 in the current package.

> $ python3.3
> Python 3.3.2 (default, May 18 2013, 17:07:09)
> [GCC 4.7.3] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> 
> >>> import hivex
> >>> hivex
> 
> <module 'hivex' from '/usr/lib/python3/dist-packages/hivex.py'>
> 
> 
> Ignoring for a moment the issue that this module does not work with
> python 3.2, is there a problem with providing Python 2.x bindings and
> Python 3.x bindings in the same package?

Yes.  If you look at the python policy, we want to have the python and python3 
runtimes be separate.  This has a number of advantages for the python echo 
system in Debian, but the one that's the most directly relevant to hivex is 
proper package dependencies.

Currently the python-hivex dependencies are:

Depends: python (>= 2.7), python (<< 2.8), libc6 (>= 2.1.3), libhivex0

So there's no dependency no a python3 interpreter, so just based on 
dependencies, the python3 portion is not usable (and given that generally in 
Debian python3 modules are in separate binary packages it would be quite 
surprising from a user perpective to fine it there.

Split into it's own binary, python3-hivex, the depends would be (if we figure 
out the .so overwriting problem):

Depends: python3 (>= 3.2.3-3~), python3 (<< 3.4), libc6 (>= 2.1.3), libhivex0

With this approach, anyone wanting python3 bindings can install them along 
with the required dependencies.  As an added bonus, these generated 
dependencies are how we track what packages need rebuilding for a python 
version transition:

http://release.debian.org/transitions/html/python3.3.html

The fact that hivex showed up as unknown there is what got me looking at the 
package in the first place.

Scott K
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-libvirt-maintainers/attachments/20130523/6f232a92/attachment-0001.pgp>


More information about the Pkg-libvirt-maintainers mailing list