bazelbuild / bazelbuild/rules_pkg

FR: Standardize and toolchainize the tar builder

Open
#946 0 comments 0 reactions 0 assignees View on GitHub
feature-request P2
Dominant language
Starlark
Stars
253
Forks
221
Avg merge
10h 33m
Merged PRs (30d)
1

Description

Currently, rules_pkg uses a custom intermediary manifest format and a custom python tool to create tar archives. However there is a growing appetite for using rules_pkg with bsdtar for various reasons, eg performance, support for compression formats etc. See: https://github.com/bazel-contrib/tar.bzl/issues/9

In order to achieve this, we need to make some changes here rules_pkg which will abstract the manifest/tar builder so that i can be swapped out by another party. Ideally rules_pkg would provide one of these toolchains that maintains the status quo, and bazel-lib can provide one compatibility to allow users to use both interchangeably.

I believe that there are two sensible choices.

Option 1:

Standardize the currently in use intermediary format and toolchainize the tar tool, so that it can be swapped out by the users.

Option 2:

Entails the same requirements as the first one, but instead of a custom format, we settle on BSD standard mtree format. https://man.freebsd.org/cgi/man.cgi?mtree(8)

This format has been use in bazel-lib#tar for a long time, that is easy to produce, mutate, process even in starlark context. https://github.com/bazel-contrib/bazel-lib/blob/bdc6ade0ba1ebe88d822bcdf4d4aaa2ce7e2cd37/lib/private/tar.bzl#L440-L447

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the current intermediary manifest format and custom Python tar tool, then compare the mtree-based approach in bazel-lib/lib/private/tar.bzl around lines 440-447. Resolve whether the standardized format should remain custom or use BSD mtree, then define the swappable tar toolchain and compatibility behavior; done means both implementations can be used interchangeably.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.