Wiki - https://fedoraproject.org/wiki/Changes/Package_specific_RPM_Macros_For_Build_Flags Discussion thread - https://discussion.fedoraproject.org/t/f43-change-proposal-package-specific-rpm-macros-for-build-flags-system-wide/154987
This is a proposed Change for Fedora Linux. This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee. == Summary == Create "extra flag" macros to make it easier for packages to add to the default list of compiler flags. This is a follow up to the: https://fedoraproject.org/wiki/Changes/RPMMacrosForBuildFlags == Owner == * Name: [[User:mschorm| Michal Schorm]] * Email: msch...@redhat.com == Detailed Description == The macros file in the redhat-rpm-config package contains a list of default compiler flags for packages to use when compiling C, C++, and Fortran packages. This change will add new macros to redhat-rpm-config which will make it easier for packages to add their own compiler flags. The proposed macros for adding new flags are: %_pkg_extra_cflags %_pkg_extra_cxxflags %_pkg_extra_fflags %_pkg_extra_ldflags These will be added to %{build_cflags}, %{build_cxxflags}, %{build_fflags}, and %{build_ldflags} respectively to allow packages to add their own flags to the default list: e.g. %build_cflags %{optflags} %{_pkg_extra_cflags} Note: <br />This is a followup for the previously accepted change: <br />https://fedoraproject.org/wiki/Changes/RPMMacrosForBuildFlags <br />that was implemented as: <br />https://src.fedoraproject.org/rpms/redhat-rpm-config/c/198872?branch=rawhide <br />but later changed to: <br />https://src.fedoraproject.org/rpms/redhat-rpm-config/c/e0e097?branch=rawhide My goal is to re-implement the original solution, which would create the _pkg_extra macros, to grant the package maintainers an elegant, clean and simple way to make the per-package adjustments to the build flags. Currently, this is done by editing the CFLAGS etc. environmental variables directly and re-exporting them. That sometimes cause issues that could be avoided by using macro instead. Also, when set by macro, the flags adjustment will be present in every '%set_build_flags' call, not just in-between of the manual adjustment and the end of the RPMbuild phase (%build, %install, %check, etc.). == Feedback == == Benefit to Fedora == * It will provide a standard way to add to the list of default compiler flags. * It will make it easier to determine which packages add compiler flags by doing a simple grep of the spec files. * It will make it easier for toolchain developers to experiment with adding new flags to the distribution as this can be done with a simple macro definition instead of patching redhat-rpm-config. == Scope == * Proposal owners: ** Proposal owners will update the redhat-rpm-config package and add the new macros. ** Proposal owners will test the changes to ensure that the correct flags are still being used. * Other developers: ** Other developers may, but are not required to, update their packages to use the new macros. * Release engineering: [https://pagure.io/releng/issues #Releng issue number] * Policies and guidelines: N/A (not needed for this Change) ** The https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/buildflags.md will be updated to document this macro ** The Fedora packaging policy will be updated to state that packages that want to use additional flag '''SHOULD''' use the new macros. * Trademark approval: N/A (not needed for this Change) * Alignment with the Fedora Strategy: == Upgrade/compatibility impact == None. == Early Testing (Optional) == Do you require 'QA Blueprint' support? Y/N == How To Test == * This can be tested by inspecting the value of the %{build_cflags}, %{build_cxxflags}, %{build_fflags}, and %{build_ldflags} and ensuring they are the same before and after the change. * This can be tested by modifying some of the new macros in a spec file and ensuring that the changes appear in the appropriate macro mentioned above. == User Experience == This is a change for developers and will have no impact to the user experience. == Dependencies == A PR must be approved and merged to the 'redhat-rpm-config' package. A PR must be approved and merged to the Fedora Packaging Guidelines. == Contingency Plan == * Contingency mechanism: Change owner will revert the update to redhat-rpm-config. * Contingency deadline: Beta freeze * Blocks release? No == Documentation == need to be done N/A (not a System Wide Change) == Release Notes == None. -- Aoife Moloney Fedora Operations Architect Fedora Project Matrix: @amoloney:fedora.im IRC: amoloney -- _______________________________________________ devel-announce mailing list -- devel-annou...@lists.fedoraproject.org To unsubscribe send an email to devel-announce-le...@lists.fedoraproject.org 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/devel-annou...@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue -- _______________________________________________ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org 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/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue