From e40b73521709189c7d95169ff88939179d45d665 Mon Sep 17 00:00:00 2001
From: Jack Nagel <jacknagel@gmail.com>
Date: Thu, 25 Jun 2015 23:42:54 -0400
Subject: [PATCH] Decouple detect_stdlibs from ENV

I want to decouple from the global ENV constant as much as possible so
that eventually we can change the build environment implementation.
detect_stdlibs only cares about the compiler, not the whole ENV.
---
 Library/Homebrew/build.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index 508e46f463..42c3e16f45 100644
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -128,7 +128,7 @@ class Build
 
         formula.install
 
-        stdlibs = detect_stdlibs
+        stdlibs = detect_stdlibs(ENV.compiler)
         Tab.create(formula, ENV.compiler, stdlibs.first, formula.build).write
 
         # Find and link metafiles
@@ -138,9 +138,9 @@ class Build
     end
   end
 
-  def detect_stdlibs
+  def detect_stdlibs(compiler)
     keg = Keg.new(formula.prefix)
-    CxxStdlib.check_compatibility(formula, deps, keg, ENV.compiler)
+    CxxStdlib.check_compatibility(formula, deps, keg, compiler)
 
     # The stdlib recorded in the install receipt is used during dependency
     # compatibility checks, so we only care about the stdlib that libraries
-- 
GitLab