commit | f98a82173ee0abb2c7d925ace346a73a7628ec4f | [log] [tgz] |
---|---|---|
author | Andrew Psaltis <apsaltis@vmware.com> | Wed Feb 08 17:11:46 2023 -0500 |
committer | GitHub <noreply@github.com> | Wed Feb 08 17:11:46 2023 -0500 |
tree | 40d3bf61741a30e3be756feac8804c22a610a246 | |
parent | bf19e06e039ce3a6ff6552f62180938fbe3092c7 [diff] |
Genericize package manifest system and interface (#660) Genericize package manifest system and interface The current way that rules_pkg communicates with must packagers is using a manifest file, which is currently a JSON data structure based on a an array of arrays. While generally readable, it looks strange, as it was to reduce Bazel resource usage (JSON strings in memory). Further, our Python code is directly bound to this data structure format. However, if we want to add more or change this, it becomes cumbersome on both the Starlark and Python sides. This change alleviates concerns generally by: - Converting all manifests to a JSON "object" style, improving readability. Numerous golden tests were updated to support this. - Replace the `collections.namedtuple`-based `ManifestEntry` object with one that is a little more flexible and type-safe. - Providing a function (`read_entries_from`) that converts a file-like object into a list of `ManifestEntry`s, and replacing all JSON reading in packagers (`tar`, `zip`, `install`) and their tests with this function. Other convenience factors or things addressed: - `ManifestEntry.entry_type` is now just `ManifestEntry.type` - Bazel 6 now stringifies repository-local labels with a preceding `@`, unlike prior versions. Adapt to this in the manifest writer. Future changes will extend this interface to allow for custom attributes to be passed from `pkg_files` and friends, which, among other things, will be necessary to more generically support `pkg_rpm`. Provides groundwork for (but doesn't resolve) #385.
Bazel rules for building tar, zip, deb, and rpm for packages.
For the latest version, see Releases (with WORKSPACE
setup) / Documentation
Use rules-pkg-discuss@googlegroups.com for discussion.
As of Bazel 4.x, Bazel uses this rule set for packaging its distribution. Bazel still contains a limited version of pkg_tar
but its feature set is frozen. Any new capabilities will be added here.
We hold an engineering status meeting on the first Monday of every month at 10am USA East coast time. Add to calendar / meeting notes