[packages/rpm-pld-macros] Use existing __smp_use_ncpus. We stop doing /2 as this was introduced in 2012 to not hog machines at

Jan Palus atler at pld-linux.org
Tue Sep 1 18:58:27 CEST 2026


On 16.04.2026 08:59, arekm wrote:
> commit 545922059f7a256c6aab4cdbff3900052be55a10
> Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
> Date:   Thu Apr 16 08:59:13 2026 +0200
> 
>     Use existing __smp_use_ncpus. We stop doing /2 as this was introduced in 2012 to not hog machines at that time. We also get capability of limiting max cpus via _smp_ncpus_max
> 
>  macros.pld          | 4 +++-
>  rpm-pld-macros.spec | 2 +-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> ---
> diff --git a/rpm-pld-macros.spec b/rpm-pld-macros.spec
> index 50746f4..e14521b 100644
> --- a/rpm-pld-macros.spec
> +++ b/rpm-pld-macros.spec
> @@ -1,4 +1,4 @@
> -%define		rpm_macros_rev	2.059
> +%define		rpm_macros_rev	2.060
>  %define		find_lang_rev	1.42
>  # split into individual X_prov_ver if there is a reason to desync
>  %define		prov_ver	4.15
> diff --git a/macros.pld b/macros.pld
> index 5b6e48b..56b49f2 100644
> --- a/macros.pld
> +++ b/macros.pld
> @@ -224,7 +224,9 @@ pakietu oraz przy odpluskwianiu samego pakietu.\
>  #
>  # if you want to disable parallel build do:
>  # echo '%__jobs %{nil}' >> ~/.rpmmacros
> -%__jobs		%{expand:%%global __jobs %(_NCPUS=$(/usr/bin/getconf _NPROCESSORS_ONLN); [ "$_NCPUS" -gt 3 ] && echo $(($_NCPUS / 2)))%%{nil}}%__jobs
> +#
> +# to cap parallelism in a spec: %define _smp_ncpus_max 16
> +%__jobs		%{expand:%%global __jobs %{__smp_use_ncpus}}%__jobs
>  %_smp_build_ncpus %{__jobs}
>  %_smp_build_nthreads %{__jobs}

for it to actually work on builders we'd probably need to change builder
scripts too from current:

rpmbuild -bb --define '__jobs 28' --define '_smp_mflags -j28' ...

to something like (not sure how's env handled exactly):

RPM_BUILD_NCPUS=28 rpmbuild -bb ...


More information about the pld-devel-pl mailing list