From aea720b6dc3b003ed8d020d47bf1d317a07250ca Mon Sep 17 00:00:00 2001 From: Jean-Hadrien Chabran Date: Mon, 15 May 2023 20:08:22 +0200 Subject: [PATCH] docs: add a note in pkg_tar#strip_prefix about flattening --- docs/0.8.0/reference.md | 2 +- pkg/private/tar/tar.bzl | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/0.8.0/reference.md b/docs/0.8.0/reference.md index d1013624..737f7f8f 100755 --- a/docs/0.8.0/reference.md +++ b/docs/0.8.0/reference.md @@ -297,7 +297,7 @@ pkg_tar(name, build_tar | remap_paths | - | Dictionary: String -> String | optional | {} | | srcs | - | List of labels | optional | [] | | stamp | Enable file time stamping. Possible values:
  • stamp = 1: Use the time of the build as the modification time of each file in the archive.
  • stamp = 0: Use an "epoch" time for the modification time of each file. This gives good build result caching.
  • stamp = -1: Control the chosen modification time using the --[no]stamp flag.
    Since 0.5.0
    | Integer | optional | 0 | -| strip_prefix | - | String | optional | "" | +| strip_prefix | (note: strip_prefix = "." will prevent srcs to be flattened) | String | optional | "" | | symlinks | - | Dictionary: String -> String | optional | {} | diff --git a/pkg/private/tar/tar.bzl b/pkg/private/tar/tar.bzl index a2caa905..1ab564f7 100644 --- a/pkg/private/tar/tar.bzl +++ b/pkg/private/tar/tar.bzl @@ -248,7 +248,9 @@ def _pkg_tar_impl(ctx): pkg_tar_impl = rule( implementation = _pkg_tar_impl, attrs = { - "strip_prefix": attr.string(), + "strip_prefix": attr.string( + doc = """(note: strip_prefix = "." will prevent srcs to be flattened)""" + ), "package_dir": attr.string( doc = """Prefix to be prepend to all paths written.""" ),