bazelbuild / bazelbuild/examples

Add examples for using zipper/singlejar on rules that output unpredictable files

Open
#109 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
957
Forks
578
Avg merge
3d 22h
Merged PRs (30d)
1

Description

Sometimes builds need to incorporate programs that output unpredictable files in order to create artifacts. For example, a multi-language code generator. If those artifacts need to be collected into a single archive, like a zip or jar, then it's not at all clear how to proceed. Bazel has two tools, zipper and singlejar, that can be used to create zip and jar archives. But the zipper tool requires every file explicitly enumerated, so it can't be used on a group of rule outputs that are unknown in number and name. And singlejar could presumably be used, but it's not clear how to operate it, because java_toolchains don't participate in toolchain resolution and there are multiple platform-specific versions of singlejar, so it's not clear how to get it working.

Examples of using both of these would be welcome.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.