[Python-modules-team] Bug#886291: src:pycryptodome: Building both pycryptodome and pycryptodomex: duplicate dbgsym package

Alexis Murzeau amubtdx at gmail.com
Wed Aug 15 13:30:17 BST 2018


Hi,

I'm trying to find a way to build 2 times a python source package to
generate 2 binary packages which both contains .so libs and this cause 2
 duplicated dbgsym packages with same files.

The source package is pycryptodome.
That package can be built to be either in Crypto python namespace (to
allow drop in replacement of python-pycrypto) or Cryptodome namespace.
This is controlled at build time with the existence of a
".separate_namespace" file.

If .separate_namespace file exists in the root source directory,
pycrytodome will use Cryptodome namespace and generate a pycryptodomex
egg. Else it will use Crypto namespace and generate a pycryptodome egg.

I tried to build both binary package (pycryptodome for Crypto namespace
and pycryptodomex for Cryptodome) from the same source, and so far I'm
doing this:

- override dh_auto_build to call dh_auto_build 2 times: one with
.separate_namespace and one without
- override dh_auto_test to call dh_auto_test 2 times: one with
.separate_namespace and one without
- override dh_auto_install to call dh_auto_install 2 times: one with
.separate_namespace and one without

Use debian/package-name.install to define what to put in each package.

This create expected packages.

But pycryptodome contains binaries .so libraries used by python scripts
and these happen to be exactly the same binaries (same checksums)
between pycryptodome and pycrytodomex.
Maybe only some .so libraries change between both. I don't think it's
safe to assume upstream won't make a change causing some of these .so to
change between pycryptodome and pycrytodomex.

This causes the generated dbgsym package (python{,3}-pycryptodome-dbgsym
and python{,3}-pycryptodomex-dbgsym) to contains the same files and
lintian warn about this with binaries-have-file-conflict tag.

So to summary this:
- I build/test/install 2 times the package, one time with
.separate_namespace and one without

- This generate 2 binary packages python{,3}-pycryptodome and
python{,3}-pycryptodomex both containing .so native libraries (some of
which are the exact same between both packages)

- dh_strip generate 2 dbgsym packages containing duplicate .debug files
which make them in conflict and trigger lintian warning
binaries-have-file-conflict.

- python{,3}-pycryptodome and python{,3}-pycryptodomex are not in
conflicts, their files are not in the same python namespace (Crypto vs
Cryptodome)


I think the best would be to have only on dbgsym package for both
python{,3}-pycryptodome and python{,3}-pycryptodomex.

But I don't know how to handle best this situation.

I'm attaching debian/rules and build logs.
The source I used is here: [0].

Thanks for any help :)

[0] https://salsa.debian.org/amurzeau-guest/pycryptodome

-- 
Alexis Murzeau
PGP: B7E6 0EBB 9293 7B06 BDBC  2787 E7BD 1904 F480 937F
-------------- next part --------------
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

#export PYBUILD_NAME=pycryptodome
#export PYBUILD_AFTER_INSTALL=rm '{destdir}/{install_dir}/Cryptodome/SelfTest/PublicKey/test_vectors/ECC/gen_ecc_p256.sh'
%:
	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_test:


#	touch .separate_namespace
#	PYBUILD_SYSTEM=custom \
#        PYBUILD_TEST_ARGS="python{version} -m Cryptodome.SelfTest {build_dir}/" dh_auto_test
#	rm .separate_namespace
#	PYBUILD_SYSTEM=custom \
#        PYBUILD_TEST_ARGS="python{version} -m Crypto.SelfTest {build_dir}/" dh_auto_test

override_dh_auto_build: export http_proxy=127.0.0.1:9
override_dh_auto_build: export https_proxy=127.0.0.1:9
override_dh_auto_build:
	touch .separate_namespace
	dh_auto_build
	rm .separate_namespace
	dh_auto_build
	PYTHONPATH=. sphinx-build -N -bhtml Doc/ build/html # HTML generator
	PYTHONPATH=. sphinx-build -N -bman Doc/ build/man # Manpage generator

override_dh_auto_install:
	touch .separate_namespace
	PYBUILD_AFTER_INSTALL=rm '{destdir}/{install_dir}/Cryptodome/SelfTest/PublicKey/test_vectors/ECC/gen_ecc_p256.sh' \
	 dh_auto_install
	rm .separate_namespace
	PYBUILD_AFTER_INSTALL=rm '{destdir}/{install_dir}/Crypto/SelfTest/PublicKey/test_vectors/ECC/gen_ecc_p256.sh' \
	 dh_auto_install

# Do this until it becomes clearer where documentation should live post Python 2
override_dh_installdocs:
	dh_installdocs -p python-pycryptodome
	dh_installdocs -p python3-pycryptodome
	dh_installdocs --doc-main-package=python-pycryptodome-doc -p python-pycryptodome-doc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pycryptodome_3.6.1-3_amd64-2018-08-15T00:15:40Z.build.gz
Type: application/gzip
Size: 148446 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20180815/1235c477/attachment-0001.gz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20180815/1235c477/attachment-0001.sig>


More information about the Python-modules-team mailing list