[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#209008: parallel building: DEB_BUILD_OPTIONS or DEB_BUILD_OPTIONS_PARALLEL



Okay, I think we have a consensus at this point that this is the right
thing to do and that adding another flag to DEB_BUILD_OPTIONS is the best
way of implementing it.  For the time being, I'd like to keep discussion
of the flag to use separate from the general discussion of how the tags
should be formatted and what Makefile code we should recommend to parse
them.

Now, we need a wording proposal, and it should include a sample
implementation, which we can then later adjust based on the resolution of
Bug#430649.  Here's a first cut; please everyone comment and fine-tune.

--- orig/policy.sgml
+++ mod/policy.sgml
@@ -6466,6 +6466,20 @@
 		not be stripped from the binary during installation,
 		so that debugging information may be included in the package.
 	    </item>
+	    <tag>parallel=n</tag>
+	    <item>
+		This string means that the package should be built using
+		up to <tt>n</tt> parallel processes if the package build
+		system supports this.  It is up to the package maintainer
+		to decide whether the package build times are long enough
+		and the package build system is robust enough to make
+		supporting parallel builds worthwhile.
+		<footnote>
+		    Packages built with <tt>make</tt> can often implement
+		    this by passing the <tt>-jn</tt> option to
+		    <tt>make</tt>.
+		</footnote>
+	     </item>
 	  </taglist>
 	</p>
 
@@ -6490,6 +6504,10 @@
 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 INSTALL_PROGRAM += -s
 endif
+ifneq (,$(findstring parallel=,$(DEB_BUILD_OPTIONS)))
+NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+MAKEFLAGS += -j$(NUMJOBS)
+endif
 	  </example>
 	</p>
 
-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: