[dpkg] 42/200: dpkg-buildpackage: Fallback to one job on unknown number of online processors
Ximin Luo
infinity0 at debian.org
Wed Apr 5 15:17:12 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository dpkg.
commit 4c217aee7a610dad02d5b28a2f9bf5d934fea77c
Author: Guillem Jover <guillem at debian.org>
Date: Mon Nov 14 04:07:07 2016 +0100
dpkg-buildpackage: Fallback to one job on unknown number of online processors
On unsupported or exotic systems where we might be unable to retrieve
the number of online processors and have been requested to infer them
ourselves via the --jobs or --jobs-try “auto” argument, default to
serial execution instead of unlimited jobs, to be on the safe side.
Proposed-by: Simon McVittie <smcv at debian.org>
---
debian/changelog | 4 ++++
man/dpkg-buildpackage.man | 3 ++-
scripts/dpkg-buildpackage.pl | 3 +++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 9cb6c22..5a8f8ba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,10 @@ dpkg (1.18.15) UNRELEASED; urgency=medium
* Generate deterministic .buildinfo filenames in dpkg-genbuildinfo,
following the same pattern as used for .changes files.
* Bump .buildinfo Format to version 0.2.
+ * Change dpkg-buildpackage -j and -J on “auto” mode to fallback to serial
+ execution when we cannot infer the number of online processors on
+ unsupported or exotic systems. This should be a safer mode of operation.
+ Proposed by Simon McVittie <smcv at debian.org>.
* Perl modules:
- Validate architecture arguments in Dpkg::Deps deps_parse().
Prompted by Johannes Schauer <josch at debian.org>.
diff --git a/man/dpkg-buildpackage.man b/man/dpkg-buildpackage.man
index 7284676..bf71d23 100644
--- a/man/dpkg-buildpackage.man
+++ b/man/dpkg-buildpackage.man
@@ -246,7 +246,8 @@ The \fB\-j\fP value will override the \fBparallel=\fP\fIjobs\fP or
Note that the \fBauto\fP value will get replaced by the actual number of
currently active processors, and as such will not get propagated to any
child process. If the number of online processors cannot be inferred then
-the code will fallback to using an unlimited number.
+the code will fallback to using serial execution (since dpkg 1.18.15),
+although this should only happen on exotic and unsupported systems.
.TP
.BR \-J ", " \-\-jobs\-try [=\fIjobs\fP|\fBauto\fP]
This option (since dpkg 1.18.2, long option since dpkg 1.18.8) is equivalent
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 728916e..9ec0d84 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -393,6 +393,9 @@ if (defined $parallel) {
$parallel = qx(getconf _NPROCESSORS_ONLN 2>/dev/null);
# Fallback for at least Irix.
$parallel = qx(getconf _NPROC_ONLN 2>/dev/null) if $?;
+ # Fallback to serial execution if cannot infer the number of online
+ # processors.
+ $parallel = '1' if $?;
chomp $parallel;
}
if ($parallel_force) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git
More information about the Reproducible-commits
mailing list