Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request - provide access to stdout for successful build actions #741

Open
aherrmann opened this issue Aug 16, 2024 · 0 comments
Open

Comments

@aherrmann
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant