Re: Bug#822728: RFS: libtcod/1.6.0~pre1+dfsg-1 [ITP] -- graphics and utility library for roguelike developers
- To: debian-mentors@lists.debian.org
- Subject: Re: Bug#822728: RFS: libtcod/1.6.0~pre1+dfsg-1 [ITP] -- graphics and utility library for roguelike developers
- From: Jakub Wilk <jwilk@debian.org>
- Date: Sun, 1 May 2016 19:45:50 +0200
- Message-id: <[🔎] 20160501174550.GA5270@jwilk.net>
- Mail-followup-to: debian-mentors@lists.debian.org
- In-reply-to: <20160427161324.GC5179@angband.pl>
- References: <20160426202232.GA25364@localhost.localdomain> <20160427032737.GA15770@angband.pl> <20160427094022.GA5411@jwilk.net> <20160427100214.GC13534@angband.pl> <20160427104059.GA4939@jwilk.net> <20160427161324.GC5179@angband.pl>
* Adam Borowski <kilobyte@angband.pl>, 2016-04-27, 18:13:
For pre-squeeze, there's "getconf _NPROCESSORS_ONLN".
At least one Debian derivative, Dyson, has:
draconis:[~]$ dpkg --print-architecture
illumos-amd64
draconis:[~]$ getconf _NPROCESSORS_ONLN
getconf: Invalid argument (_NPROCESSORS_ONLN)
That's odd.
so let's not advertise getconf, as -j`something with no stdout output`
results in a fork bomb.
I was always baffled with the semantics of make's argumentless -j. Why
would anyone want this behavior? :-\
Anyway, I'd expect any decent DEB_BUILD_OPTIONS parser to reject the
bogus "parallel=".
For example, debhelper does it right:
if ($opt =~ /^parallel=(-?\d+)$/ && $wanted eq 'parallel') {
return $1;
}
[Optional minus sign is to support CPUs made of antimatter.]
The snippet I've been using in my d/rules is also immune to accidental
lone -j:
parallel = -j$(or $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))),1)
...
$(MAKE) $(parallel)
Unfortunately, the snippet Policy §4.9.1 recommends is forkbomb-prone:
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
--
Jakub Wilk
Reply to: