2
0
Fork 0
mirror of https://github.com/bazelbuild/bazel-skylib synced 2024-12-02 14:52:43 +00:00
bazel-skylib/docs/run_binary_doc.md
László Csomor bf8a55b668
run_binary: runs an executable as an action (#153)
This rule is an alternative for genrule(): it can
run a binary with the desired arguments,
environment, inputs, and outputs, as a single
build action, without shelling out to Bash.

Fixes https://github.com/bazelbuild/bazel-skylib/issues/149
2019-05-21 14:46:09 +02:00

2.8 KiB
Executable file

run_binary

run_binary(name, args, env, outs, srcs, tool)

Runs a binary as a build action.

This rule does not require Bash (unlike native.genrule).

Attributes

name Name; required

A unique name for this target.

args List of strings; optional

Command line arguments of the binary.

Subject to$(location) expansion.

env Dictionary: String -> String; optional

Environment variables of the action.

Subject to $(location) expansion.

outs List of labels; required

Output files generated by the action.

These labels are available for $(location) expansion in args and env.

srcs List of labels; optional

Additional inputs of the action.

These labels are available for $(location) expansion in args and env.

tool Label; required

The tool to run in the action.

Must be the label of a *_binary rule, of a rule that generates an executable file, or of a file that can be executed as a subprocess (e.g. an .exe or .bat file on Windows or a binary with executable permission on Linux). This label is available for $(location) expansion in args and env.