run_shell_command
Run a script in the workspace with dependencies packaged into a chroot.
This target is designed for quick, workspace-oriented interactive scripts that use tools from the system PATH.
Example BUILD file:
run_shell_command(
command="./scripts/my-script.sh --data-files-dir={chroot}",
execution_dependencies=["src/project/files:data"],
)
The command may use either {chroot} on the command line, or the $CHROOT environment variable to get the root directory for where any dependencies are located.
In contrast to shell_command, this target: - Uses tools from the system PATH (not explicit tools field) - Does not support output_files (outputs go directly to workspace) - Is simpler to use for quick workspace scripts
For more hermetic execution with explicit tool dependencies, consider using shell_command instead, which provides better reproducibility and caching.
Backend: pants.backend.shell