Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Error messages should be written to stderr, not stdout #5432

Closed
jaredbeck opened this issue Feb 14, 2017 · 5 comments
Closed

Error messages should be written to stderr, not stdout #5432

jaredbeck opened this issue Feb 14, 2017 · 5 comments

Comments

@jaredbeck
Copy link

Demonstration of issue, abbreviated

bundle outdated 2> /dev/null
Could not find activesupport-5.0.1 in any of the sources

We redirect stderr to /dev/null, but output is still produced. Bundler is printing to stdout.

See below for complete, executable demonstration.

Expected behavior

Errors are always printed to stderr, never to stdout.

Current behavior

Errors are printed to stdout. (sometimes? always?)

Analysis

POSIX requires stderr, so fixing this issue would only be a problem if bundler supports systems that are non-compliant.

Complete, executable demonstration of issue

mkdir demo && cd demo
cat <<EOF > Gemfile
> source 'https://rubygems.org'
> gem 'activesupport'
> EOF
bundle install
gem uninstall activesupport
bundle outdated 2> /dev/null
Could not find activesupport-5.0.1 in any of the sources
bundle -v
Bundler version 1.14.4
@jaredbeck
Copy link
Author

I'd be happy to work on this if it's approved.

@segiddins
Copy link
Member

This is already implemented in the Bundler 2-0-dev branch

@jaredbeck
Copy link
Author

This is already implemented in the Bundler 2-0-dev branch

Thanks Samuel, I'll close this then.

@indirect
Copy link
Member

Thanks for reporting this! We completely agree, but are constrained by our strong backwards compatibility promises to wait to ship this change until 2.0. I'm looking forward to it, though. :)

@jaredbeck
Copy link
Author

.. constrained by our strong backwards compatibility promises to wait to ship this change until 2.0 ..

That's wise, André. I've built a few tools that parse output from bundler and I'm sure some assume stdout when they shouldn't. Switching output to a different FD is def. a breaking change.

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

No branches or pull requests

3 participants