Bazel swallows credential helper standard error output instead to echoing it to the user
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
The credential helper [proposal](https://github.com/bazelbuild/proposals/blob/main/designs/2022-06-07-bazel-credential-helpers.md) states:
> A credential helper may provide a human-readable error message in its standard error that Bazel will print.
Instead bazel swallows stderr output from the credential helper output. This combined with ignored credential helper return codes (#20146) results in a relatively poor end user experience in credential helper failure cases.
Ideally bazel would echo stderr output to the user immediately (even in non-error cases) such that the credential helper could provide instructions to the user (eg: insert or touch your yubikey) even before the credential helper exits.
### Which category does this issue belong to?
Core
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Add a credential helper which sends a user message to stderr and returns a failure code. For example:
```
#!/usr/bin/env python3
import sys
print('output for the end user', file=sys.stderr)
sys.exit(1)
```
### Which operating system are you running Bazel on?
Debian Linux 12 Bookworm
### What is the output of `bazel info release`?
release 6.4.0
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?
_No response_
### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
_No response_
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start with the credential helper proposal and reproduce the issue using the provided Python helper that writes to stderr and exits with failure. Trace the Bazel credential-helper execution path and verify that the helper's stderr is shown promptly to the user, including when the helper fails.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100