]> git.donarmstrong.com Git - debhelper.git/commitdiff
implement the other option: parallel enabled implicitly by DEB_BUILD_OPTIONS
authorJoey Hess <joey@gnu.kitenet.net>
Thu, 29 Oct 2009 20:12:57 +0000 (16:12 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Thu, 29 Oct 2009 20:12:57 +0000 (16:12 -0400)
I renamed --parallel to --max-parallel to clarify that it doesn't enable
parallelism, but only controls how much of it is allowed.

Debian/Debhelper/Dh_Buildsystems.pm
debhelper.pod
debian/changelog
dh

index b0e0a568a7d5d00c9505b2206a1423e632c996af..8713aab44fbaf28974d7b7bd0f5495ebb3c1adfe 100644 (file)
@@ -112,6 +112,8 @@ sub load_all_buildsystems {
 
 sub buildsystems_init {
        my %args=@_;
+       
+       my $max_parallel=0;
 
        # Available command line options
        my %options = (
@@ -127,28 +129,28 @@ sub buildsystems_init {
            "l" => \$opt_list,
            "list" => \$opt_list,
 
-           "j:i" => \&set_parallel,
-           "parallel:i" => \&set_parallel,
+           "max-parallel:i" => \$max_parallel,
        );
        $args{options}{$_} = $options{$_} foreach keys(%options);
        Debian::Debhelper::Dh_Lib::init(%args);
+       set_parallel($max_parallel);
 }
 
 sub set_parallel {
-       my ($option, $value)=@_;
+       my $max=shift;
 
-       if ($value >= 0 && exists $ENV{DEB_BUILD_OPTIONS}) {
+       if (exists $ENV{DEB_BUILD_OPTIONS}) {
                # Parse parallel=n tag
                my $n;
                foreach my $opt (split(/\s+/, $ENV{DEB_BUILD_OPTIONS})) {
                        $n = $1 if $opt =~ /^parallel=(\d+)$/;
                }
                if (defined $n && $n > 0) {
-                       if ($value == 0 || $n < $value) {
+                       if ($max && $n < $max) {
                                $opt_parallel = $n;
                        }
                        else {
-                               $opt_parallel = $value;
+                               $opt_parallel = $max;
                        }
                }
                else {
index 20ca9d7dde01f05c8d4f793e91e0b54283de3c2e..0a9ef41e0f4f7c6762274688afdd7176a5c276af 100644 (file)
@@ -205,15 +205,16 @@ If the build system prefers out of source tree building but still
 allows in source building, the latter can be re-enabled by passing a build
 directory path that is the same as the source directory path.
 
-=item B<-j>[I<maximum>], B<--parallel>[I<=maximum>]
+=item B<--max-parallel>[I<=maximum>]
 
-Indicate that a source package supports building using multiple parallel
-processes. This only enables parallel building if the build system supports
-it, and I<parallel=n> is present in the DEB_BUILD_OPTIONS environment
-variable (as per Debian Policy section 4.9.1).
+By default, the DEB_BUILD_OPTIONS environment variable can be used to
+enable parallel building, when supported by the build system.
 
-The number of parallel processes will be the smaller value specified by
-I<--parallel>, DEB_BUILD_OPTIONS, or a build system specific limit.
+This option allows controlling how many parallel jobs can be used in a
+build. If set to 1, concurrent builds are disabled -- do this if
+the package build is known not to work in parallel. If the package build
+is known to only work with certian levels of concurrency, you can set this
+to the maximum level that is known to work, or that you wish to support.
 
 =item B<--list>, B<-l>
 
index 9d1f81fedaccbd5b3730a36fd51627e7caf5c9ce..07296a9fe81129f8b176005e3f6268e6473a077f 100644 (file)
@@ -1,13 +1,15 @@
 debhelper (7.4.4) UNRELEASED; urgency=low
 
-  * dh_auto_*: Add --parallel option that indicates the package supports
-    parallel building. Then if DH_BUILD_OPTIONS contains 'parallel=N',
-    and the build system supports it, parallel building is done.
   * The makefile buildsystem (and derived buildsystems) now supports
-    parallel building.
-  * Typically, to enable parallel building, the --parallel option will
-    be passed to dh. Closes: #532805
-  * Thanks, Modestas Vainius for most of the work on parallel build support.
+    parallel building by default, as specified via DEB_BUILD_OPTIONS.
+    Closes: #532805
+  * dh_auto_*: Add --max-parallel option that can be used to control
+    or disable parallel building. --max-parallel=1 will disable parallel
+    building, while --max-parallel=N will limit the maximum number of
+    parallel processes that can be specified via DEB_BUILD_OPTIONS.
+  * Added some hacks to avoid warnings about unavailable jobservers when
+    debhelper runs make.
+  * Thanks, Modestas Vainius for much of the work on parallel build support.
 
  -- Joey Hess <joeyh@debian.org>  Wed, 28 Oct 2009 18:10:45 -0400
 
diff --git a/dh b/dh
index 0ecfe442d5a9f5cbb4f0950c5ed30494fa677b78..bd82d44bd4760e6870618cfa9f99b45c754866a2 100755 (executable)
--- a/dh
+++ b/dh
@@ -225,9 +225,9 @@ init(options => {
 });
 inhibit_log();
 
-# If make was using a jobserver, but it is not available, clean out
-# MAKEFLAGS so that further make invocations can start a new job
-# server. 
+# If make is using a jobserver, but it is not available
+# to this process, clean out MAKEFLAGS. This avoids
+# ugly warnings when calling make.
 if (is_make_jobserver_unavailable()) {
        clean_jobserver_makeflags();
 }