Repository navigation
pkg_rpm: reserve local resources for threaded payload compression - #1094
Open
chouquette wants to merge 1 commit into
Open
chouquette wants to merge 1 commit into
chouquette wants to merge 1 commit into
Conversation
chouquette
marked this pull request as ready for review
November 4, 2026 10:35
gh-worker-dd-mergequeue-cf854d Bot
pushed a commit
to DataDog/datadog-agent
that referenced
this pull request
Nov 5, 2026
### What does this PR do? Sets the rpm payload compression in `dd_pkg_rpm` to xz: level 9 when `//:is_release` is set and level 5 otherwise. Packages can no longer override it. Also enable multi threaded compression. ### Motivation The omnibus rpms are xz-compressed (they require `rpmlib(PayloadIsXz)`), unlike the Bazel ones. The package parity check (#58991) reports the difference. The levels mirror omnibus, using the release flag as the replacement for its deploy detection. This PR is stacked on the release opt-in PR (#59217), so that regular builds default to level 5. ### Describe how you validated your changes Built a small rpm through `dd_pkg_rpm`: xz level 5 by default and level 9 with `--config=release`. Both require `rpmlib(PayloadIsXz)`. ### Additional notes bazelbuild/rules_pkg#1094 is related so that we can avoid overcommiting on resources. In our case, since packaging are usually the last actions, we shouldn't notice much difference though. Co-authored-by: hugo.beauzee <hugo.beauzee@datadoghq.com>
This branch has not been deployed
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.
binary_payload_compressionaccepts rpm's threaded payload modes such asw9T8.xzdio, butMakeRpmalways runs with Bazel's default reservation of one CPU, which the attribute documentation warns about.This derives a
resource_setforMakeRpmfrom the compression value when it requests an explicit thread count:Values without an explicit thread count keep the current behavior.
resource_setcallbacks have to be top-level functions and cannot be parameterized, which is why the supported thread counts are enumerated.Tested by building two
w6T8.xzdiorpms with--local_resources=cpu=8: the secondMakeRpmwaits for the first one, while two single-threaded rpms still run in parallel.