-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Labels
P1An issue that must be resolved. Must have an assigneeAn issue that must be resolved. Must have an assigneebreaking change
Milestone
Description
Example file tree
BUILD
docs/BUILD
docs/index.md
docs/reference/index.md
docs/BUILD
filegroup(name = "docs", srcs = glob(["**/*"]))
BUILD
pkg_files(
name = "share_doc",
srcs = [
"//docs",
],
strip_prefix = strip_prefix.from_pkg(),
prefix = "usr/share/doc/foo",
)
This gives the output I expect - that the directory tree is preserved.
usr/share/doc/foo/index.md
usr/share/doc/foo/reference/
usr/share/doc/foo/reference/index.md
But.... if I do not have strip_prefix
, pkg_files
flattens the tree and I get the error. Error in fail: After renames, multiple sources (at least docs/index.md, docs/reference/index.md) map to the same destination. Consider adjusting strip_prefix and/or renames
This might be a carry over from legacy behavior, but it is strange and confusing.
Proposal
pkg_files
adds an attributesquash_tree
bool, default=False which controls squashing the tree.- strip prefix and any name filtering are applied first, then the results are squashed if squash_tree=False.
Metadata
Metadata
Labels
P1An issue that must be resolved. Must have an assigneeAn issue that must be resolved. Must have an assigneebreaking change