Skip to content

feat: allow calling RunBazelisk with custom stderr#751

Merged
fweikert merged 1 commit intobazelbuild:masterfrom
sitaktif:runbazelisk-stderr-param
Jan 23, 2026
Merged

feat: allow calling RunBazelisk with custom stderr#751
fweikert merged 1 commit intobazelbuild:masterfrom
sitaktif:runbazelisk-stderr-param

Conversation

@sitaktif
Copy link
Copy Markdown
Contributor

This allows library users to control what happens with stderr (e.g. write it to a file or buffer instead of the process' stderr).

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for custom stderr handling in Bazelisk's Go library API, allowing library consumers to redirect stderr output to custom writers instead of always using the process's stderr. This enhancement improves the flexibility of Bazelisk when used as a library.

Changes:

  • Added new public API function RunBazeliskWithArgsFuncAndConfigAndOutAndErr that accepts both stdout and stderr writers
  • Updated internal functions makeBazelCmd and runBazel to accept and handle custom stderr writers
  • Maintained backward compatibility by having existing functions delegate to the new function with nil for stderr

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/core.go
Comment thread core/core.go Outdated
@sitaktif sitaktif force-pushed the runbazelisk-stderr-param branch from 87efb87 to a7e8e96 Compare January 22, 2026 16:13
@sitaktif sitaktif force-pushed the runbazelisk-stderr-param branch from a7e8e96 to 1e6aafa Compare January 23, 2026 09:43
@fweikert
Copy link
Copy Markdown
Member

Thank you!

@fweikert fweikert merged commit a6767cf into bazelbuild:master Jan 23, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants