rpm_pfg: allow multiple tree artifacts at the same destination#1053
Merged
aiuto merged 3 commits intobazelbuild:mainfrom Apr 22, 2026
Merged
rpm_pfg: allow multiple tree artifacts at the same destination#1053aiuto merged 3 commits intobazelbuild:mainfrom
aiuto merged 3 commits intobazelbuild:mainfrom
Conversation
cgrindel
reviewed
Apr 19, 2026
Collaborator
cgrindel
left a comment
There was a problem hiding this comment.
Looks reasonable. Is there a way to add a test for this?
aiuto
approved these changes
Apr 22, 2026
When two pkg_files targets both map a configure_make tree artifact (e.g. an include/ directory) to the same destination prefix, pkg_rpm was raising a hard error even though the file contents don't overlap. The duplicate-destination check was firing unconditionally before the src.is_directory branch, so two packages installing headers to embedded/include/ (from different subdirectories) would conflict. Move the dest_check_map conflict check inside the non-directory branch so that tree artifacts sharing a destination are treated as a merge rather than a conflict. Actual file-level collisions within those trees will be caught at install time by the underlying tooling.
Two TreeArtifacts mapping to the same destination directory should be permitted; their contents are merged by the installer. File-level conflicts are still caught naturally when the same destination file path is claimed by two different sources. This is the general-purpose counterpart of the rpm_pfg fix in 8f67a8a.
011cc9c to
0b5c59d
Compare
gh-worker-dd-mergequeue-cf854d Bot
pushed a commit
to DataDog/datadog-agent
that referenced
this pull request
Apr 23, 2026
### What does this PR do? Update rules_pkg to the latest commit on main ### Motivation This fixes potential conflicts when 2 targets attempt to create a similar folder hierarchy, even if the final files aren't overlapping See related PR: bazelbuild/rules_pkg#1053 ### Describe how you validated your changes ### Additional Notes Co-authored-by: hugo.beauzee <hugo.beauzee@datadoghq.com>
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.
When two pkg_files targets both map a configure_make tree artifact (e.g. an include/ directory) to the same destination prefix, pkg_rpm was raising a hard error even though the file contents don't overlap. The duplicate-destination check was firing unconditionally before the src.is_directory branch, so two packages installing headers to embedded/include/ (from different subdirectories) would conflict.
Move the dest_check_map conflict check inside the non-directory branch so that tree artifacts sharing a destination are treated as a merge rather than a conflict. Actual file-level collisions within those trees will be caught at install time by the underlying tooling.