Backed out changeset 2b174353e76a (bug 1316957) at glandium's request a=backout
authorWes Kocher <>
Fri, 11 Nov 2016 18:58:24 -0800
changeset 352261 b4528880074575c9aff2f371387aa0c4475c911a
parent 352260 53d701cacdeacc6b49f958844ea69d8670e3c1fa
child 352262 35e7f81763324e9e33d8002c3addaaf75fbb08ed
push id6795
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
backs out2b174353e76a8c7b7595f29b21a797f8f84af72c
Backed out changeset 2b174353e76a (bug 1316957) at glandium's request a=backout
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -899,14 +899,10 @@ def wrap_system_includes(target, visibil
            depends(visibility_flags)(lambda v: bool(v) or None))
            depends(visibility_flags)(lambda v: bool(v) or None))
 set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
 set_config('VISIBILITY_FLAGS', visibility_flags)
-def is_windows(target):
-    return target.kernel == 'WINNT'
-include('windows.configure', when=is_windows)
--- a/build/moz.configure/windows.configure
+++ b/build/moz.configure/windows.configure
@@ -3,17 +3,27 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at
 option('--with-windows-version', nargs=1, default='603',
        help='Windows SDK version to target. Win 8.1 (603) is currently'
             'the minimum supported version.')
+def is_windows(target):
+    return target.kernel == 'WINNT'
+def depends_win(*args):
+    return depends_when(*args, when=is_windows)
 @imports(_from='__builtin__', _import='ValueError')
 def valid_windows_version(value):
     if not value:
         die('Cannot build with --without-windows-version')
         version = int(value[0], 16)
         if version in (0x603,):
             return version
@@ -21,17 +31,17 @@ def valid_windows_version(value):
     die('Invalid value for --with-windows-version (%s)', value[0])
 option(env='WINDOWSSDKDIR', nargs=1,
        help='Directory containing the Windows SDK')
-@depends('WINDOWSSDKDIR', host)
+@depends_win('WINDOWSSDKDIR', host)
 def windows_sdk_dir(value, host):
     if value:
         return value
     if host.kernel != 'WINNT':
         return ()
     return tuple(x[1] for x in get_registry_values(
         r'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots'
@@ -84,17 +94,18 @@ def get_sdk_dirs(sdk, subdir):
 @imports(_from='mozbuild.shellutil', _import='quote')
 def valid_windows_sdk_dir_result(value):
     if value:
         return '0x%04x in %s' % (value.version, quote(value.path))
-@depends(c_compiler, windows_sdk_dir, valid_windows_version, 'WINDOWSSDKDIR')
+@depends_win(c_compiler, windows_sdk_dir, valid_windows_version,
+             'WINDOWSSDKDIR')
 @checking('for Windows SDK', valid_windows_sdk_dir_result)
 @imports(_from='__builtin__', _import='sorted')
 @imports(_from='textwrap', _import='dedent')
 def valid_windows_sdk_dir(compiler, windows_sdk_dir, target_version,
     if windows_sdk_dir_env:
         windows_sdk_dir_env = windows_sdk_dir_env[0]
     sdks = {}
@@ -160,17 +171,17 @@ add_old_configure_assignment(
         lambda x: '0x%04X0000' % x.version if x else None))
 @imports(_from='mozbuild.shellutil', _import='quote')
 def valid_ucrt_sdk_dir_result(value):
     if value:
         return '%s in %s' % (value.version, quote(value.path))
-@depends(windows_sdk_dir, 'WINDOWSSDKDIR')
+@depends_win(windows_sdk_dir, 'WINDOWSSDKDIR')
 @checking('for Universal CRT SDK', valid_ucrt_sdk_dir_result)
 @imports(_from='__builtin__', _import='sorted')
 @imports(_import='mozpack.path', _as='mozpath')
 def valid_ucrt_sdk_dir(windows_sdk_dir, windows_sdk_dir_env):
     if windows_sdk_dir_env:
         windows_sdk_dir_env = windows_sdk_dir_env[0]
     sdks = {}
@@ -226,17 +237,17 @@ def valid_ucrt_sdk_dir(windows_sdk_dir, 
     return namespace(
 def vc_path(c_compiler):
     if c_compiler.type != 'msvc':
     # Normally, we'd start from c_compiler.compiler, but for now, it's not the
     # ideal full path to the compiler. At least, we're guaranteed find_program
     # will get us the one we found in toolchain.configure.
     cl = find_program(c_compiler.compiler)
@@ -247,27 +258,27 @@ def vc_path(c_compiler):
             die('Cannot determine the Visual C++ directory the compiler (%s) '
                 'is in' % cl)
         result = next
         if p.lower() == 'bin':
     return result
 @checking('for the Debug Interface Access SDK', lambda x: x or 'not found')
 @imports(_from='os.path', _import='isdir')
 def dia_sdk_dir(vc_path):
     if vc_path:
         path = os.path.join(os.path.dirname(vc_path), 'DIA SDK')
         if isdir(path):
             return path
-@depends(vc_path, valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
+@depends_win(vc_path, valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
 def include_path(vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
     if not vc_path:
     atlmfc_dir = os.path.join(vc_path, 'atlmfc', 'include')
     if not os.path.isdir(atlmfc_dir):
         die('Cannot find the ATL/MFC headers in the Visual C++ directory (%s). '
             'Please install them.' % vc_path)
@@ -294,17 +305,17 @@ def include_path(vc_path, windows_sdk_di
     # Set in the environment for old-configure
     includes = os.pathsep.join(includes)
     os.environ['INCLUDE'] = includes
     return includes
 set_config('INCLUDE', include_path)
-@depends(target, vc_path, valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
+@depends_win(target, vc_path, valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
 def lib_path(target, vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
     if not vc_path:
     vc_target = {
         'x86': '',
         'x86_64': 'amd64',
         'arm': 'arm',
@@ -345,17 +356,17 @@ def lib_path(target, vc_path, windows_sd
     os.environ['LIB'] = libs
     return libs
 set_config('LIB', lib_path)
 option(env='MT', nargs=1, help='Path to the Microsoft Manifest Tool')
 @imports(_from='os', _import='environ')
 def sdk_bin_path(valid_windows_sdk_dir):
     if not valid_windows_sdk_dir:
     vc_host = {
         'x86': 'x86',
@@ -367,23 +378,23 @@ def sdk_bin_path(valid_windows_sdk_dir):
         os.path.join(valid_windows_sdk_dir.path, 'bin', vc_host)
     if vc_host == 'x64':
             os.path.join(valid_windows_sdk_dir.path, 'bin', 'x86'))
     return result
-mt = check_prog('MT', ('mt.exe',), input='MT',
+mt = check_prog('MT', depends_win()(lambda: ('mt.exe',)), input='MT',
 # Check that MT is not something unexpected like "magnetic tape manipulation
 # utility".
 @checking('whether MT is really Microsoft Manifest Tool', lambda x: bool(x))
 def valid_mt(path):
         out = subprocess.check_output([path]).splitlines()
         out = '\n'.join(l for l in out
                         if 'Microsoft (R) Manifest Tool' in l)
         if out:
@@ -395,26 +406,26 @@ def valid_mt(path):
 set_config('MSMANIFEST_TOOL', depends(valid_mt)(lambda x: bool(x)))
 # Ultimately, this will move to toolchain.configure and be turned into a
 # cross-platform check.
 option(env='LD', nargs=1, help='Path to the linker')
-link = check_prog('LINK', ('link.exe',), input='LD',
+link = check_prog('LINK', depends_win()(lambda: ('link.exe',)), input='LD',
-add_old_configure_assignment('LD', depends(link)(lambda x: x))
+add_old_configure_assignment('LD', depends_win(link)(lambda x: x))
 # Normally, we'd just have CC, etc. set to absolute paths, but the build system
 # doesn't currently handle properly the case where the paths contain spaces.
 # Additionally, there's the issue described in toolchain.configure, in
 # valid_compiler().
 def alter_path(sdk_bin_path):
     path = os.pathsep.join(sdk_bin_path)
     os.environ['PATH'] = path
     return path
 set_config('PATH', alter_path)