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

Bug#740397: busybox: please add support for parallel building



Control: tag -1 + pending

01.03.2014 12:01, Michael Tokarev wrote:
> 01.03.2014 06:17, Cyril Brulebois wrote:
>> Package: busybox
>> Version: 1:1.20.0-7
>> Severity: normal
>> Tags: patch
>>
>> Hi,
>>
>> the title and the attached patch say it all.
> 
> Oh well.
> 
> This come several times in the past for various packages, and it always
> ends up in some strange place.
> 
> I always build my packages in parallel mode locally and ofcourse
> ensure they build fine that way.  Because, well, I dislike waiting
> for too long when my machine have many cores doing nothing.
> 
> The way I alway do this is by passing -jX flag to dpkg-buildpackage,
> sbuild, or just ./d/rules -jX, and so on.  This ends up being a flag
> for the top-level make (which calls d/rules) so the job server becomes
> global. It is the easiest and most strightforward way.
> 
> Now, when adding support for DEB_BUILD_OPTIONS's parallel=X suboption,
> I always end up in either my packages building in just one thread
> (because I still haven't figured how to pass environment variables to
> sbuild for example), or I have to use a non-easy, much more verbose
> way to run dpkg-buildpackage (setting DEB_BUILD_OPTIONS= instead of
> just passing -j).  Because DEB_BUILD_OPTIONS handling, at the end,
> overrides -j somehow.
> 
> The way how you proposed to fix your initial proposal -- add
> "else\nNUMJOBS = 1" -- makes this obvious, -- no matter what -jX
> is passed to the top-level, the build will be done according to
> DEB_BUILD_OPTS (whenever it is set or unset).
> 
> I asked about this several times on #irc but got no good answer.
> And after some tries I ended up in what we have now, -- I just ignore
> DEB_BUILD_OPTIONS, because I try to build the package much more
> often than it is built on buildds, and I want the process to be
> easiest for me not for machines, and I value my own time much more
> than CPU time of debian buildd network (even of the slowest machines
> in there).

Ok.  After looking around I found a recipe which I used in other
packages to satisfy both those requiriments:

# support parallel build using DEB_BUILD_OPTIONS=parallel=N
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  MAKEFLAGS += \
    -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif

(which is quite similar to what the debian policy says), and it
appears to work.  So I've added the same to busybox d/rules and
it at least continues to work with -jN, so I know that my way
of doing things hasn't broke, which is good.

Other related topics (how to pass DEB_BUILD_OPTIONS or anything
else to sbuild, or how to make simple -j work together with this
DEB_BUILD_OPTIONS in dh-style d/rules etc), while related, are
not holding this bug in any way.

Thanks,

/mjt


Reply to: