[Debian-med-packaging] Bug#1121065: pychopper: please make the build reproducible

Chris Lamb lamby at debian.org
Thu Nov 20 14:45:29 GMT 2025


Source: pychopper
Version: 2.7.10-1
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: nocheck
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds effort [0], we noticed that
pychopper could not be built reproducibly.

This was because it ships a different binary package depending
on whether the tests are run or not. This was caused by two things:

1. The testsuite did not sufficiently clean up after itself, leaving
the pychopper/tests/ directory around, which was then installed into
the binary package... but only if the tests were run.

2. The calls to chmod +x the scripts were only performed if the tests
were run, meaning that these were _not_ executable in the .deb
if nocheck was specified (and potentially resulting in a broken
package — I don't know how used these scripts are).

Patch attached that addresses both issues.

 [0] https://reproducible-builds.org/


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
--- a/debian/rules	2025-11-19 13:10:10.118944031 -0800
--- b/debian/rules	2025-11-19 13:29:23.424961171 -0800
@@ -3,6 +3,7 @@
 
 export PYBUILD_NAME=pychopper
 export PYBUILD_BEFORE_TEST=cp -av $(CURDIR)/pychopper/tests/ {build_dir}/pychopper/
+export PYBUILD_AFTER_TEST=rm -rfv {build_dir}/pychopper/tests/
 DEF_PY=$(shell py3versions -d)
 DEF_BUILDDIR3 := $(shell pybuild --print build_dir --interpreter python3)
 
@@ -18,6 +19,7 @@
 	for py in `py3versions -s`; do \
 		builddir=$$(pybuild --print build_dir --interpreter $$py); \
 		mv $$builddir/pychopper/scripts/pychopper.py $$builddir/pychopper/scripts/pychopper; \
+		chmod +x $$builddir/pychopper/scripts/pychopper ; \
 	done
 
 override_dh_auto_clean:
@@ -28,7 +30,7 @@
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 	dh_auto_test -- --system=custom --test-args="export PATH=$(DEF_BUILDDIR3)/pychopper/scripts:$$PATH; \
-	chmod +x $(DEF_BUILDDIR3)/pychopper/scripts/pychopper; PYTHONPATH={build_dir} {interpreter} -m pytest -v"
+	PYTHONPATH={build_dir} {interpreter} -m pytest -v"
 	set -e; \
 	for py in `py3versions -sv`; do \
 	rm -rf ".pybuild/cpython3_$${py}_$(PYBUILD_NAME)/pychopper/tests/"; \


More information about the Debian-med-packaging mailing list