[Debian-med-packaging] Bug#1082494: build ignores requested number of parallel processes

Johannes Schauer Marin Rodrigues josch at debian.org
Sat Sep 21 07:10:17 BST 2024


Source: pyranges
Severity: normal

Hi,

when building your package with dpkg-buildpackage -j X, which sets
DEB_BUILD_OPTIONS=parallel=X, the dh_auto_test step ignores that setting
and will run with whatever `nproc` returns regardless. Untested patch:

--- a/debian/rules
+++ b/debian/rules
@@ -10,7 +10,13 @@ export PYBUILD_BEFORE_TEST=\
 	&& cp -av {dir}/tests/test_data {build_dir}/tests \
 	&& cp -av {dir}/tests/data {build_dir}/tests \
 	&& cp -av {dir}/pyranges/example_data {build_dir}/pyranges
-export PYBUILD_TEST_ARGS=-v -n $(shell nproc)
+
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))"
+else
+	NUMJOBS = $(shell nproc)
+endif
+export PYBUILD_TEST_ARGS=-v -n $(NUMJOBS)
 
 %:
 	dh $@ --buildsystem=pybuild


Thanks!

cheers, josch



More information about the Debian-med-packaging mailing list