All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] use nproc
@ 2016-12-30 20:14 Rob Landley
  2016-12-30 20:46 ` Peter Korsgaard
  2017-01-01  8:30 ` Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Rob Landley @ 2016-12-30 20:14 UTC (permalink / raw)
  To: buildroot

My rule of thumb is that once a change is 7 years old, you can rely on
the installed base to have it. With that in mind, would you like to use
nproc to check how many processors are available?

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f

diff --git a/package/Makefile.in b/package/Makefile.in
index afd5d3a..5eed804 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -12,7 +12,7 @@ HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
 # If the number of processors is not available, assume one.
 ifeq ($(BR2_JLEVEL),0)
 PARALLEL_JOBS := $(shell echo \
-	$$((1 + `getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1`)))
+	$$((1 + `nproc 2>/dev/null || echo 1`)))
 else
 PARALLEL_JOBS := $(BR2_JLEVEL)
 endif

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] use nproc
  2016-12-30 20:14 [Buildroot] [PATCH] use nproc Rob Landley
@ 2016-12-30 20:46 ` Peter Korsgaard
  2017-01-01  8:32   ` Thomas Petazzoni
  2017-01-01  8:30 ` Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2016-12-30 20:46 UTC (permalink / raw)
  To: buildroot

>>>>> "Rob" == Rob Landley <rob@landley.net> writes:

 > My rule of thumb is that once a change is 7 years old, you can rely on
 > the installed base to have it. With that in mind, would you like to use
 > nproc to check how many processors are available?

 > http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f

Why? What is the advantage? Purely cosmetical? Are there any well known
distributions providing nproc and not getconf?

 > diff --git a/package/Makefile.in b/package/Makefile.in
 > index afd5d3a..5eed804 100644
 > --- a/package/Makefile.in
 > +++ b/package/Makefile.in
 > @@ -12,7 +12,7 @@ HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
 >  # If the number of processors is not available, assume one.
 >  ifeq ($(BR2_JLEVEL),0)
 >  PARALLEL_JOBS := $(shell echo \
 > -	$$((1 + `getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1`)))
 > +	$$((1 + `nproc 2>/dev/null || echo 1`)))
 >  else
 >  PARALLEL_JOBS := $(BR2_JLEVEL)
 >  endif


 > _______________________________________________
 > buildroot mailing list
 > buildroot at busybox.net
 > http://lists.busybox.net/mailman/listinfo/buildroot

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] use nproc
  2016-12-30 20:14 [Buildroot] [PATCH] use nproc Rob Landley
  2016-12-30 20:46 ` Peter Korsgaard
@ 2017-01-01  8:30 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2017-01-01  8:30 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 30 Dec 2016 14:14:46 -0600, Rob Landley wrote:
> My rule of thumb is that once a change is 7 years old, you can rely on
> the installed base to have it. With that in mind, would you like to use
> nproc to check how many processors are available?
> 
> http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f

This patch lacks your Signed-off-by line, so we can't apply it as-is.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] use nproc
  2016-12-30 20:46 ` Peter Korsgaard
@ 2017-01-01  8:32   ` Thomas Petazzoni
  2017-01-01  9:46     ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2017-01-01  8:32 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 30 Dec 2016 21:46:43 +0100, Peter Korsgaard wrote:

>  > My rule of thumb is that once a change is 7 years old, you can rely on
>  > the installed base to have it. With that in mind, would you like to use
>  > nproc to check how many processors are available?  
> 
>  > http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f  
> 
> Why? What is the advantage? Purely cosmetical? Are there any well known
> distributions providing nproc and not getconf?

Well, the simplification provided by Rob looks useful to me. It's
purely cosmetic, but we also do tons of other cosmetic changes.

The big question is whether nconf is available even in the really old
RHEL distros that some of our users have.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH] use nproc
  2017-01-01  8:32   ` Thomas Petazzoni
@ 2017-01-01  9:46     ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2017-01-01  9:46 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Hello,
 > On Fri, 30 Dec 2016 21:46:43 +0100, Peter Korsgaard wrote:

 >> > My rule of thumb is that once a change is 7 years old, you can rely on
 >> > the installed base to have it. With that in mind, would you like to use
 >> > nproc to check how many processors are available?  
 >> 
 >> > http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commit;h=74cf4cb26dcecd36eb45dc00dbd4587d9dc24a2f  
 >> 
 >> Why? What is the advantage? Purely cosmetical? Are there any well known
 >> distributions providing nproc and not getconf?

 > Well, the simplification provided by Rob looks useful to me. It's
 > purely cosmetic, but we also do tons of other cosmetic changes.

True, but for stuff depending on the details of the host OS we need to
be careful, so it is interesting to know if this change is NEEDED
somewhere, or just a nice-to-have cleanup thing.

 > The big question is whether nconf is available even in the really old
 > RHEL distros that some of our users have.

Indeed, this was the kind of details I was missing in the commit
description.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-01  9:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-30 20:14 [Buildroot] [PATCH] use nproc Rob Landley
2016-12-30 20:46 ` Peter Korsgaard
2017-01-01  8:32   ` Thomas Petazzoni
2017-01-01  9:46     ` Peter Korsgaard
2017-01-01  8:30 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.