bazelbuild / bazelbuild/rules_pkg
Add a rule to materialize a set of pkg_* instances.
- Dominant language
- Starlark
- Stars
- 253
- Forks
- 221
- Avg merge
- 10h 33m
- Merged PRs (30d)
- 1
Description
The concept is that
- you organize your desired file tree with a set of `pkg_*` rules
- they are input to `pkg_materialize(name='foo', srcs=[...])`
- this creates a symlink tree within the calling package to the artifacts represented by `srcs`.
- Finally, you can use `foo` as a `data` input to a `*_binary` rule.
This might be a decent solution to the silliness of bazel's runfiles layout. You would define a tree that places everything under 'usr/share/my_app/', then write the binary for 'my_app` to expect files in /usr/share/my_app/..... Add a pkg_symlink in the final archive pointing from /usr/local/bin/my_app to /usr/share/my_app/bin/my_app and you've got reasonable tooling.
Of course, this only handles `data` dependencies which were explicit in the first place. It does not deal with the generic runfiles problems like .so and .py files.
Contributor guide
Assessment
This issue has not been assessed yet.