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

popen: Do not suppress stderr when HOMEBREW_STDERR #3174

Merged
merged 4 commits into from Sep 23, 2017

Conversation

Projects
None yet
3 participants
@sjackman
Contributor

sjackman commented Sep 19, 2017

Suppress the error message:

xcrun: error: unable to find utility "gcc-4.0", not a developer tool or in PATH

popen: Add an options argument. Useful for closing stderr, for example.

popen_read("foo", err: :close)
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew tests with your changes locally?
@sjackman

This comment has been minimized.

Show comment
Hide comment
@sjackman

sjackman Sep 19, 2017

Contributor

I had err: :close originally, but got the error:

❯❯❯ brew style Library/Homebrew/extend/os/mac/development_tools.rb
== Library/Homebrew/extend/os/mac/development_tools.rb ==
C: 12: 81: Use hash rockets syntax.

Is my rubocop somehow misconfigured? My brew is up-to-date.

Contributor

sjackman commented Sep 19, 2017

I had err: :close originally, but got the error:

❯❯❯ brew style Library/Homebrew/extend/os/mac/development_tools.rb
== Library/Homebrew/extend/os/mac/development_tools.rb ==
C: 12: 81: Use hash rockets syntax.

Is my rubocop somehow misconfigured? My brew is up-to-date.

@sjackman sjackman changed the title from locate: Suppress stderr to popen: Do not suppress stderr when HOMEBREW_STDERR Sep 20, 2017

sjackman added some commits Sep 19, 2017

popen: Add an options argument
Useful for selectively enabling or silencing stderr, for example.
popen_read("foo", err: :err)
locate: Suppress stderr
Suppress the error message:
xcrun: error: unable to find utility "gcc-4.0", not a developer tool or in PATH
describe_java: Suppress stderr
Suppress the error message:
Unable to find any JVMs matching version "(null)".
@@ -9,7 +9,7 @@ def locate(tool)
@locate[key] = if (located_tool = original_locate(tool))
located_tool
elsif MacOS.version > :tiger
path = Utils.popen_read("/usr/bin/xcrun", "-no-cache", "-find", tool).chomp
path = Utils.popen_read("/usr/bin/xcrun", "-no-cache", "-find", tool, err: :close).chomp

This comment has been minimized.

@MikeMcQuaid

MikeMcQuaid Sep 22, 2017

Member

You can probably remove these two now in favour of just the HOMEBREW_STDERR below, I think?

@MikeMcQuaid

MikeMcQuaid Sep 22, 2017

Member

You can probably remove these two now in favour of just the HOMEBREW_STDERR below, I think?

This comment has been minimized.

@sjackman

sjackman Sep 22, 2017

Contributor

I plan on enabling HOMEBREW_STDERR=1 globally for myself. These two commits silence that wee bit of unnecessary noise from brew config. Happy to drop them though if you prefer.

@sjackman

sjackman Sep 22, 2017

Contributor

I plan on enabling HOMEBREW_STDERR=1 globally for myself. These two commits silence that wee bit of unnecessary noise from brew config. Happy to drop them though if you prefer.

Comments addressed.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Sep 23, 2017

Member

Thanks again @sjackman!

Member

MikeMcQuaid commented Sep 23, 2017

Thanks again @sjackman!

@MikeMcQuaid MikeMcQuaid merged commit 6b3bb66 into Homebrew:master Sep 23, 2017

3 checks passed

codecov/patch 77.77% of diff hit (target 67.11%)
Details
codecov/project Absolute coverage decreased by -0.01% but relative coverage increased by +10.66% compared to 5d888c0
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@sjackman sjackman deleted the sjackman:popen-options branch Sep 24, 2017

@sjackman

This comment has been minimized.

Show comment
Hide comment
@sjackman

sjackman Sep 24, 2017

Contributor

Thanks for merging!

Contributor

sjackman commented Sep 24, 2017

Thanks for merging!

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.