Bug 1523146 - Remove checks for MSVC < 2017. r=dmajor
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 28 Jan 2019 03:30:03 +0000
changeset 515599 ab7f23ee7562fd540b9b4705a90cb7aa5aa9b8a1
parent 515598 f86078e28b8726670017f74e6f0e5426768b63e5
child 515600 5d9c5aa981a5b824e6132c923c2f201b3fa49397
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1523146
milestone66.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 1523146 - Remove checks for MSVC < 2017. r=dmajor We reject MSVC compilers < 2017 already, there's no point checking for smaller versions after that. Differential Revision: https://phabricator.services.mozilla.com/D17770
build/moz.configure/toolchain.configure
build/moz.configure/windows.configure
python/mozbuild/mozbuild/backend/visualstudio.py
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1234,18 +1234,17 @@ non_msvc_compiler = depends(c_compiler)(
 building_with_gcc = depends(c_compiler)(lambda info: info.type == 'gcc')
 
 
 @depends(c_compiler)
 def msvs_version(info):
     # clang-cl emulates the same version scheme as cl. And MSVS_VERSION needs to
     # be set for GYP on Windows.
     if info.type in ('clang-cl', 'msvc'):
-        if info.version >= '19.10':
-            return '2017'
+        return '2017'
 
     return ''
 
 
 set_config('MSVS_VERSION', msvs_version)
 
 include('compile-checks.configure')
 
--- a/build/moz.configure/windows.configure
+++ b/build/moz.configure/windows.configure
@@ -270,33 +270,30 @@ def vc_path(c_compiler, toolchain_search
             die('Cannot determine the Visual C++ directory the compiler (%s) '
                 'is in' % cl)
         result = next
         if p.lower() == 'bin':
             break
     return os.path.normpath(result)
 
 
-@depends(vc_path, c_compiler)
+@depends(vc_path)
 @checking('for the Debug Interface Access SDK', lambda x: x or 'not found')
 @imports('os')
 @imports(_from='os.path', _import='isdir')
-def dia_sdk_dir(vc_path, c_compiler):
+def dia_sdk_dir(vc_path):
     dia_sdk_dir_env = os.environ.get('DIA_SDK_PATH')
     if dia_sdk_dir_env:
         return os.path.normpath(dia_sdk_dir_env)
 
     if vc_path:
-        if c_compiler.version < '19.10':
-            path = os.path.join(os.path.dirname(vc_path), 'DIA SDK')
-        else:
-            # This would be easier if we had the installationPath that
-            # get_vc_paths works with, since 'DIA SDK' is relative to that.
-            path = os.path.normpath(os.path.join(
-                vc_path, r'..\..\..\..\DIA SDK'))
+        # This would be easier if we had the installationPath that
+        # get_vc_paths works with, since 'DIA SDK' is relative to that.
+        path = os.path.normpath(os.path.join(
+            vc_path, r'..\..\..\..\DIA SDK'))
         if isdir(path):
             return path
 
 
 @depends(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:
@@ -331,25 +328,20 @@ def include_path(vc_path, windows_sdk_di
     return includes
 
 
 set_config('INCLUDE', include_path)
 
 
 @template
 def lib_path_for(host_or_target):
-    compiler = {
-        host: host_c_compiler,
-        target: c_compiler,
-    }[host_or_target]
-
-    @depends(host_or_target, dependable(host_or_target is host), compiler, vc_path,
+    @depends(host_or_target, dependable(host_or_target is host), vc_path,
              valid_windows_sdk_dir, valid_ucrt_sdk_dir, dia_sdk_dir)
     @imports('os')
-    def lib_path(target, is_host, c_compiler, vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
+    def lib_path(target, is_host, vc_path, windows_sdk_dir, ucrt_sdk_dir, dia_sdk_dir):
         if not vc_path:
             return
         sdk_target = {
             'x86': 'x86',
             'x86_64': 'x64',
             'arm': 'arm',
             'aarch64': 'arm64',
         }.get(target.cpu)
@@ -362,34 +354,29 @@ def lib_path_for(host_or_target):
         }.get(target.cpu)
         if old_target is None:
             return
         # As old_target can be '', and os.path.join will happily use the empty
         # string, leading to a string ending with a backslash, that Make will
         # interpret as a "string continues on next line" indicator, use variable
         # args.
         old_target = (old_target,) if old_target else ()
-        if c_compiler.version < '19.10':
-            # MSVC2015
-            vc_target = old_target
-        else:
-            # MSVC2017 switched to use the same target naming as the sdk.
-            vc_target = (sdk_target,)
 
-        atlmfc_dir = os.path.join(vc_path, 'atlmfc', 'lib', *vc_target)
+        # MSVC2017 switched to use the same target naming as the sdk.
+        atlmfc_dir = os.path.join(vc_path, 'atlmfc', 'lib', sdk_target)
         if not os.path.isdir(atlmfc_dir):
             die('Cannot find the ATL/MFC libraries in the Visual C++ directory '
                 '(%s). Please install them.' % vc_path)
 
         libs = []
         lib_env = os.environ.get('LIB')
         if lib_env and not is_host:
             libs.extend(lib_env.split(os.pathsep))
         libs.extend((
-            os.path.join(vc_path, 'lib', *vc_target),
+            os.path.join(vc_path, 'lib', sdk_target),
             atlmfc_dir,
             os.path.join(windows_sdk_dir.lib, 'um', sdk_target),
             os.path.join(ucrt_sdk_dir.lib, 'ucrt', sdk_target),
         ))
         if dia_sdk_dir:
             # For some reason the DIA SDK still uses the old-style targets
             # even in a newer MSVC.
             libs.append(os.path.join(dia_sdk_dir, 'lib', *old_target))
--- a/python/mozbuild/mozbuild/backend/visualstudio.py
+++ b/python/mozbuild/mozbuild/backend/visualstudio.py
@@ -35,26 +35,22 @@ from mozbuild.base import ExecutionSumma
 MSBUILD_NAMESPACE = 'http://schemas.microsoft.com/developer/msbuild/2003'
 
 def get_id(name):
     return str(uuid.uuid5(uuid.NAMESPACE_URL, name)).upper()
 
 def visual_studio_product_to_solution_version(version):
     if version == '2017':
         return '12.00', '15'
-    elif version == '2015':
-        return '12.00', '14'
     else:
         raise Exception('Unknown version seen: %s' % version)
 
 def visual_studio_product_to_platform_toolset_version(version):
     if version == '2017':
         return 'v141'
-    elif version == '2015':
-        return 'v140'
     else:
         raise Exception('Unknown version seen: %s' % version)
 
 class VisualStudioBackend(CommonBackend):
     """Generate Visual Studio project files.
 
     This backend is used to produce Visual Studio projects and a solution
     to foster developing Firefox with Visual Studio.
@@ -65,17 +61,17 @@ class VisualStudioBackend(CommonBackend)
 
     def _init(self):
         CommonBackend._init(self)
 
         # These should eventually evolve into parameters.
         self._out_dir = os.path.join(self.environment.topobjdir, 'msvc')
         self._projsubdir = 'projects'
 
-        self._version = self.environment.substs.get('MSVS_VERSION', '2015')
+        self._version = self.environment.substs.get('MSVS_VERSION', '2017')
 
         self._paths_to_sources = {}
         self._paths_to_includes = {}
         self._paths_to_defines = {}
         self._paths_to_configs = {}
         self._libs_to_paths = {}
         self._progs_to_paths = {}