From dafa11af9a0b346d12fb9e26adb21d8cff0d5a16 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Wed, 30 Dec 2015 23:17:49 +0000 Subject: [PATCH] doctor: add explicit anaconda warning Closes Homebrew/homebrew#47540. Signed-off-by: Dominyk Tiller --- Library/Homebrew/cmd/doctor.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 3946a535ff..142c7fe0e2 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -92,6 +92,31 @@ class Checks end end + # Anaconda installs multiple system & brew dupes, including OpenSSL, Python, + # sqlite, libpng, Qt, etc. Regularly breaks compile on Vim, MacVim and others. + # Is flagged as part of the *-config script checks below, but people seem + # to ignore those as warnings rather than extremely likely breakage. + def check_for_anaconda + return unless which("anaconda") + return unless which("python") + + anaconda = which("anaconda").realpath.dirname + python_binary = Utils.popen_read which("python"), "-c", "import sys; sys.stdout.write(sys.executable)" + python = Pathname.new(python_binary).realpath.dirname + + # Only warn if Python lives with Anaconda, since is most problematic case. + if python == anaconda then <<-EOS.undent + 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! + EOS + end + end + def __check_stray_files(dir, pattern, white_list, message) return unless File.directory?(dir)