rules_pkg icon indicating copy to clipboard operation
rules_pkg copied to clipboard

FR: expose pkg_tar implementation to allow creation of custom pkg_tar rules

Open thesayyn opened this issue 3 years ago • 2 comments

Currently, there is no way to use the build_tar target to generate tars without depending on the private API. This is particularly useful for rules that create tar out of artifacts generated by the rule itself. Generally, exposing more stuff to the public API is not a good idea but I believe this is one exception to this rule.

Some rulesets already do this; rules_docker, rules_js is two that i know of.

thesayyn avatar Oct 21 '22 15:10 thesayyn

I don't think it is an exception. I want to be able to change that API at will. For example, the entire bit about splicing in previous tar files should be replaced. I was thinking about that this week. I can fix several feature requests as well as provide some highly performant capabilities. But, then the old code will be cruft to maintain indefinitly.

aiuto avatar Oct 21 '22 16:10 aiuto

But, then the old code will be cruft to maintain indefinitly.

not necessarily. as long as it is done the way rules_js has done it. I agree that exposing build_tar is not a good idea, however, this could be done easily by exposing the impl or a function that returns the tar output. hence build_tar stays as part of the private API.

I want to be able to change that API at will.

that said, one can still introduce breaking changes to the said function as long as it follows the semver.

thesayyn avatar Oct 21 '22 17:10 thesayyn