Bug 1467327 - Use bootstrapped clang if no system clang is found. r=froydnj
☠☠ backed out by 6cecb01994b9 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 07 Jun 2018 09:57:36 +0900
changeset 475869 ba02d348e3fdcc156a1f2fe2f69e2859d7f81d3c
parent 475868 26c53d78c90acf544b87d45d2c35ad787d3b586e
child 475870 6cecb01994b962eed55b684d3007002f2c374ced
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1467327
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1467327 - Use bootstrapped clang if no system clang is found. r=froydnj
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -634,31 +634,35 @@ def vc_compiler_path(host, target, vs_ma
     if not paths:
         return
     return paths
 
 
 @depends(vc_compiler_path)
 @imports('os')
 def toolchain_search_path(vc_compiler_path):
+    result = [os.environ.get('PATH')]
+
     if vc_compiler_path:
-        result = [os.environ.get('PATH')]
         result.extend(vc_compiler_path)
 
-        # Also add in the location to which `mach bootstrap` or
-        # `mach artifact toolchain` installs clang.
-        mozbuild_state_dir = os.environ.get('MOZBUILD_STATE_PATH',
-                                            os.path.expanduser(os.path.join('~', '.mozbuild')))
-        bootstrap_clang_path = os.path.join(mozbuild_state_dir, 'clang', 'bin')
-        result.append(bootstrap_clang_path)
+    # Also add in the location to which `mach bootstrap` or
+    # `mach artifact toolchain` installs clang.
+    mozbuild_state_dir = os.environ.get('MOZBUILD_STATE_PATH',
+                                        os.path.expanduser(os.path.join('~', '.mozbuild')))
+    bootstrap_clang_path = os.path.join(mozbuild_state_dir, 'clang', 'bin')
+    result.append(bootstrap_clang_path)
 
+    if vc_compiler_path:
         # We're going to alter PATH for good in windows.configure, but we also
-        # need to do it for the valid_compiler() check below.
+        # need to do it for the valid_compiler() check below. This is only needed
+        # on Windows, where MSVC needs PATH set to find dlls.
         os.environ['PATH'] = os.pathsep.join(result)
-        return result
+
+    return result
 
 
 @template
 def default_c_compilers(host_or_target):
     '''Template defining the set of default C compilers for the host and
     target platforms.
     `host_or_target` is either `host` or `target` (the @depends functions
     from init.configure.