Repository navigation
pkg_rpm: add autoreqprov attribute - #1100
Merged
Merged
Conversation
Contributor
Author
|
Interactions with reviewers will be handled by a human |
chouquette
marked this pull request as ready for review
November 17, 2026 15:23
gh-worker-dd-mergequeue-cf854d Bot
pushed a commit
to DataDog/datadog-agent
that referenced
this pull request
Nov 18, 2026
### What does this PR do? Speeds up the `MakeRpm` step of the Bazel rpms: the agent rpm goes from about 12 to under 5 minutes locally. - Bump rules_pkg to pick up the new `autoreqprov` attribute (bazelbuild/rules_pkg#1100) and the batched `%install` commands (bazelbuild/rules_pkg#1101). - Use `autoreqprov = False` (bazelbuild/rules_pkg#1100) to set `AutoReqProv: no`, like omnibus does, instead of filtering the generated dependencies afterwards. - Skip the steps rpmbuild runs after `%install` (`brp-strip`, `brp-compress`, ...), like omnibus does. | Before | After | | --- | --- | | rpmbuild scans every packaged file for dependencies, then `__requires_exclude`/`__provides_exclude` discard them all | No scan; same Requires and Provides | | `%install` runs `install`, `cp` and `chmod` for each file | Commands are batched per directory | | dogstatsd, ddot, installer and iot rpms go through `brp-*` steps | Skipped, as for the agent rpm (whose `__strip` override is removed) and in omnibus | Unchanged: omnibus packages, and the agent rpm's metadata and file list. ### Motivation `MakeRpm` took 736s of a local agent rpm build, mostly spent generating dependencies we then threw away. ### Describe how you validated your changes Built the agent rpm locally: `MakeRpm` went from 736s to 285s, with identical Requires, Provides, Conflicts and file list. Co-authored-by: hugo.beauzee <[email protected]>
aiuto
approved these changes
Nov 18, 2026
cgrindel
approved these changes
Nov 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Unless the spec sets
AutoReqProv: no, rpmbuild runs its dependency generators on every packaged file.For packages that declare their dependencies explicitly this is wasted work: on a package with about 16k
files it took 6 of the 9 minutes of the rpmbuild run. Filtering the result with
__requires_excludeand__provides_excludedoes not avoid it, since the generators still run.Add an
autoreqprovattribute topkg_rpm. It defaults to True, matching rpm's default. When False, the spec preamble getsAutoReqProv: no.Relates to #935.