public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michel Lind <salimma@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/folly-rpm-macros] f43: Take the job count from %limit_build's output instead of running it
Date: Fri, 18 Sep 2026 21:59:53 GMT [thread overview]
Message-ID: <178976879322.1.11039565372430355978.rpms-folly-rpm-macros-5e292e9c2dc1@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/folly-rpm-macros
Branch : f43
Commit : 5e292e9c2dc1300c54757bc46b4ec64c6cacbbb2
Author : Michel Lind <salimma@fedoraproject.org>
Date : 2026-09-18T21:58:14+01:00
Stats : +10/-2 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/folly-rpm-macros/c/5e292e9c2dc1300c54757bc46b4ec64c6cacbbb2?branch=f43
Log:
Take the job count from %limit_build's output instead of running it
%limit_build prints "-jN" when memory allows fewer jobs than
%_smp_build_ncpus and nothing otherwise; it is meant to follow a make
command and never changes %_smp_build_ncpus. %getdeps_build used it as
a statement, so wherever memory was the tighter limit the -jN landed in
%build as a command:
+ -j20
/var/tmp/rpm-tmp.lwmmwp: line 32: -j20: command not found
cachelib failed this way on F45 (task 150375236: 48-CPU builder, memory
for 20 jobs of 3072 MiB) and F44 (task 150374560). It passed on Rawhide
and in local mock only because those machines had fewer CPUs than
memory-limited jobs, so the macro printed nothing.
%__getdeps_num_jobs evaluates %limit_build and takes N from its output,
falling back to %_smp_build_ncpus, and %__getdeps_common_opts passes it
to --num-jobs. Checked with rpm --load: 4 CPUs and 23 GiB give 4, 2 and
1 jobs for weights of 3072, 8192 and 20000 MiB; 48 CPUs on the same
memory give 7; without %limit_build defined, %_smp_build_ncpus.
Assisted-by: Claude Code:claude-fable-5-1
Signed-off-by: Michel Lind <salimma@fedoraproject.org>
---
diff --git a/macros.folly-rpm b/macros.folly-rpm
index cf8e231..00c3510 100644
--- a/macros.folly-rpm
+++ b/macros.folly-rpm
@@ -48,6 +48,15 @@
# fbthrift manifests (measured p99 2.6 GiB, max 4 GiB).
%getdeps_job_weight_mib 3072
+# Number of getdeps jobs: %%limit_build prints "-jN" when memory allows fewer
+# jobs than %%_smp_build_ncpus and nothing otherwise (it is meant to follow a
+# make command), so take N from it when present.
+%__getdeps_num_jobs %{lua:
+ local j = rpm.expand("%{?limit_build:%{limit_build -m %{getdeps_job_weight_mib}}}")
+ j = (j:gsub("^%s*%-j", "")):gsub("%s+$", "")
+ if j == "" then j = rpm.expand("%{_smp_build_ncpus}") end
+ print(j)}
+
# A getdeps package ships executables. The vendored stack is linked
# statically into them, and %%getdeps_install removes the libraries, headers
# and CMake/pkg-config files the project installs. There is no shared-library
@@ -67,7 +76,7 @@
--allow-system-packages
--vendor-dir %{getdeps_vendor_dir}
--scratch-path %{getdeps_scratch_dir}
- --num-jobs %{_smp_build_ncpus}
+ --num-jobs %{__getdeps_num_jobs}
%{?getdeps_extra_cmake_defines:--extra-cmake-defines '{%{getdeps_extra_cmake_defines}}'}
}
@@ -83,7 +92,6 @@
# -t : also build the project's tests (for %%getdeps_test in %%check)
%getdeps_build(t) \
%set_build_flags \
-%{limit_build -m %{getdeps_job_weight_mib}} \
%{__getdeps} %{__getdeps_common_opts} build --free-up-disk %{!-t:--no-tests} --src-dir=. --project-install-prefix %{getdeps_project}:%{_prefix} %{getdeps_project}
# getdeps_install: install the project into %%{buildroot}. getdeps configured
reply other threads:[~2026-09-18 21:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178976879322.1.11039565372430355978.rpms-folly-rpm-macros-5e292e9c2dc1@fedoraproject.org \
--to=salimma@fedoraproject.org \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox