pants icon indicating copy to clipboard operation
pants copied to clipboard

`run` for `experimental_run_shell_command` does not support passthrough args

Open stuhood opened this issue 1 year ago • 0 comments

Because the Process composed for a experimental_run_shell_command is built with bash -c: https://github.com/pantsbuild/pants/blob/5a04478e210b88e28c644783866891a82b290c78/src/python/pants/backend/shell/shell_command.py#L226 ...appending additional args to argv (as the run goal does) does not work to pass those arguments to the script.

To fix this, the setup for the Process should actually create a script file (via CreateDigest), and then invoke bash like:

bash $script

...which would mean that appending the run args would look like:

bash $script $args

stuhood avatar Sep 16 '22 17:09 stuhood