outputs | sequence of Files; required List of the output files of the action. |
inputs | sequence of Files; or depset; default is [] List or depset of the input files of the action. |
tools | sequence of Files; or depset; default is unbound List or depset of any tools needed by the action. Tools are executable inputs that may have their own runfiles which are automatically made available to the action. When a list is provided, it can be a heterogenous collection of: * Files * FilesToRunProvider instances * depsets of Files Files from ctx.executable and FilesToRunProviders which are directly in the list will have their runfiles automatically added. All tools are implicitly added as inputs. |
arguments | sequence; default is [] Command line arguments of the action. Must be a list of strings or actions.args() objects. Bazel passes the elements in this attribute as arguments to the command.The command can access these arguments using shell variable substitutions such as $1, $2, etc. Note that since Args objects are flattened before indexing, if there is an Args object of unknown size then all subsequent strings will be at unpredictable indices. It may be useful to use $@ (to retrieve all arguments) in conjunction with Args objects of indeterminate size. In the case where command is a list of strings, this parameter may not be used. |
mnemonic | string; or None; default is None A one-word description of the action, for example, CppCompile or GoLink. |
command | string; or sequence of strings; required Shell command to execute. This may either be a string (preferred) or a sequence of strings (deprecated). If command is a string, then it is executed as if by sh -c <command> "" <arguments> — that is, the elements in arguments are made available to the command as $1, $2 (or %1, %2 if using Windows batch), etc. If arguments contains any actions.args() objects, their contents are appended one by one to the command line, so $i can refer to individual strings within an Args object. Note that if an Args object of unknown size is passed as part of arguments, then the strings will be at unknown indices; in this case the $@ shell substitution (retrieve all arguments) may be useful. (Deprecated) If command is a sequence of strings, the first item is the executable to run and the remaining items are its arguments. If this form is used, the arguments parameter must not be supplied. Note that this form is deprecated and will soon be removed. It is disabled with --incompatible_run_shell_command_string. Use this flag to verify your code is compatible. Bazel uses the same shell to execute the command as it does for genrules. |
progress_message | string; or None; default is None Progress message to show to the user during the build, for example, “Compiling foo.cc to create foo.o”. The message may contain %{label}, %{input}, or %{output} patterns, which are substituted with label string, first input, or output’s path, respectively. Prefer to use patterns instead of static strings, because the former are more efficient. |
use_default_shell_env | bool; default is False Whether the action should use the default shell environment, which consists of a few OS-dependent variables as well as variables set via --action_env. If both use_default_shell_env and env are set to True, values set in env will overwrite the default shell environment. |
env | dict; or None; default is None Sets the dictionary of environment variables. If both use_default_shell_env and env are set to True, values set in env will overwrite the default shell environment. |
execution_requirements | dict; or None; default is None Information for scheduling the action. See tags for useful keys. |
input_manifests | sequence; or None; default is None Legacy argument. Ignored. |
exec_group | string; or None; default is None Runs the action on the given exec group’s execution platform. If none, uses the target’s default execution platform. |
shadowed_action | Action; default is None Runs the action using the given shadowed action’s discovered inputs added to the action’s inputs list. If none, uses only the action’s inputs. |
resource_set | callable; or None; default is None A callback function for estimating resource usage if run locally. Seectx.actions.run(). |
toolchain | Label; or string; or None; default is unbound Toolchain type of the executable or tools used in this action. If executable and tools are not coming from a toolchain, set this parameter to None. If executable and tools are coming from a toolchain, toolchain type must be set so that the action executes on the correct execution platform. Note that the rule which creates this action needs to define this toolchain inside its ‘rule()’ function. When toolchain and exec_group parameters are both set, exec_group will be used. An error is raised in case the exec_group doesn’t specify the same toolchain. |