Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
jjl opened this Issue · 8 comments

3 participants

@jjl

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. Consult `brew 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. Consult `brew 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

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

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

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

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.

@jacknagel
Collaborator

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 jacknagel referenced this issue from a commit
@jacknagel jacknagel 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.
0a868ab
@Sharpie Sharpie referenced this issue from a commit in Sharpie/homebrew
@jacknagel jacknagel 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.
ea429b7
@snakeyroc3 snakeyroc3 referenced this issue from a commit in snakeyroc3/homebrew
@jacknagel jacknagel 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.
f7f6d44
@gwydirsam gwydirsam referenced this issue from a commit
@jacknagel jacknagel 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.
0b7e7ea
@adamv
Owner

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
jjl commented
@jjl
jjl commented

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
@cooljeanius cooljeanius referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.