Skip to content

Commit

Permalink
Provide "official" pkg_filegroup-using RPM rule and tests (#303)
Browse files Browse the repository at this point in the history
This change replaces the experimental `pkg_rpm` rule in
`pkg/experimental/rpm.bzl` rule with one that is aware of the new
`pkg_filegroup` semantics in `pkg/mappings.bzl`, with the following additional
changes:

- The `%files` metadata build-out is made more clear.  Additionally, the
  `rpm_filetag` mapping rule attribute replaces the `section` value previously
  passed to `pkg_filegroup`.

- Inputs to `pkg_rpm` are now specified with the `srcs` attribute instead of
  `data`, to be consistent with regards to the nameing of runtime requirements
  and build-time sources.  This also matches the implementation of `pkg_tar` and
  `pkg_zip`; `pkg_deb` stilluses `data`.  These should all be made consistent at
  some point.

- Conflicting package contents detection and error logging is now streamlined.

- Test coverage has improved, including new analysis tests for conflict
  detection.  Also, bugs in the RPM python tests were fixed opportunistically.

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

Fixes to other known issues with this implementation of `pkg_rpm` were not
attempted, and are currently tracked in #300.
  • Loading branch information
Andrew Psaltis authored Mar 8, 2021
1 parent 8c22281 commit 30cd6d4
Show file tree
Hide file tree
Showing 5 changed files with 445 additions and 183 deletions.
26 changes: 24 additions & 2 deletions pkg/experimental/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

licenses(["notice"])
load("//:mappings.bzl", "pkg_filegroup", "pkg_files")
load(":rpm.bzl", "pkg_rpm")

exports_files(
glob([
"*.bzl",
]) + [
"template.spec.in",
]),
],
visibility = ["//visibility:public"],
)

Expand All @@ -32,3 +34,23 @@ filegroup(
],
visibility = ["//:__pkg__"],
)

pkg_files(
name = "artifacts",
srcs = [":template.spec.in"],
)

pkg_filegroup(
name = "usr_share_artifacts",
srcs = [":artifacts"],
)

pkg_rpm(
name = "example",
srcs = [":usr_share_artifacts"],
description = "Other example!",
license = "N/A",
release = "1",
summary = "Example!",
version = "1.0",
)
Loading

0 comments on commit 30cd6d4

Please sign in to comment.