We'd like portage to provide a sane default with of the "makeopts",
i.e., the maximum number of parallel jobs (--jobs) and the maximum
load average (--load-average) that build systems should try to
establish at once.

However, while --jobs is a pretty standard feature for Make-ish build
systems, --load-average is not. For example, it is not provided by BSD
Make. As such, it was decided that portage should set --load-average
in GNUMAKEFLAGS, instead of MAKEOPTS (see
https://marc.info/?l=gentoo-dev&m=169027605717531&w=2 and
https://github.com/gentoo/portage/pull/1072).

As a result, the multiprocessing.eclass should now also try to extract
the value for --jobs and --load-average not only from MAKEOPTS, but
also from (GNU)MAKEFLAGS.

While we add it, we also overhaul multiprocessing.eclass's API by
providing two new simple methods to extract the values:
get_multiprocessing_jobs() and get_multiprocessing_loadavg().

PR at https://github.com/gentoo/gentoo/pull/32385

Florian Schmaus (3):
  multiprocessing.eclass: consider (GNU)MAKEFLAGS, add
    get_makeopts_{jobs,loadavg}
  ninja-utils.eclass: use get_makeopts_{jobs,loadavg}
  meson.eclass: use get_makeopts_{jobs,loadavg}

 eclass/meson.eclass                           |  4 +-
 eclass/multiprocessing.eclass                 | 40 ++++++++++++++++---
 eclass/ninja-utils.eclass                     |  3 +-
 eclass/tests/multiprocessing_makeopts_jobs.sh | 24 ++++++++++-
 4 files changed, 61 insertions(+), 10 deletions(-)

-- 
2.41.0


Reply via email to