Skip to content

fix(auth): let chainctl write to terminal for interactive login#2276

Merged
dannf merged 1 commit into
chainguard-dev:mainfrom
dannf:fix/chainctl-stderr-tty
Jun 12, 2026
Merged

fix(auth): let chainctl write to terminal for interactive login#2276
dannf merged 1 commit into
chainguard-dev:mainfrom
dannf:fix/chainctl-stderr-tty

Conversation

@dannf

@dannf dannf commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

If I'm not authenticated already, melange will hang when I start a build that requires auth. I can see that it has forked a chainctl process, which I run in --headless mode, but no device-login URL gets emitted to my terminal. This is because apko is discarding stderr.

Stream chainctl's stderr to the terminal when stderr is a TTY, so the login URL (and any errors) are visible. Keep discarding it in non-interactive contexts (CI/logs) to preserve the original intent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: dann frazier <dann.frazier@chainguard.dev>

If I'm not authenticated already, `melange` will hang when I start
a build that requires auth. I can see that it has forked a `chainctl`
process, which I run in `--headless` mode, but no device-login URL
gets emitted to my terminal. This is because `apko` is discarding
stderr.

Stream chainctl's stderr to the terminal when stderr is a TTY, so the
login URL (and any errors) are visible. Keep discarding it in
non-interactive contexts (CI/logs) to preserve the original intent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: dann frazier <dann.frazier@chainguard.dev>
@dannf dannf force-pushed the fix/chainctl-stderr-tty branch from b1c5b33 to 76d9b9f Compare June 12, 2026 17:35

@EyeCantCU EyeCantCU left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you, thank you, thank you

@dannf dannf merged commit ef578c3 into chainguard-dev:main Jun 12, 2026
25 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.

2 participants