bazel-contrib / bazel-contrib/bazel-lib

[FR]: Simple example of using `run_binary()` with `out_dirs`

Open
#859 1 comment 2 reactions 0 assignees View on GitHub
documentation enhancement
Dominant language
Starlark
Stars
182
Forks
134
Avg merge
1d 46m
Merged PRs (30d)
1

Description

### What is the current behavior?

I'm trying to figure out if `run_binary` is appropriate for my use case, but I can't determine where my `tool` should write its outputs for them to appear. However, there's no simple examples of this attribute being used I can easily understand, and I can't use makevars or location to find my `out_dirs`.

### Describe the feature

rules_pkg has a directory of [examples](https://github.com/bazelbuild/rules_pkg/tree/main/examples) that make it relatively easy to figure out how to use the rules from looking at some simple to moderately complex examples. I'd love to see something similar for `run_binary()` since its only "genrule" that has the `out_dirs` capability.

Related info:
* I did try looking at this [issue](https://github.com/aspect-build/bazel-lib/issues/228) but I couldn't quite wrap my head around it
* I also tried looking at the source code for [rules_js](https://github.com/aspect-build/rules_js/blob/d55c9de0da18bf303060c35ef43b78ada88dcd75/npm/private/npm_import.bzl#L700) but I couldn't easily jump through the project to figure out how all of that works

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the repository's examples directory and the run_binary documentation or implementation, alongside the linked rules_pkg examples. Add a simple, understandable example that demonstrates where a tool writes outputs when out_dirs is used; done when the example is discoverable and explains the expected outputs.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.