General-purpose rule to create tar archives.
Unlike pkg_tar from rules_pkg this:
We also provide full control for tar'ring binaries including their runfiles.
Rule that executes BSD tar
. Most users should use the tar
macro, rather than load this directly.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
compress | Compress the archive file with a supported algorithm. | String | optional | "" |
mtree | An mtree specification file | Label | optional | None |
out | Resulting tar file to write | Label | optional | |
srcs | Files that are placed into the tar | List of labels | required |
Wrapper macro around tar_rule
.
Allows the mtree to be supplied as an array literal of lines, in addition to a separate file, e.g.
mtree =[ "usr/bin uid=0 gid=0 mode=0755 type=dir", "usr/bin/ls uid=0 gid=0 mode=0755 time=0 type=file content={}/a".format(package_name()), ],
For the format of a line, see “There are four types of lines in a specification” on the man page for BSD mtree, https://man.freebsd.org/cgi/man.cgi?mtree(8)
PARAMETERS
Name | Description | Default Value |
---|---|---|
name | name of resulting tar_rule | none |
mtree | either an array of specification lines, or a label of a file that contains the lines. | None |
kwargs | additional named parameters to pass to tar_rule | none |