From a71a69d567b772698ce53f39979e75b0c6871dfb Mon Sep 17 00:00:00 2001 From: Douglas Thor Date: Fri, 8 Aug 2025 21:52:45 +0000 Subject: [PATCH 1/3] Document pkg_tar.extension. Fixes #972 --- docs/latest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/latest.md b/docs/latest.md index eace4b2f..a6da0172 100755 --- a/docs/latest.md +++ b/docs/latest.md @@ -370,7 +370,7 @@ pkg_tar(name, deps, create_parents | - | Boolean | optional | `True` | | empty_dirs | - | List of strings | optional | `[]` | | empty_files | - | List of strings | optional | `[]` | -| extension | - | String | optional | `"tar"` | +| extension | The extension of the generated file. If `"gz"`, `"bz2"`, or `"xz"`, the tarball will also be compressed using that tool, and is mutually exclusive with `compressor`. Note that `xz` may not be supported based on the Python toolchain. | String | optional | `"tar"` | | files | Obsolete. Do not use. | Dictionary: Label -> String | optional | `{}` | | include_runfiles | Include runfiles for executables. These appear as they would in bazel-bin.For example: 'path/to/myprog.runfiles/path/to/my_data.txt'. | Boolean | optional | `False` | | mode | - | String | optional | `"0555"` | From c2846c48648b3a9e692779ed24fa40d4cdc634a1 Mon Sep 17 00:00:00 2001 From: Douglas Thor Date: Sat, 4 Oct 2025 03:17:08 +0000 Subject: [PATCH 2/3] Update doc in the correct place --- pkg/private/tar/tar.bzl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/private/tar/tar.bzl b/pkg/private/tar/tar.bzl index 1d4755af..7db384b0 100644 --- a/pkg/private/tar/tar.bzl +++ b/pkg/private/tar/tar.bzl @@ -258,12 +258,18 @@ pkg_tar_impl = rule( "ownername": attr.string(default = "."), "owners": attr.string_dict(), "ownernames": attr.string_dict(), - "extension": attr.string(default = "tar"), + "extension": attr.string( + default = "tar", + doc = """The extension of the generated file. If `"gz"`, `"bz2"`, or `"xz"`, the +tarball will also be compressed using that tool, and is mutually exclusive with `compressor`. +Note that `xz` may not be supported based on the Python toolchain. +""", + ), "symlinks": attr.string_dict(), "empty_files": attr.string_list(), "include_runfiles": attr.bool( doc = ("""Include runfiles for executables. These appear as they would in bazel-bin.""" + - """For example: 'path/to/myprog.runfiles/path/to/my_data.txt'."""), + """ For example: 'path/to/myprog.runfiles/path/to/my_data.txt'."""), ), "empty_dirs": attr.string_list(), "remap_paths": attr.string_dict(), From 06760bd6bdf399a3c824463c2b01b3de58a6d084 Mon Sep 17 00:00:00 2001 From: Douglas Thor Date: Sat, 4 Oct 2025 03:23:04 +0000 Subject: [PATCH 3/3] Revert "Document pkg_tar.extension." This reverts commit a71a69d567b772698ce53f39979e75b0c6871dfb. --- docs/latest.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/latest.md b/docs/latest.md index a6da0172..eace4b2f 100755 --- a/docs/latest.md +++ b/docs/latest.md @@ -370,7 +370,7 @@ pkg_tar(name, deps, create_parents | - | Boolean | optional | `True` | | empty_dirs | - | List of strings | optional | `[]` | | empty_files | - | List of strings | optional | `[]` | -| extension | The extension of the generated file. If `"gz"`, `"bz2"`, or `"xz"`, the tarball will also be compressed using that tool, and is mutually exclusive with `compressor`. Note that `xz` may not be supported based on the Python toolchain. | String | optional | `"tar"` | +| extension | - | String | optional | `"tar"` | | files | Obsolete. Do not use. | Dictionary: Label -> String | optional | `{}` | | include_runfiles | Include runfiles for executables. These appear as they would in bazel-bin.For example: 'path/to/myprog.runfiles/path/to/my_data.txt'. | Boolean | optional | `False` | | mode | - | String | optional | `"0555"` |