Repository navigation
rpm: Install BuildRequires from the spec #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e3065c2
rpm: Move the staging of a spec out of build.py
daandemeyer 29f95c8
rpm: Stage an in-place spec outside the checkout
daandemeyer 05711e9
rpm: Add a driver that queries the BuildRequires of a spec
daandemeyer 427aede
buildroot: Skip empty dependency solves
daandemeyer f73e245
rpm: Don't check rich BuildRequires for delivery
daandemeyer 724d7b8
rpm: Resolve in-place BuildRequires at build time
daandemeyer 0a5a077
rpm: Query the BuildRequires of a hand-written package
daandemeyer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| <!-- | ||
| SPDX-FileCopyrightText: Amutable GmbH <https://amutable.com/> | ||
| SPDX-License-Identifier: MPL-2.0 | ||
| --> | ||
|
|
||
| # Building RPM packages | ||
|
|
||
| `rpm.package()` builds RPM packages from a spec and its Source and Patch files. The importer declares the | ||
| packages that it brings in from a distribution; see [Maintaining packages](importer.md). | ||
|
|
||
| ## Building a package from a spec | ||
|
|
||
| Put the spec and the files that it names in the directory of the `BUCK` file or below it, and declare the | ||
| package: | ||
|
|
||
| ```starlark | ||
| load("@tine//package_system/rpm:defs.bzl", "rpm") | ||
|
|
||
| rpm.package( | ||
| name = "hello", | ||
| package = "hello", | ||
| spec = "hello/hello.spec", | ||
| srcs = ["hello/hello-2.12.3.tar.gz"], | ||
| buildroot = "catalog//:fedora.rawhide.buildroot", | ||
| release = "1", | ||
| source_date_epoch = 1754006400, | ||
| subpackages = ["hello"], | ||
| ) | ||
| ``` | ||
|
|
||
| `package` is the `Name:` of the spec, and `subpackages` lists the binary packages that the build produces. | ||
| Each subpackage is a sub-target, such as `:hello[hello]`. | ||
|
|
||
| ## Build dependencies | ||
|
|
||
| The build installs the BuildRequires of the spec over the shared base buildroot. `build_requires` lists | ||
| packages that the build installs before it reads the spec, such as tools or RPM macros that rpm needs to | ||
| parse the spec. Before the build, `rpmbuild -bd` checks the spec in that buildroot with the build's rpmbuild | ||
| options, so the spec's conditionals select the same BuildRequires as in the build. The build then installs | ||
| the BuildRequires that the buildroot lacks. | ||
|
|
||
| `rpmbuild -bd` runs `%generate_buildrequires` only when the buildroot contains every static BuildRequires | ||
| of the spec, and runs it once. For a spec with the script, list its static BuildRequires in | ||
| `build_requires`. If the script reports more packages once its first ones are installed, list those as | ||
| well. Otherwise the build fails with rpm's `Failed build dependencies:`. | ||
|
|
||
| Neither the check nor the build looks for the Source and Patch files of an in-place spec. The build only | ||
| fails if the spec reads a missing file, for example a Source that `%install` copies. | ||
|
|
||
| A package of an imported branch skips the check. It installs the BuildRequires that the importer recorded | ||
| in `build_requires`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.