rules_pkg
rules_pkg copied to clipboard
Add support for repo mapping
Context
When a binary is packaged with pkg_* rules, the repo_mapping manifest file is not included in the archive. For example
java_binary(
name = "example",
main_class = "...",
)
pkg_tar(
name = "example_tar",
srcs = [":example"],
include_runfiles = True,
)
The above generates an archive that does not have _repo_mapping under runfiles directory even when bzlmod is enabled, and therefore runfiles libraries are not able to convert apparent repo names into canonical repo names.
Changes
Patch rules_pkg such that when
- bzlmod is enabled, and
-
include_runfiles = True
it copies the repo mapping manifest into the archive at the correct location
i.e.
example
example.repo_mapping
example.runfiles/
├─ _repo_mapping
Closes #769