Backed out changeset 2b174353e76a (bug 1316957) at glandium's request a=backout
authorWes Kocher <wkocher@mozilla.com>
Fri, 11 Nov 2016 18:58:24 -0800
changeset 352261 b4528880074575c9aff2f371387aa0c4475c911a
parent 352260 53d701cacdeacc6b49f958844ea69d8670e3c1fa
child 352262 35e7f81763324e9e33d8002c3addaaf75fbb08ed
push id6795
push userjlund@mozilla.com
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)
reviewersbackout
bugs1316957
milestone52.0a1
backs out2b174353e76a8c7b7595f29b21a797f8f84af72c
Backed out changeset 2b174353e76a (bug 1316957) at glandium's request a=backout
build/moz.configure/toolchain.configure
build/moz.configure/windows.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -899,14 +899,10 @@ def wrap_system_includes(target, visibil
 
 set_define('HAVE_VISIBILITY_HIDDEN_ATTRIBUTE',
            depends(visibility_flags)(lambda v: bool(v) or None))
 set_define('HAVE_VISIBILITY_ATTRIBUTE',
            depends(visibility_flags)(lambda v: bool(v) or None))
 set_config('WRAP_SYSTEM_INCLUDES', wrap_system_includes)
 set_config('VISIBILITY_FLAGS', visibility_flags)
 
-@depends(target)
-def is_windows(target):
-    return target.kernel == 'WINNT'
-
-include('windows.configure', when=is_windows)
+include('windows.configure')
 include('rust.configure')
--- 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 http://mozilla.org/MPL/2.0/.
 
 option('--with-windows-version', nargs=1, default='603',
        help='Windows SDK version to target. Win 8.1 (603) is currently'
             'the minimum supported version.')
 
-@depends('--with-windows-version')
+@depends(target)
+def is_windows(target):
+    return target.kernel == 'WINNT'
+
+
+@template
+def depends_win(*args):
+    return depends_when(*args, when=is_windows)
+
+
+@depends_win('--with-windows-version')
 @imports(_from='__builtin__', _import='ValueError')
 def valid_windows_version(value):
     if not value:
         die('Cannot build with --without-windows-version')
     try:
         version = int(value[0], 16)
         if version in (0x603,):
             return version
@@ -21,17 +31,17 @@ def valid_windows_version(value):
         pass
 
     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,
                           windows_sdk_dir_env):
     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('os')
 @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(
         path=sdk.path,
         include=sdk.include,
         lib=sdk.lib,
         version=version,
     )
 
 
-@depends(c_compiler)
+@depends_win(c_compiler)
 @imports('os')
 def vc_path(c_compiler):
     if c_compiler.type != 'msvc':
         return
     # 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':
             break
     return result
 
 
-@depends(vc_path)
+@depends_win(vc_path)
 @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)
 @imports('os')
 def include_path(vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
     if not vc_path:
         return
     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)
 @imports('os')
 def lib_path(target, vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
     if not vc_path:
         return
     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')
 
-@depends(valid_windows_sdk_dir)
+@depends_win(valid_windows_sdk_dir)
 @imports(_from='os', _import='environ')
 @imports('platform')
 def sdk_bin_path(valid_windows_sdk_dir):
     if not valid_windows_sdk_dir:
         return
 
     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':
         result.append(
             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',
                 paths=sdk_bin_path)
 
 
 # Check that MT is not something unexpected like "magnetic tape manipulation
 # utility".
-@depends(mt)
+@depends_win(mt)
 @checking('whether MT is really Microsoft Manifest Tool', lambda x: bool(x))
 @imports('subprocess')
 def valid_mt(path):
     try:
         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',
                   paths=vc_compiler_path)
 
-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().
-@depends(sdk_bin_path)
+@depends_win(sdk_bin_path)
 @imports('os')
 def alter_path(sdk_bin_path):
     path = os.pathsep.join(sdk_bin_path)
     os.environ['PATH'] = path
     return path
 
 set_config('PATH', alter_path)