.deb packaged python wheel files differ from the unpackaged ones?

72 Views Asked by At

I have to pack Python wheels into .deb, and for that I use simple debian/rules:

%:
    dh $@

And I have a pipdebs.install file:

#!/usr/bin/dh-exec

../external/python3.10/wheels /usr/lib/python3.10/.cache/pip/
../external/python3.10/requirements.txt /usr/lib/python3.10/.cache/pip/

But the problem is that when I build .deb and extract wheels directory from data.tar.zst/usr/lib/python3.10/.cache/pip/wheels then it differs from the ../external/python3.10/wheels one.

Why is that?

1

There are 1 best solutions below

1
ojacomarket On BEST ANSWER

I have reproduced your error with debhelper-compat (=13). Next time you run dpkg-buildpackage, pay attention to the console output. I got following (interesting) message:

dh_strip_nondeterminism
    Normalizing ... using File::StripNondeterminism::handlers::zip

Quick googling results in that

StripNondeterminism is a library for stripping non-deterministic information such as timestamps and filesystem ordering from various file and archive formats.

So, that also explains why your wheels inside .deb differ from the ones you have outside .deb.

Workaround is (YYY is your Package: in debian/control that you don't want to perform dh_strip_nondeterminism on and XXX is the package you want to perform dh_strip_nondeterminism on ):

override_dh_strip_nondeterminism:
    dh_strip_nondeterminism --package=XXX

Note, that this workaround will do the dh_strip_nondeterminism only for the XXX package and not for others YYY, ... packages