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

Variation of run_binary to capture stdout and/or stderr #441

Open
kriswuollett opened this issue Mar 28, 2023 · 2 comments
Open

Variation of run_binary to capture stdout and/or stderr #441

kriswuollett opened this issue Mar 28, 2023 · 2 comments
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) type: feature request

Comments

@kriswuollett
Copy link

The run_binary rule assumes that the output to be captured is written to file(s) by the binary either in implied or through args location(s). This does not completely replace the usage of genrule because the use case of capturing output from a stdout-only binary is not supported. Is it possible to capture output in Bazel, or does this use case still have to be done through genrule?

@tetromino
Copy link
Collaborator

Currently, ctx.actions.run as far as I can tell cannot redirect output without using bash (or cmd.exe on Windows), and using bash would defeat the point of run_binary - you may as well use genrule :)

So while this feature may be desirable, it first needs Bazel support to be added.

@tetromino tetromino added type: feature request P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) labels Mar 28, 2023
@kriswuollett
Copy link
Author

Thanks for the quick response, I was able to then search the Bazel repo and found the request for it in bazelbuild/bazel#5511.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) type: feature request
Projects
None yet
Development

No branches or pull requests

2 participants