On Wed, Dec 14, 2016 at 11:04 AM, Michał Górny <mgo...@gentoo.org> wrote: > On Wed, 14 Dec 2016 15:27:25 +0300 > Andrew Savchenko <birc...@gentoo.org> wrote: > >> On Tue, 13 Dec 2016 10:36:15 +0100 Michał Górny wrote: >> > + nproc=$(python -c 'import multiprocessing; >> > print(multiprocessing.cpu_count());' 2>/dev/null) >> >> This is not portable. E.g. paludis users can have python-less >> system. Adding dev-lang/python to DEPEND will be also a bad idea, >> since this is quite heavy dependency. > > You can bikeshed potential circumstances where it wouldn't work for > the next year. Which doesn't change that it would work quite reliably > for the most of Gentoo users. > >> Since on Linux boxes nproc is from coreutils, which is in @system, >> so looks like only *bsd setups are the problem. On FreeBSD > > ...and all other operating systems (see: Prefix). > >> sysctl -a | egrep -i 'hw.ncpu' > > I somehow doubt that would give me the expected number only, and I lack > a BSD install handy to test it.
$(sysctl -n hw.ncpu)