Skip to content
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

Update experimental pkg_rpm rule to use new mapping/grouping providers #303

Merged
merged 1 commit into from
Mar 8, 2021

Conversation

nacl
Copy link
Collaborator

@nacl nacl commented Feb 25, 2021

This change replaces the experimental pkg_rpm rule in pkg/experimental/rpm.bzl
rule with one that is aware of the grouping rule structure. This will soon become the
primary pkg_rpm rule made available to users.

Changes made to the experimental/ tree include:

  • Usage of new providers and different paths everywhere

  • Restructuring of how the %files metadata is built out. It was restructured
    for clarity, and now makes use of the new rpm_filetag mapping attribute
    instead of section, which was since removed.

  • Inputs to pkg_rpm are now specified with the srcs attribute instead of
    data, to be consistent between runtime requirements and compile-time sources.

  • Conflicting content error detection and emission is now streamlined.

  • Test coverage has improved, including new analysis tests for conflict
    detection, and bugs in the RPM python tests.

The old pkg_filegroup code in this same directory will be removed in a
separate change.


This particular implementation of pkg_rpm has some known defects and missing features. These are tracked in #300, and will be fixed opportunistically.

@nacl nacl requested a review from aiuto February 25, 2021 23:06
nacl pushed a commit to nacl/rules_pkg that referenced this pull request Feb 25, 2021
This change provides a number of unit tests for the pkg_filegroup-using
`pkg_rpm` rule, meant to ensure that packages are formed as expected and
conflict detection is properly implemented.

The main differences between these and the tests in experimental/tests are:

- Analysis tests for conflict detection
- Fixed bugs WRT contents detection
- Path changes

This is likely not the final destination for these test cases, and they be
combined with the rules implementation, depending on the size of the diff.  See
bazelbuild#303 for more details.
@nacl nacl force-pushed the topic/pkg_rpm-new branch from fe5cb1f to a91572b Compare March 2, 2021 18:23
@nacl nacl changed the title Provide "official" pkg_filegroup-using RPM rule Update experimental pkg_rpm rule to use new mapping/groupingg providers Mar 2, 2021
@nacl nacl changed the title Update experimental pkg_rpm rule to use new mapping/groupingg providers Update experimental pkg_rpm rule to use new mapping/grouping providers Mar 2, 2021
@nacl nacl marked this pull request as ready for review March 2, 2021 18:25
@nacl
Copy link
Collaborator Author

nacl commented Mar 2, 2021

The latest force-push to a91572b is ready for review.

@nacl
Copy link
Collaborator Author

nacl commented Mar 3, 2021

@aiuto Did you mean to approve this one or #293 (pkg_mklinks/pkg_filegroup)?

@aiuto
Copy link
Collaborator

aiuto commented Mar 4, 2021

I meant this one. It seemed self contained in trying update the experimental parts.
The other one merits a closer look, so I didn't have time to do that quickly.

This change replaces the experimental `pkg_rpm` rule in `pkg/experimental/rpm.bzl`
rule with one that is aware of the grouping rule structure.

- Usage of new providers and different paths everywhere

- Restructuring of how the `%files` metadata is built out.  It was restructured
  for clarity, and now makes use of the new `rpm_filetag` mapping attribute
  instead of `section`, which was since removed.

- Inputs to `pkg_rpm` are now specified with the `srcs` attribute instead of
  `data`, to be consistent between runtime requirements and compile-time sources.

- Conflicting content error detection and emission is now streamlined.

- Test coverage has improved, including new analysis tests for conflict
  detection, and bugs in the RPM python tests.

The old `pkg_filegroup` code in this same directory will be removed in a
separate change
@nacl nacl force-pushed the topic/pkg_rpm-new branch from a91572b to 01bcd71 Compare March 8, 2021 21:01
@nacl
Copy link
Collaborator Author

nacl commented Mar 8, 2021

Latest force push syncs this PR with main. Will be merging shortly.

@nacl nacl merged commit 30cd6d4 into bazelbuild:main Mar 8, 2021
@nacl nacl deleted the topic/pkg_rpm-new branch March 22, 2021 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants