From 706e7e71a07784f14abbdf5f019428e04afcfae6 Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Fri, 15 Jul 2016 03:36:04 +0100 Subject: [PATCH] mac/super: restore definition of effective_sysroot In https://github.com/Homebrew/brew/commit/0d189fae57bad6c209b471eba9e0b254a2b40886 we completely removed `effective_sysroot`, which consequently left all the `effective_sysroot`/usr/include calls pointing at `/usr/include`. This is wildly problematic on systems where the Command Line Tools aren't installed because `/usr/include` is not a default-created folder prior to CLT installation. I'm unsure if `effective_sysroot` should still be mentioned in Library/Homebrew/extend/ENV/super.rb at all. If it can be deleted, feel free to do that without waiting for me to review. This seems to fix: * https://github.com/Homebrew/homebrew-core/issues/2991 * https://github.com/Homebrew/homebrew-core/issues/2986 * https://github.com/Homebrew/homebrew-core/issues/2962 --- Library/Homebrew/extend/os/mac/extend/ENV/super.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb index eacf488134..9e0a251370 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb @@ -7,6 +7,10 @@ module Superenv bin.realpath unless bin.nil? end + def effective_sysroot + MacOS::Xcode.without_clt? ? MacOS.sdk_path.to_s : nil + end + def homebrew_extra_paths paths = [] # On 10.9, there are shims for all tools in /usr/bin.