From 2baf6487d1c876a86a97af0b0d10a5aa9e07d172 Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Mon, 25 Jun 2012 15:13:35 -0500 Subject: [PATCH] Hotfix for stack overflow Under certain circumstances, MacOS.locate and MacOS.dev_tools_path would call each other recursively. This was limited to systems with Xcode minus the CLT. See Homebrew/homebrew#13012. --- Library/Homebrew/utils.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index e71fc12f87..cb051e52ea 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -320,7 +320,7 @@ module MacOS extend self # xcode-select is not configured properly (i.e. xctools_fucked?). p = "#{MacOS.xcode_prefix}/Toolchains/XcodeDefault.xctoolchain/usr/bin/#{tool}" if File.executable? p - path Pathname.new p + path = Pathname.new p else path = nil end @@ -334,9 +334,6 @@ module MacOS extend self @dev_tools_path ||= if File.exist? "/usr/bin/cc" and File.exist? "/usr/bin/make" # probably a safe enough assumption (the unix way) Pathname.new "/usr/bin" - elsif not xctools_fucked? - # The new way of finding stuff via locate: - Pathname.new(locate 'make').dirname elsif File.exist? "#{xcode_prefix}/usr/bin/make" # cc stopped existing with Xcode 4.3, there are c89 and c99 options though Pathname.new "#{xcode_prefix}/usr/bin"