Commit 620fa54d authored by Vagrant Cascadian's avatar Vagrant Cascadian
Browse files

reproducible: Reduce parallelism on armhf systems with a lot of cores

to reduce swapping on highly parallel builds. Also ensure parallelism
for armhf is an odd number on first build, and even on second build.
parent a9919410
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -568,6 +568,15 @@ first_build() {
	echo "Date:     $(date)"
	echo "Date UTC: $(date -u)"
	echo "============================================================================="
	if [ "${ARCH}" = "armhf" ]; then
		# Reduce parallelism on armhf systems with a lot of cores to
		# reduce swapping on highly parallel builds. Also ensure first
		# build is always an odd number of CPUs for good measure.
		case $NUM_CPU in
			2|4) NUM_CPU=3 ;;
			*) NUM_CPU=5 ;;
		esac
	fi
	local TMPCFG=$(mktemp -t pbuilderrc_XXXX --tmpdir=$TMPDIR)
	cat > "$TMPCFG" << EOF
BUILDUSERID=1111
@@ -625,7 +634,15 @@ second_build() {
	echo "============================================================================="
	set -x
	local TMPCFG=$(mktemp -t pbuilderrc_XXXX --tmpdir=$TMPDIR)
	NEW_NUM_CPU=$NUM_CPU	# on amd64+i386 we vary this based on node choices (by design), on armhf only sometimes.
	# on amd64+i386 we vary this based on node choices (by design)
	if [ "${ARCH}" = "armhf" ]; then
		# Reduce parallelism on armhf systems with a lot of cores to
		# reduce swapping on highly parallel builds. Keep second build
		# with even number of cores.
		case $NUM_CPU in
			8) NUM_CPU=6 ;;
		esac
	fi
	# differ locale+language depending on the architecture (mostly for readability by different people…)
	case $ARCH in
		armhf)	locale=it_CH
+1 −1
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ write_variation_table() {
		write_page "<tr><td>build path</td><td>/build/1st/\$pkg-\$ver <em>(not varied for stretch/buster)</em></td><td>/build/2/\$pkg-\$ver/2nd <em>(not varied for stretch/buster)</em></td></tr>"
		write_page "<tr><td>user's login shell</td><td>/bin/sh</td><td>/bin/bash</td></tr>"
		write_page "<tr><td>user's <a href="https://en.wikipedia.org/wiki/Gecos_field">GECOS</a></td><td>first user,first room,first work-phone,first home-phone,first other</td><td>second user,second room,second work-phone,second home-phone,second other</td></tr>"
		write_page "<tr><td>env DEB_BUILD_OPTIONS</td><td>DEB_BUILD_OPTIONS=\"parallel=XXX\"<br />&nbsp;&nbsp;XXX on amd64: 16 or 15<br />&nbsp;&nbsp;XXX on i386: 10 or 9<br />&nbsp;&nbsp;XXX on armhf: 8, 4 or 2</td><td>DEB_BUILD_OPTIONS=\"parallel=YYY\"<br />&nbsp;&nbsp;YYY on amd64: 16 or 15 (!= the first build)<br />&nbsp;&nbsp;YYY on i386: 10 or 9 (!= the first build)<br />&nbsp;&nbsp;YYY is the same as XXX on arm64<br />&nbsp;&nbsp;YYY on armhf: 8, 4, or 2 (not varied systematically)</td></tr>"
		write_page "<tr><td>env DEB_BUILD_OPTIONS</td><td>DEB_BUILD_OPTIONS=\"parallel=XXX\"<br />&nbsp;&nbsp;XXX on amd64: 16 or 15<br />&nbsp;&nbsp;XXX on i386: 10 or 9<br />&nbsp;&nbsp;XXX on armhf: 5 or 3</td><td>DEB_BUILD_OPTIONS=\"parallel=YYY\"<br />&nbsp;&nbsp;YYY on amd64: 16 or 15 (!= the first build)<br />&nbsp;&nbsp;YYY on i386: 10 or 9 (!= the first build)<br />&nbsp;&nbsp;YYY is the same as XXX on arm64<br />&nbsp;&nbsp;YYY on armhf: 2, 4, or 6</td></tr>"
		write_page "<tr><td>UTS namespace</td><td><em>shared with the host</em></td><td><em>modified using</em> /usr/bin/unshare --uts</td></tr>"
	elif [ "$1" = "Arch Linux" ]  ; then
		write_page "<tr><td>env USER</td><td>jenkins</td><td>build 2</td></tr>"