m (Ignatenkobrain moved page Changes/BuildRequires Generators to Changes/DynamicBuildRequires) |
No edit summary |
||
Line 1: | Line 1: | ||
= BuildRequires | = Dynamic BuildRequires = | ||
== Summary == | == Summary == | ||
Line 21: | Line 21: | ||
For many languages (Rust, Golang, Node.Js, Ruby, Python), BuildRequires can be automatically generated. All it takes, run some special tool which will output dependencies in RPM format. | For many languages (Rust, Golang, Node.Js, Ruby, Python), BuildRequires can be automatically generated. All it takes, run some special tool which will output dependencies in RPM format. | ||
=== rpmbuild === | |||
* New <code>%generate_buildrequires</code> section ("script" later in text) in spec file | |||
* New option <code>-br</code> which will run script, check dynamic BuildRequires | |||
** If all of them are satisfied, generate <code>src.rpm</code> | |||
** If some of them are not satisfied or <code>--nodeps</code> is present, generate <code>buildreqs.nosrc.rpm</code> | |||
* <code>src.rpm</code> produced by <code>rpmbuild -ba</code> will contain dynamic BuildRequires | |||
* Option <code>-bs</code> does not change behavior | |||
=== mock === | |||
* New option in config <code>dynamic_buildrequires</code> which controls support of new features | |||
* Support for rpmbuild changes if this option enabled | |||
== Benefit to Fedora == | == Benefit to Fedora == | ||
Line 42: | Line 45: | ||
== Scope == | == Scope == | ||
* Proposal owners: Implement support for a feature in RPM and mock | * Proposal owners: Implement support for a feature in RPM and mock. Make use of it in interested ecosystems. | ||
* Other developers: Maintainers of language stacks are advised to use this feature. | * Other developers: Maintainers of language stacks are advised to use this feature. | ||
* Release engineering: [https://pagure.io/releng/issue/8129 #8129] | * Release engineering: [https://pagure.io/releng/issue/8129 #8129] | ||
Line 53: | Line 56: | ||
== How To Test == | == How To Test == | ||
0. Make sure you have new <code>rpm-build</code> (OPTION 1) or <code>mock</code> (OPTION 2). | |||
1. Add <code>%generate_buildrequires</code> script into spec file which prints dependencies, remove static BuildRequires | |||
2. OPTION1: Run <code>rpmbuild -ba</code> with your usual workflow | |||
2. OPTION2: Run <code>mock -r fedora-rawhide-x86_64</code> with your usual workflow | |||
3. Check that your package builds fine, dependencies are getting checked/installed and final src.rpm contains generated BuildRequires | |||
1. | |||
2. | |||
--> | |||
== User Experience == | == User Experience == |
Revision as of 07:17, 12 April 2019
Dynamic BuildRequires
Summary
Add possibility to generate build-time dependencies within RPM spec file and teach RPM and mock how to handle this.
Owner
- Name: Igor Gnatenko, Florian Festi, Miroslav Suchý
- Email: ignatenkobrain@fedoraproject.org, ffesti@redhat.com, miroslav@suchy.cz
- Release notes owner:
Current status
- Targeted release: Fedora 31
- Last updated: 2019-04-12
- Tracker bug: <will be assigned by the Wrangler>
Detailed Description
For many languages (Rust, Golang, Node.Js, Ruby, Python), BuildRequires can be automatically generated. All it takes, run some special tool which will output dependencies in RPM format.
rpmbuild
- New
%generate_buildrequires
section ("script" later in text) in spec file - New option
-br
which will run script, check dynamic BuildRequires- If all of them are satisfied, generate
src.rpm
- If some of them are not satisfied or
--nodeps
is present, generatebuildreqs.nosrc.rpm
- If all of them are satisfied, generate
src.rpm
produced byrpmbuild -ba
will contain dynamic BuildRequires- Option
-bs
does not change behavior
mock
- New option in config
dynamic_buildrequires
which controls support of new features - Support for rpmbuild changes if this option enabled
Benefit to Fedora
Packagers won't have to pre-generate BuildRequires in the spec file which means it will be always updated (and correct) :
- Packagers can focus of making their packages better instead of spending all their packaging time copying BuildRequires from documentation and third party tools.
- BuildRequires are dropped as soon as they're no longer necessary
- Packages can be easily bumped without requiring a manual BuildRequires refresh
- BuildRequires and Requires generation can use similar utilities, making sure that the deps packages declare can also be used for second-level building. Packages no longer need to declare the deps of their second and n-th dependencies because someone forgot to declare them in the correct package.
Scope
- Proposal owners: Implement support for a feature in RPM and mock. Make use of it in interested ecosystems.
- Other developers: Maintainers of language stacks are advised to use this feature.
- Release engineering: #8129
- List of deliverables: N/A
- Policies and guidelines: Packaging Guidelines need to be updated with instructions how to use this feature.
- Trademark approval: N/A (not needed for this Change)
Upgrade/compatibility impact
Packagers and users who use repoquery might be affected (src.rpm might not contain generated dependencies).
How To Test
0. Make sure you have new rpm-build
(OPTION 1) or mock
(OPTION 2).
1. Add %generate_buildrequires
script into spec file which prints dependencies, remove static BuildRequires
2. OPTION1: Run rpmbuild -ba
with your usual workflow
2. OPTION2: Run mock -r fedora-rawhide-x86_64
with your usual workflow
3. Check that your package builds fine, dependencies are getting checked/installed and final src.rpm contains generated BuildRequires
User Experience
Users won't notice differences.
Dependencies
Required feature needs to be implemented in RPM and mock.
Contingency Plan
- Contingency mechanism: (What to do? Who will do it?) Proposal Owners might still ship feature disabled for Fedora buildsystem but have it available for end-users, and move full completion to the next release.
- Contingency deadline: Beta Freeze
- Blocks release? No.
- Blocks product? No.
Documentation
TBD.
Release Notes
TBD.