<#18180 Add a `system_binary` target for use as de...
# github-notifications
q
#18180 Add a `system_binary` target for use as dependencies for `experimental_run_in_sandbox`/`shell_command` Issue created by chrisjrn Currently,
shell_command
allows you to find binaries that are already on the system
PATH
(or other shell search paths if provided). This is fine for system/POSIX tools, but if it's a binary whose behaviour changes significantly with different versions, it would be useful to test that the binary's output matches a regexp. Suggest the target would look like this:
Copy code
system_binary(
  binary_name="python3",
  test_args=["--version"],
  output_pattern=r"3\.([8-9]|([1-9][0-9]+))\.[0-9]+",
  search_paths= # OPTIONAL_VALUE
)
Each
python3
binary found would be run with
--version
, and tested for the
output_pattern
, the response would include the path to the binary, but also the specific value of the
output_pattern
for caching purposes. pantsbuild/pants