feature request - provide access to stdout for successful build actions
By default Buck2 does not print the output of successful commands. The CLI offers some knobs to control this behavior: E.g.
buck2 build ... -v1,stderr or buck2 build ... -v4 will display stderr output of build commands even if they were succesful. However, there does not seem to be a way to access the stdout output of build commands that completed successfully. Even the following log query will not include stdout output of successful commands:
$ buck2 log show | jq -r '
.Event.data.SpanEnd.data.ActionExecution
| try .commands[]
| ( "exit: " + (.details.signed_exit_code|tostring)
+ "\nstdout:\n" + .details.stdout
+ "\nstderr:\n" + .details.stderr
)
'
This was confirmed with a build action that invoked a Python wrapper script by adding a print command to the beginning of the Python script's main function. If the script is forced to fail by adding sys.exit(1), then the stdout output is displayed by Buck2.
This was observed on regular local build actions. However, relatedly I noticed that the persistent worker protocol does not provide a field to communicate stdout output from the worker to Buck2. To support stdout output of commands executed by a persistent worker would require extending that protocol.