Skip to content
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

Homebrew can't install Command Line Tools on macOS Catalina (10.15) #233

Closed
maxim-lobanov opened this issue Oct 9, 2019 · 2 comments · Fixed by #235 or #236
Closed

Homebrew can't install Command Line Tools on macOS Catalina (10.15) #233

maxim-lobanov opened this issue Oct 9, 2019 · 2 comments · Fixed by #235 or #236
Labels

Comments

@maxim-lobanov
Copy link

maxim-lobanov commented Oct 9, 2019

What you were trying to do (and why)

I am trying to install brew on clean macOS Catalina (10.15) using the following command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

What happened (include command output)

Clean macOS Catalina image doesn't contain Command Line Tools and homebrew installer tries to install it but fails:

Command output

Installing Homebrew...
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/bin
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/sbin
/usr/local/share
/usr/local/var
/usr/local/opt
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew
/usr/local/var/homebrew/linked
/usr/local/Cellar
/usr/local/Caskroom
/usr/local/Homebrew
/usr/local/Frameworks
==> The Xcode Command Line Tools will be installed.
==> /usr/bin/sudo /bin/mkdir -p /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown USERNAME /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/sbin /usr/local/share /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /Users/USERNAME/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Users/USERNAME/Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown USERNAME /Users/USERNAME/Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Downloading and installing Homebrew...
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
Failed during: git init -q

What you expected to happen

I expects that homebrew will be installed successfully

Step-by-step reproduction instructions (by running brew commands)

Take clean macOS Catalina (10.15) image and run command /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Root cause of the issue

Homebrew uses the following code to install Command Line Tools:

  clt_label_command = "/usr/sbin/softwareupdate -l | " \
                      "grep -B 1 -E 'Command Line (Developer|Tools)' | " \
                      "awk -F'*' '/^ +\\*/ {print $2}' | " \
                      "grep '#{clt_macos_version}' | " \
                      "#{clt_sort} | " \
                      "sed 's/^ *//' | " \
                      "tail -n1"
  clt_label = `#{clt_label_command}`.chomp

  unless clt_label.empty?
    ohai "Installing #{clt_label}"
    sudo "/usr/sbin/softwareupdate", "-i", clt_label
    sudo "/bin/rm", "-f", clt_placeholder
    sudo "/usr/bin/xcode-select", "--switch", "/Library/Developer/CommandLineTools"
  end

Output of softwareupdate -l tool was changed on macOS Catalina so clt_label_command contains empty value always.
Looks like some other macOS tools affected by the same issue.

Previous output (macOS 10.14):

* Command Line Tools (macOS Mojave version 10.14) for Xcode-10.3
        #        Command Line Tools (macOS Mojave version 10.14) for Xcode (10.3), 199140K [recommended]

New output (macOS 10.15):

* Label: Command Line Tools beta 5 for Xcode-11.0
        #     Title: Command Line Tools beta 5 for Xcode, Version: 11.0, Size: 224804K, Recommended: YES,
@MikeMcQuaid MikeMcQuaid transferred this issue from Homebrew/brew Oct 9, 2019
@joshk0
Copy link

joshk0 commented Oct 14, 2019

Maybe this is a silly question, but this seems like a horrible abuse of the softwareupdate program. Is there a way to modify its output format or find some other program that allows us to output the data in a different format?

@MikeMcQuaid
Copy link
Member

Maybe this is a silly question, but this seems like a horrible abuse of the softwareupdate program. Is there a way to modify its output format or find some other program that allows us to output the data in a different format?

"Horrible abuse" is not particularly diplomatic. If you can figure out a better way of doing this we'd welcome a PR. Otherwise, please adjust your language in future.

DNACore pushed a commit to DNACore/install that referenced this issue Oct 25, 2019
- Only try the automated installation on >=10.13. This let's us clean up
  crufty code on versions we don't support anyway (that can still run
  the command manually).
- Fix the matching to work on Catalina

Fixes Homebrew#233.
@lock lock bot added the outdated label Nov 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants