I would like to fix the limit_build rpm macro in order to make it easier
to share packages with opensuse.
opensuse provides a build macro, limit_build, which limits the number of
parallel jobs based on an expected per-job memory requirement. The
effect of the macro is to define globals: jobs, _smp_mflags, and
_smp_build_ncpus [1]
In 2021, for Fedora 35, a change was approved to provide a similar macro
in Fedora. In that proposal, it was suggested that by "keeping the
user-facing API aligned with what openSUSE is using, we open up the
possibility to collaborate with them" [2]
Fedora now has a build-constraints-rpm-macros package that defines
limit_build, which is mostly compatible with opensuse's, except that it
only defines the global, _smp_build_ncpus [3]
However, that package cannot be installed because of a file conflict
with redhat-rpm-config. [4]
macros.build-constraints was added to redhat-rpm-config shortly after
the change was approved. Initially, the limit_build macro was compatible
with opensuse's, but it was later replaced with a version that isn't
compatible with the one used in opensuse, (it merely outputs a set of
arguments for make_build), because its implementation mixed shell and
rpm macro constructs, making it fragile. [5]
redhat-rpm-config now also provides a macro, constrain_build, that
doesn't mix shell and macro constructs, and is largely compatible with
opensuse's limit_build macro (except that it only defines
_smp_build_ncpus) [6]
In order to promote collaboration with opensuse, I think we should
delete the build-constraints-rpm-macros package, drop
redhat-rpm-config's incompatible limit_build, define limit_build as an
alias for constrain_build (if possible),
and patch the handful of packages that are using the current limit_build
to add arguments to make_build
1:
https://src.opensuse.org/nodejs/memory-constraints/src/branch/main/memory-constraints.macros
2: https://fedoraproject.org/wiki/Changes/MemoryConstraintsMacros
3:
https://src.fedoraproject.org/rpms/build-constraints-rpm-macros/blob/rawhide/f/macros.build-constraints
4: https://bugzilla.redhat.com/show_bug.cgi?id=2090921
5: https://bugzilla.redhat.com/show_bug.cgi?id=1988902
6:
https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/macros.build-constraints
--
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it:
https://pagure.io/fedora-infrastructure/new_issue