This repository has been archived by the owner. It is now read-only.

Brew doctor on clean Mountain Lion install never terminates and repeats an error #16119

Closed
jjl opened this Issue Nov 17, 2012 · 8 comments

Comments

Projects
None yet
3 participants

jjl commented Nov 17, 2012

I've just installed Mountain Lion and hadn't got around to installing the developer tools yet. I did a clean homebrew install using the automatic installation script. This advises to run 'brew doctor', which while informative, runs presumably infinitely (I ctrl-c'd it after about 30 seconds)

The following line appears three times:
Warning: Could not locate developer tools. Consultbrew doctor.

Then the following error is spat out:
You have only installed Xcode. If stuff is not building, try installing the "Command Line Tools for Xcode" package provided by Apple.

Then the first error is spat out repeatedly until I kill the process:
Warning: Could not locate developer tools. Consultbrew doctor.

Now obviously I have to go and install the developer tools, but this shouldn't happen regardless.

Update: automatic code highlighting from indentation wasn't triggered. I've added the backtick syntax to force it.

jjl commented Nov 17, 2012

The first 4 errors are spat out during the call to the doctor check_cc method and the infinite loop is triggered during check_for_linked_keg_only_brews

jjl commented Nov 17, 2012

This is actually not infinite, it is just executed once per formula so it does eventually terminate. I'm going to attempt to patch this before I've installed the dev tools

jjl commented Nov 17, 2012

The one place this error is thrown is in MacOS::dev_tools_path, however some of it is quite nested and hard to understand the flow of. I modified this routine to throw exceptions and doctor.rb to list the name of each method before it runs it so there's some debugging information. See this gist: https://gist.github.com/4097597

As for me, I'm just going to install the dev tools and leave it for someone else.

jjl commented Nov 17, 2012

One more thought:

Warning: Experimental support for using Xcode without the "Command Line Tools". You have only installed Xcode. If stuff is not building, try installing the "Command Line Tools for Xcode" package provided by Apple.

Would appear to be incorrect since I haven't got xcode installed.

Contributor

jacknagel commented Nov 17, 2012

This is pretty ugly.

check_for_linked_keg_only_brews is a slow operation, but we should be able to just return early on fresh installs, i.e. if HOMEBREW_CELLAR hasn't been created yet.

I would like to see MacOS.dev_tools_path not print an error message at all; it is called in too many places. Instead, commands that require the presence of developer tools (install, upgrade, ...) should do something like

raise DeveloperToolsNotFoundError if MacOS.dev_tools_path.nil?

at the outset or something.

jacknagel added a commit that referenced this issue Dec 8, 2012

Don't print error message when dev_tools_path fails to find tools
This message is either (a) never printed because the tools are
installed, or (b) printed every time this method is called.

See #16119.

This code shouldn't be responsible for UX anyway, so just remove it and
let other parts of Homebrew be responsible for failing or declaring that
they need the developer tools.

Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Dec 15, 2012

Don't print error message when dev_tools_path fails to find tools
This message is either (a) never printed because the tools are
installed, or (b) printed every time this method is called.

See #16119.

This code shouldn't be responsible for UX anyway, so just remove it and
let other parts of Homebrew be responsible for failing or declaring that
they need the developer tools.

snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012

Don't print error message when dev_tools_path fails to find tools
This message is either (a) never printed because the tools are
installed, or (b) printed every time this method is called.

See #16119.

This code shouldn't be responsible for UX anyway, so just remove it and
let other parts of Homebrew be responsible for failing or declaring that
they need the developer tools.
Contributor

adamv commented Jan 7, 2013

Is this still an issue? If I remember correctly there have bee some updates to the tool finding code since this was opened, but I don't have a ML box to test on.

jjl commented Jan 7, 2013

I have a fresh ML install on one of my machines. I'll give it a try tonight if I have time else another evening this week.

/j

Sent from my invisible pink unicorn

On 7 Jan 2013, at 01:22, Adam Vandenberg notifications@github.com wrote:

Is this still an issue? If I remember correctly there have bee some updates to the tool finding code since this was opened, but I don't have a ML box to test on.


Reply to this email directly or view it on GitHub.

jjl commented Jan 8, 2013

I can confirm this is now fixed.

AAMOF this still is errorful (I do not have xcode installed but it reports that I have), but it's no longer a major issue. Worth filing a separate bug? Realistically it could be fixed with a string change (although we should probably have it check whether xcode is actually installed in order to be more helpful).

Jamess-MacBook:~ jjl$ brew doctor
Warning: Experimental support for using Xcode without the "Command Line Tools".
You have only installed Xcode. If stuff is not building, try installing the
"Command Line Tools for Xcode" package provided by Apple.
Warning: No developer tools installed
You should install the Command Line Tools: http://connect.apple.com
You must: brew install git
You must: brew install git
You must: brew install git
Warning: An outdated version of Git was detected in your PATH.
Git 1.6.6 or newer is required to perform checkouts over HTTP from GitHub.
Please upgrade: brew upgrade git

@adamv adamv closed this Jan 20, 2013

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016

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