]> git.donarmstrong.com Git - debhelper.git/commitdiff
Add --parallel option.
authorModestas Vainius <modestas@vainius.eu>
Thu, 3 Dec 2009 22:17:06 +0000 (00:17 +0200)
committerModestas Vainius <modestas@vainius.eu>
Fri, 4 Dec 2009 21:27:58 +0000 (23:27 +0200)
This patch adds --parallel option that enables parallel builds and does not
impose limits on maximum concurrent processes. --max-parallel (that implies
--parallel) can be used to specify that maximum limit.

Also make necessary adjustments to debhelper.pod and buildsystem_tests for
this option.

Debian/Debhelper/Dh_Buildsystems.pm
debhelper.pod
t/buildsystems/buildsystem_tests

index d50c51739ff8dd3883805fa52d3e9d332618abfc..0f34a2e2d24cf04293f33ebb654450badc929a2b 100644 (file)
@@ -152,6 +152,7 @@ sub buildsystems_init {
            "l" => \$opt_list,
            "list" => \$opt_list,
 
+           "parallel" => sub { $max_parallel = -1 },
            "max-parallel=i" => \$max_parallel,
        );
        $args{options}{$_} = $options{$_} foreach keys(%options);
index 29687adc1776847ac8f7a11c04100645327088e6..19d1d497481ae514619f1c481fa6bcc83360d984 100644 (file)
@@ -217,20 +217,24 @@ 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<--max-parallel>I<=maximum>
-
-This option allows controlling how many parallel jobs can be used in a
-build, if parallel builds are enabled by the DEB_BUILD_OPTIONS environment
-variable.
+=item B<--parallel>
 
-If set to 1, parallel 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.
+Enable support for parallel builds if underlying build system provides this
+feature. The number of parallel processes is controlled by the
+DEB_BUILD_OPTIONS environment variable (L<Debian Policy, section 4.9.1>) at
+build time. It might also be subject to the build system specific limit.
 
 If this option is not specified, debhelper currently defaults to not
 supporting parallel package builds.
 
+=item B<--max-parallel>I<=maximum>
+
+This option implies L<--parallel> and allows to further limit the number of
+jobs that can be used in a parallel build. If the package build is known to
+only work with certain levels of concurrency, you can set this to the maximum
+level that is known to work, or that you wish to support. If set to 1, parallel
+builds will be effectively forbidden.
+
 =item B<--list>, B<-l>
 
 List all build systems supported by debhelper on this system. The list
index 1a9e21ca3508b4b81bf160c64dce310d8b1b936d..e69367ed79ed827812578e2a823581ffebd3ee68 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use Test::More tests => 291;
+use Test::More tests => 295;
 
 use strict;
 use warnings;
@@ -572,21 +572,27 @@ sub test_is_parallel {
 
 test_isnt_parallel( do_parallel_mk(),
        "No parallel by default" );
+test_isnt_parallel( do_parallel_mk("parallel"),
+       "No parallel by default with --parallel" );
+test_isnt_parallel( do_parallel_mk("--max-parallel=5"),
+       "No parallel by default with --max-parallel=5" );
 
 $ENV{DEB_BUILD_OPTIONS}="parallel=5";
 test_isnt_parallel( do_parallel_mk(),
-       "DEB_BUILD_OPTIONS=parallel=5 without --max-parallel" );
+       "DEB_BUILD_OPTIONS=parallel=5 without parallel options" );
++test_is_parallel( do_parallel_mk("--parallel"),
++      "DEB_BUILD_OPTIONS=parallel=5 with --parallel" );
 test_is_parallel( do_parallel_mk("--max-parallel=2"),
        "DEB_BUILD_OPTIONS=parallel=5 with --max-parallel=2" );
 test_isnt_parallel( do_parallel_mk("--max-parallel=1"),
-       "DEB_BUILD_OPTIONS=parallel=5 with --max-parallel=1 (off)" );
+       "DEB_BUILD_OPTIONS=parallel=5 with --max-parallel=1" );
 
 $ENV{MAKEFLAGS} = "--jobserver-fds=105,106 -j";
 $ENV{DEB_BUILD_OPTIONS}="";
-test_isnt_parallel( do_parallel_mk("--max-parallel=5"),
+test_isnt_parallel( do_parallel_mk(),
        "makefile.pm (no parallel): no make warnings about unavailable jobserver" );
 $ENV{DEB_BUILD_OPTIONS}="parallel=5";
-test_is_parallel( do_parallel_mk("--max-paralle=5"),
+test_is_parallel( do_parallel_mk("--parallel"),
        "DEB_BUILD_OPTIONS=parallel=5: no make warnings about unavail parent jobserver" );
 
 $ENV{MAKEFLAGS} = "-j2";