Dear Homebrew-Team,
After upgrading macOS to 10.12.4 - at least that is the time at which I believe the following problems have started - some packages refuse to install, such as vim or ruby.
The fun thing is that NOT ALL packages that are being compiled from source fail - i.e. python and perl compile like a charm. Just a few fail - such as vim or ruby.
The error message is always the same and occurs while "configure" is executed:
brew install vim
==> Using the sandbox
==> Downloading https://github.com/vim/vim/archive/v8.0.0562.tar.gz
Already downloaded: /Users/akrasa/Library/Caches/Homebrew/vim-8.0.0562.tar.gz
==> ./configure --prefix=/opt/homebrew --mandir=/opt/homebrew/Cellar/vim/8.0.0562/share/man --enable-multibyte --with-tlib=ncurses --enable-cscope --with-c
Last 15 lines from /Users/akrasa/Library/Logs/Homebrew/vim/01.configure:
--enable-rubyinterp
--disable-nls
--enable-gui=no
--without-x
configure: creating cache auto/config.cache
checking whether make sets $(MAKE)... yes
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in /private/tmp/vim-20170411-10151-1h9tw6l/vim-8.0.0562/src':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use--host'.
See `config.log' for more details
The gist-logs can be found at:
https://gist.github.com/a7a86f9eca5096181d9c68e10ff86139
brew config outputs the following:
HOMEBREW_VERSION: 1.1.12
ORIGIN: https://github.com/Homebrew/brew
HEAD: 8ea778f7c7ea790694485030d105a92a9416ef33
Last commit: 9 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 55a35bb74627e9eee9537dc726ac07c3dbc59444
Core tap last commit: 74 minutes ago
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_REPOSITORY: /opt/homebrew
HOMEBREW_CELLAR: /opt/homebrew/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit skylake
Homebrew Ruby: 2.0.0-p648
Clang: 8.1 build 802
Git: 2.12.2 => /opt/homebrew/bin/git
Perl: /opt/homebrew/bin/perl => /opt/homebrew/Cellar/perl/5.24.1/bin/perl
Python: /opt/homebrew/bin/python => /opt/homebrew/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_121
macOS: 10.12.4-x86_64
Xcode: 8.3.1
CLT: 8.3.0.0.1.1490382677
X11: 2.7.11 => /opt/X11
I have no idea how to resolve this as I have tried every resolution I have found online, such as
sudo xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
brew update and retried your prior step?YES
brew doctor, fixed as many issues as possible and retried your prior step?YES - tried to install homebrew in /usr/local for debugging purposes - the same errors occur.
brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?YES - see above.
Help and suggestions would be highly appreciated.
Cheers,
Andre
I have the same issue. Started after the most recent xcode update
I'm having this issue as well
If others who have this problem could post diagnostic and configuration data in addition to simply chiming in, it is much more likely that this can be resolved. Also, @akrasa, the fact that your installation is nonstandard and is in /opt/ could potentially be a problem. I wonder if the 10.12.4 update changed your permissions/ACLs somehow...
Hi @JCount and thank you for getting back to me. I am aware that /opt is a non-standard installation path - but this issue is not related to the installation path as I have also installed a fresh copy of Homebrew into /usr/local in order to track down this issue. It didn't change anything.
Vim and ruby also refuse compilation when Homebrew is being installed in /usr/local and the error message remains the same.
I am happy to look up permissions for specific files but I have no clue of where to start. Since most of the other packages of Homebrew compile without any issues I don't think that entire directories are not readable. All subdirectories of /usr have the 755 permission, also files and subdirectories of /usr/include and /usr/lib look OK (at least at first sight).
I am having the same issue. It may not be the problem of Xcode as I don't install it.
run brew doctor:
Warning: Anaconda is known to frequently break Homebrew builds, including Vim and
MacVim, due to bundling many duplicates of system and Homebrew-available
tools.If you encounter a build failure please temporarily remove Anaconda
from your $PATH and attempt the build again prior to reporting the
failure to us. Thanks!
I remove Anaconda as suggested from PATH temporarily, and do brew upgrade again, everything is fixed...
Installing at least Xcode command line tools is required for compiling vim on macOS. This seems to be resolved now, must have been an issue with the vim repo. Doing brew update && brew upgrade now compiles fine.
@parc64 no sorry - still no luck here. I did brew update && brew upgrade (which works as desired) - but brew install vim still fails with the above error message(s).
Also I don't think that anything in the vim repo has been changed so far, as the version that is being downloaded when installing vim is exactly the same as the one I posted the gist-logs of (8.0.0562).
It might be that https://github.com/Homebrew/homebrew-core/pull/12563 solves the issue but since that release (8.0.0566) has not been published, I haven't been able to test it yet.
Also brew install ruby still fails... :(
@akrasa If you open the Console, and set it to 'Errors and Faults', and then try to build vim and/or ruby, does anything show up, e.g. a sandbox violation?
@JCount There are a few errors regarding the com.apple.networks subsystem belonging to the CoreSubsystem being unable to connect to certain hosts - but I doubt that is related to homebrew. Nothing regarding any sandbox violation though. Homebrew itself still throws the above error - even though vim now is being downloaded in version 8.0.0566.
@akrasa me too, got the exact same error like everyone else when upgrading to vim 8.0.0566 through brew upgrade.
ps: a newer version of Xcode __8.3.2__ released just today, let me install that and see.
update: no luck, the upgrade process failed during the make, like always.
update 2. Finally, I was able to get the vim upgrade to finish without error by commenting out this line in my __.bash_profile__ [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
@sutiam I have just upgraded to Xcode 8.3.2 by downloading it via AppStore and running xcode-select --install just to make sure - however the command exited by cheerfully informing me that the Command-Line Tools are already installed).
However, the compilation error remains the same. Vim (and ruby) refuse to successfully run ./configure by complaining that it cannot run C compiled programs. :(
I don't use bash but zsh and haven't been able to locate $HOME/.rvm/scripts/rvm - the whole .rvm directory doesn't exist on my system. Can you please share what the contents of $HOME/.rvm/scripts/rvm are?
It's an interesting hint though, I'll try to figure out if rvm (and - perhaps - broken references to ruby modules) break the build process on my system.
Update: Removed $HOME/.gem but didn't change anything...
Update 2: Changed Login-Shell to bash - but still no luck. :(
I had the same issue. Tried everything above with no success. I told rvm to use 'system' ruby (rvm use system) and all is well now.
try
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
Then
brew upgrade
restart terminal or zsh/bash, the PATH will change back to what it is before if you didn't change zsh or bash configure file.
@akrasa for the sake of troubleshooting, please try the installation from a new user account and see if it happens there.
As a shot in the dark, I tried removing /usr/local/bin from my path, then rerunning (had to manually specify the full path to brew since it's in /usr/local/bin).
This worked.
@jamesnaftel yeah, telling rvm use system has essentially the same effect here as commenting out [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" in __.bash_profile__.
Apparently upgrading to this latest version of vim would fail if rvm version of Ruby is used; hmmm ... I wonder if this extra step is going to be mandatory for all future vim upgrade via Homebrew.
But I think @ajkeeton 's case is different, the error code is different and he doesn't use rvm at all.
@ilovezfs Thank you for the suggestion. I have done a complete clean install of homebrew on another macOS machine (with exactly the same versions of macOS and Xcode) and there it compiles without any issue at all... No idea why - the machines should have exactly the same configuration. I really think that it must somehow be related to the system-ruby (which I have not touched on either the machines)...
@ajkeeton Tried it, but does not resolve the problem.
@gw372 Tried it, but does not resolve the problem.
@sutiam I don't have rvm installed on either of my machines. I might install it if it's needed - not a problem. But I doubt that it resolves anything, as the compilation on the second macOS machine (as mentioned above) was successfully completed without rvm being installed.
I am kind of unsure of how to proceed on that matter. I really wouldn't want to reinstall my notebook just in order to be able to successfully compile vim... Any suggestions on how to track down the issue?
I have been able to track down the issue further and am quite convinced that the issue is somehow related to the system-ruby. My attempt to upgrade system gems failed with Gem installation error: You have to install development tools first.
Any ideas?
SOLVED
People, you wouldn't believe it - thanks to a post by @tylerjohnst have finally managed to fix the problem.
It seems that there is a bug in the Apple AppStore that would roll out the Xcode V7 Command-Line Tools even though Xcode V8 is installed on the system. Those two versions are incompatible and thus cause the extremely strange behavior...
Solution:
1) rm -rf /Library/Developer/CommandLineTools
2) Download and install the _correct_ Xcode V8 Command-Line Tools from https://developer.apple.com/download/more
And all good :)
Thank you all for your assistance and your help!
@akrasa I'm confused. Your top post says
CLT: 8.3.0.0.1.1490382677
What makes you think CLT 7.x was installed?
@ilovezfs OK, I must admit I am totally confused now too.
I googled the various error messages and ended up in this thread: https://github.com/rbenv/ruby-build/issues/999 - the fact that deleting the Command-Line Tools and reinstalling them by downloading them from the Apple Developer Site made me believe that I also was experiencing the version incompatibilities that @tylerjohnst describes.
I didn't check the Xcode version before, but now that you have mentioned it I ran brew config again and - surprise - the version number of CLT: 8.3.0.0.1.1490382677 has remained the same. I have no idea why, but maybe the upgrade to Xcode 8.3.2 broke something in the CLT installation and simply re-installing them resolved the issue.
Can some of the other contributors to this thread who are experiencing similar problems - @parc64 and @jhorowitz - try reinstalling the CLT and let us know if that solves the issues?
Is there anyone who can still reproduce this issue?
I can reproduce it _consistently_ here. I've even reinstalled the CLI tools for Xcode 8.3.
+1 for the rvm use system solution鈥攊t's a workaround that solves the vim upgrade problem for me.
Today I was prompted in the AppStore to install an update for the CLI-tools - installed it and still everything works.
So for me deleting and re-installing the CLI definitively did the trick.
There seems to be a strong possibility that this is related to the original 8.3 version of CLT. Apple pushed an update yesterday, still labeled as version 8.3, that updates the clang version, among other things, and very likely contains bug fixes as well. (After the update, brew config will likely give a version beginning with 8.3.2.)
I strongly recommend installing that updating, which is available through the App Store, and then seeing if your issues persist.
Unless I'm doing something wrong, it hasn't made any difference here, at all.
aaron@workhorse ~ % brew config
HOMEBREW_VERSION: 1.1.13
ORIGIN: https://github.com/Homebrew/brew
HEAD: 46f6dc4c93b96abd528c3a0a808a5ca5a795c7f3
Last commit: 10 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 71164572b655c94ccf51b236ad3534ee9b289c04
Core tap last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit skylake
Homebrew Ruby: 2.0.0-p648
Clang: 8.1 build 802
Git: 2.12.2 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /opt/chefdk/embedded/bin/ruby
Java: 1.8.0_121, 1.8.0_111
macOS: 10.12.4-x86_64
Xcode: 8.3.2
CLT: 8.3.2.0.1.1492020469
X11: 2.7.11 => /opt/X11

@akulbe You are experiencing a very different error than the OP. Could you post your gist-logs of the failed build?
@akulbe I suspect that your issue lies with your Chef DK install in /opt. It looks like it has an embedded installation of ncurses. In this case it is probably interfering with the configure script's linking of the correct ncurses library and finding the termcap database.
The only real solution is probably either to find a way to have the script find /usr/bin/ncurses5.4-config first, or, ideally, specify it directly/manually. Prepending /usr/bin to the PATH may work.
EDITEDx2
@JCount Sure enough. Changing $PATH to put /usr/bin up front, even temporarily, did the trick. Thank you for the tip!
@akrasa Glad to hear that. I wasn't certain it would work because of the PATH filtering brew does, so I was looking for a more permanent/certain fix.
~ 禄 which xcodebuild
/usr/bin/xcodebuild
~ 禄 brew config
HOMEBREW_VERSION: 1.2.0
ORIGIN: https://github.com/Homebrew/brew
HEAD: 8cba0352e0be94263e2ed96c98bf93d8f2fce8ef
Last commit: 2 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: bb6e7e6ddff17f2b396c769cb52a9600e071cbcc
Core tap last commit: 80 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit broadwell
Homebrew Ruby: 2.0.0-p648
Clang: 8.1 build 802
Git: 2.11.0 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /Users/liuliang/.pyenv/shims/python => /Users/liuliang
Ruby: /usr/local/bin/ruby => /usr/local/Cellar/ruby/2.4.1_1/bin/ruby
Java: 1.8.0_111, 1.7.0_79
macOS: 10.12.4-x86_64
Xcode: 8.3.2
CLT: 8.3.2.0.1.1492020469
X11: N/A
I ran into this issue and it appears to be related to path settings. I already had the xcode cli tools and basically set my path to: export PATH=/usr/local/sbin:/usr/local/bin:/Developer/usr/bin:/Developer/usr/sbin:/usr/bin:/bin:/usr/sbin:/sbin
Had the same issue, updated Xcode to 8.3.x, ran xcodebuild -license, then rbenv shell system and pyenv shell system and everything worked. Modifying $PATH could probably do it as well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I'm still experiencing this issue鈥攚orking around it with rvm use system.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Most helpful comment
SOLVED
People, you wouldn't believe it - thanks to a post by @tylerjohnst have finally managed to fix the problem.
It seems that there is a bug in the Apple AppStore that would roll out the Xcode V7 Command-Line Tools even though Xcode V8 is installed on the system. Those two versions are incompatible and thus cause the extremely strange behavior...
Solution:
1) rm -rf /Library/Developer/CommandLineTools
2) Download and install the _correct_ Xcode V8 Command-Line Tools from https://developer.apple.com/download/more
And all good :)
Thank you all for your assistance and your help!