Bug 1319901 - Enforce Visual Studio 2015 Update 3 as the minimum supported compiler version for Windows builds. r=gps a=jcristau
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 15 Dec 2016 19:27:03 -0500
changeset 353053 06bdb65a9a46faeeda1ba40c19442073205ce60e
parent 353052 6f0be357dd95d0180e500fffa87ac88230f556ae
child 353054 091da5c14150c98f6d538c3cd2970b66fb3c0ad0
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)
reviewersgps, jcristau
bugs1319901
milestone52.0a2
Bug 1319901 - Enforce Visual Studio 2015 Update 3 as the minimum supported compiler version for Windows builds. r=gps a=jcristau
build/build-clang/build-clang.py
build/moz.configure/toolchain.configure
python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
--- a/build/build-clang/build-clang.py
+++ b/build/build-clang/build-clang.py
@@ -383,17 +383,17 @@ if __name__ == "__main__":
             os.environ['LD_LIBRARY_PATH'] = '%s/lib64/' % gcc_dir
     elif is_windows():
         extra_cflags = []
         extra_cxxflags = []
         # clang-cl would like to figure out what it's supposed to be emulating
         # by looking at an MSVC install, but we don't really have that here.
         # Force things on.
         extra_cflags2 = []
-        extra_cxxflags2 = ['-fms-compatibility-version=19.00.23918', '-Xclang', '-std=c++14']
+        extra_cxxflags2 = ['-fms-compatibility-version=19.00.24213', '-Xclang', '-std=c++14']
 
     build_one_stage(
         [cc] + extra_cflags,
         [cxx] + extra_cxxflags,
         llvm_source_dir, stage1_dir, build_libcxx,
         build_type, assertions, python_path, gcc_dir)
 
     if stages > 1:
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -347,22 +347,22 @@ def check_compiler(compiler, language, t
     if info.language == 'C++':
         if info.type in ('clang', 'gcc') and info.language_version != 201103:
             append_flag('-std=gnu++11')
         # MSVC 2015 headers include C++14 features, but don't guard them
         # with appropriate checks.
         if info.type == 'clang-cl' and info.language_version != 201402:
             append_flag('-std=c++14')
 
-    # We force clang-cl to emulate Visual C++ 2015 Update 2 with fallback to
+    # We force clang-cl to emulate Visual C++ 2015 Update 3 with fallback to
     # cl.exe.
-    if info.type == 'clang-cl' and info.version != '19.00.23918':
+    if info.type == 'clang-cl' and info.version != '19.00.24213':
         # Those flags are direct clang-cl flags that don't need -Xclang, add
         # them directly.
-        flags.append('-fms-compatibility-version=19.00.23918')
+        flags.append('-fms-compatibility-version=19.00.24213')
         flags.append('-fallback')
 
     # Check compiler target
     # --------------------------------------------------------------------
     if not info.cpu or info.cpu != target.cpu:
         if info.type == 'clang':
             append_flag('--target=%s' % target.toolchain)
         elif info.type == 'gcc':
@@ -693,21 +693,21 @@ def compiler(language, host_or_target, c
 
         # If you want to bump the version check here search for
         # __cpp_static_assert above, and see the associated comment.
         if info.type == 'clang' and not info.version:
             raise FatalCheckError(
                 'Only clang/llvm 3.6 or newer is supported.')
 
         if info.type == 'msvc':
-            if info.version < '19.00.23918':
+            if info.version < '19.00.24213':
                 raise FatalCheckError(
                     'This version (%s) of the MSVC compiler is not '
                     'supported.\n'
-                    'You must install Visual C++ 2015 Update 2 or newer in '
+                    'You must install Visual C++ 2015 Update 3 or newer in '
                     'order to build.\n'
                     'See https://developer.mozilla.org/en/'
                     'Windows_Build_Prerequisites' % info.version)
 
         return namespace(
             wrapper=wrapper,
             compiler=compiler,
             flags=flags,
--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
+++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
@@ -208,16 +208,17 @@ def VS(version):
     })
 
 
 VS_2013u2 = VS('18.00.30501')
 VS_2013u3 = VS('18.00.30723')
 VS_2015 = VS('19.00.23026')
 VS_2015u1 = VS('19.00.23506')
 VS_2015u2 = VS('19.00.23918')
+VS_2015u3 = VS('19.00.24213')
 
 VS_PLATFORM_X86 = {
     '_M_IX86': 600,
     '_WIN32': 1,
 }
 
 VS_PLATFORM_X86_64 = {
     '_M_X64': 100,
@@ -228,17 +229,17 @@ VS_PLATFORM_X86_64 = {
 # Note: In reality, the -std=gnu* options are only supported when preceded by
 # -Xclang.
 CLANG_CL_3_9 = (CLANG_BASE('3.9.0') + VS('18.00.00000') + DEFAULT_C11 +
                 SUPPORTS_GNU99 + SUPPORTS_GNUXX11 + SUPPORTS_CXX14) + {
     '*.cpp': {
         '__STDC_VERSION__': False,
         '__cplusplus': '201103L',
     },
-    '-fms-compatibility-version=19.00.23918': VS('19.00.23918')[None],
+    '-fms-compatibility-version=19.00.24213': VS('19.00.24213')[None],
 }
 
 CLANG_CL_PLATFORM_X86 = FakeCompiler(VS_PLATFORM_X86, GCC_PLATFORM_X86[None])
 CLANG_CL_PLATFORM_X86_64 = FakeCompiler(VS_PLATFORM_X86_64, GCC_PLATFORM_X86_64[None])
 
 
 class BaseToolchainTest(BaseConfigureTest):
     def setUp(self):
@@ -727,17 +728,18 @@ class WindowsToolchainTest(BaseToolchain
 
     # For the purpose of this test, it doesn't matter that the paths are not
     # real Windows paths.
     PATHS = {
         '/opt/VS_2013u2/bin/cl': VS_2013u2 + VS_PLATFORM_X86,
         '/opt/VS_2013u3/bin/cl': VS_2013u3 + VS_PLATFORM_X86,
         '/opt/VS_2015/bin/cl': VS_2015 + VS_PLATFORM_X86,
         '/opt/VS_2015u1/bin/cl': VS_2015u1 + VS_PLATFORM_X86,
-        '/usr/bin/cl': VS_2015u2 + VS_PLATFORM_X86,
+        '/opt/VS_2015u2/bin/cl': VS_2015u2 + VS_PLATFORM_X86,
+        '/usr/bin/cl': VS_2015u3 + VS_PLATFORM_X86,
         '/usr/bin/clang-cl': CLANG_CL_3_9 + CLANG_CL_PLATFORM_X86,
         '/usr/bin/gcc': GCC_4_9 + GCC_PLATFORM_X86_WIN,
         '/usr/bin/g++': GXX_4_9 + GCC_PLATFORM_X86_WIN,
         '/usr/bin/gcc-4.7': GCC_4_7 + GCC_PLATFORM_X86_WIN,
         '/usr/bin/g++-4.7': GXX_4_7 + GCC_PLATFORM_X86_WIN,
         '/usr/bin/gcc-5': GCC_5 + GCC_PLATFORM_X86_WIN,
         '/usr/bin/g++-5': GXX_5 + GCC_PLATFORM_X86_WIN,
         '/usr/bin/clang': CLANG_3_6 + CLANG_PLATFORM_X86_WIN,
@@ -745,79 +747,89 @@ class WindowsToolchainTest(BaseToolchain
         '/usr/bin/clang-3.6': CLANG_3_6 + CLANG_PLATFORM_X86_WIN,
         '/usr/bin/clang++-3.6': CLANGXX_3_6 + CLANG_PLATFORM_X86_WIN,
         '/usr/bin/clang-3.3': CLANG_3_3 + CLANG_PLATFORM_X86_WIN,
         '/usr/bin/clang++-3.3': CLANGXX_3_3 + CLANG_PLATFORM_X86_WIN,
     }
 
     VS_2013u2_RESULT = (
         'This version (18.00.30501) of the MSVC compiler is not supported.\n'
-        'You must install Visual C++ 2015 Update 2 or newer in order to build.\n'
+        'You must install Visual C++ 2015 Update 3 or newer in order to build.\n'
         'See https://developer.mozilla.org/en/Windows_Build_Prerequisites')
     VS_2013u3_RESULT = (
         'This version (18.00.30723) of the MSVC compiler is not supported.\n'
-        'You must install Visual C++ 2015 Update 2 or newer in order to build.\n'
+        'You must install Visual C++ 2015 Update 3 or newer in order to build.\n'
         'See https://developer.mozilla.org/en/Windows_Build_Prerequisites')
     VS_2015_RESULT = (
         'This version (19.00.23026) of the MSVC compiler is not supported.\n'
-        'You must install Visual C++ 2015 Update 2 or newer in order to build.\n'
+        'You must install Visual C++ 2015 Update 3 or newer in order to build.\n'
         'See https://developer.mozilla.org/en/Windows_Build_Prerequisites')
     VS_2015u1_RESULT = (
         'This version (19.00.23506) of the MSVC compiler is not supported.\n'
-        'You must install Visual C++ 2015 Update 2 or newer in order to build.\n'
+        'You must install Visual C++ 2015 Update 3 or newer in order to build.\n'
         'See https://developer.mozilla.org/en/Windows_Build_Prerequisites')
-    VS_2015u2_RESULT = CompilerResult(
+    VS_2015u2_RESULT = (
+        'This version (19.00.23918) of the MSVC compiler is not supported.\n'
+        'You must install Visual C++ 2015 Update 3 or newer in order to build.\n'
+        'See https://developer.mozilla.org/en/Windows_Build_Prerequisites')
+    VS_2015u3_RESULT = CompilerResult(
         flags=[],
-        version='19.00.23918',
+        version='19.00.24213',
         type='msvc',
         compiler='/usr/bin/cl',
         language='C',
     )
-    VSXX_2015u2_RESULT = CompilerResult(
+    VSXX_2015u3_RESULT = CompilerResult(
         flags=[],
-        version='19.00.23918',
+        version='19.00.24213',
         type='msvc',
         compiler='/usr/bin/cl',
         language='C++',
     )
     CLANG_CL_3_9_RESULT = CompilerResult(
         flags=['-Xclang', '-std=gnu99',
-               '-fms-compatibility-version=19.00.23918', '-fallback'],
-        version='19.00.23918',
+               '-fms-compatibility-version=19.00.24213', '-fallback'],
+        version='19.00.24213',
         type='clang-cl',
         compiler='/usr/bin/clang-cl',
         language='C',
     )
     CLANGXX_CL_3_9_RESULT = CompilerResult(
         flags=['-Xclang', '-std=c++14',
-               '-fms-compatibility-version=19.00.23918', '-fallback'],
-        version='19.00.23918',
+               '-fms-compatibility-version=19.00.24213', '-fallback'],
+        version='19.00.24213',
         type='clang-cl',
         compiler='/usr/bin/clang-cl',
         language='C++',
     )
     CLANG_3_3_RESULT = LinuxToolchainTest.CLANG_3_3_RESULT
     CLANGXX_3_3_RESULT = LinuxToolchainTest.CLANGXX_3_3_RESULT
     CLANG_3_6_RESULT = LinuxToolchainTest.CLANG_3_6_RESULT
     CLANGXX_3_6_RESULT = LinuxToolchainTest.CLANGXX_3_6_RESULT
     GCC_4_7_RESULT = LinuxToolchainTest.GCC_4_7_RESULT
     GCC_4_9_RESULT = LinuxToolchainTest.GCC_4_9_RESULT
     GXX_4_9_RESULT = LinuxToolchainTest.GXX_4_9_RESULT
     GCC_5_RESULT = LinuxToolchainTest.GCC_5_RESULT
     GXX_5_RESULT = LinuxToolchainTest.GXX_5_RESULT
 
-    # VS2015u2 or greater is required.
+    # VS2015u3 or greater is required.
     def test_msvc(self):
         self.do_toolchain_test(self.PATHS, {
-            'c_compiler': self.VS_2015u2_RESULT,
-            'cxx_compiler': self.VSXX_2015u2_RESULT,
+            'c_compiler': self.VS_2015u3_RESULT,
+            'cxx_compiler': self.VSXX_2015u3_RESULT,
         })
 
     def test_unsupported_msvc(self):
         self.do_toolchain_test(self.PATHS, {
+            'c_compiler': self.VS_2015u2_RESULT,
+        }, environ={
+            'CC': '/opt/VS_2015u2/bin/cl',
+        })
+
+        self.do_toolchain_test(self.PATHS, {
             'c_compiler': self.VS_2015u1_RESULT,
         }, environ={
             'CC': '/opt/VS_2015u1/bin/cl',
         })
 
         self.do_toolchain_test(self.PATHS, {
             'c_compiler': self.VS_2015_RESULT,
         }, environ={
@@ -884,17 +896,17 @@ class WindowsToolchainTest(BaseToolchain
             'cxx_compiler': self.CLANGXX_3_3_RESULT,
         }, environ={
             'CC': 'clang-3.3',
             'CXX': 'clang++-3.3',
         })
 
     def test_cannot_cross(self):
         paths = {
-            '/usr/bin/cl': VS_2015u2 + VS_PLATFORM_X86_64,
+            '/usr/bin/cl': VS_2015u3 + VS_PLATFORM_X86_64,
         }
         self.do_toolchain_test(paths, {
             'c_compiler': ('Target C compiler target CPU (x86_64) '
                            'does not match --target CPU (i686)'),
         })
 
 
 class Windows64ToolchainTest(WindowsToolchainTest):
@@ -902,17 +914,18 @@ class Windows64ToolchainTest(WindowsTool
 
     # For the purpose of this test, it doesn't matter that the paths are not
     # real Windows paths.
     PATHS = {
         '/opt/VS_2013u2/bin/cl': VS_2013u2 + VS_PLATFORM_X86_64,
         '/opt/VS_2013u3/bin/cl': VS_2013u3 + VS_PLATFORM_X86_64,
         '/opt/VS_2015/bin/cl': VS_2015 + VS_PLATFORM_X86_64,
         '/opt/VS_2015u1/bin/cl': VS_2015u1 + VS_PLATFORM_X86_64,
-        '/usr/bin/cl': VS_2015u2 + VS_PLATFORM_X86_64,
+        '/opt/VS_2015u2/bin/cl': VS_2015u2 + VS_PLATFORM_X86_64,
+        '/usr/bin/cl': VS_2015u3 + VS_PLATFORM_X86_64,
         '/usr/bin/clang-cl': CLANG_CL_3_9 + CLANG_CL_PLATFORM_X86_64,
         '/usr/bin/gcc': GCC_4_9 + GCC_PLATFORM_X86_64_WIN,
         '/usr/bin/g++': GXX_4_9 + GCC_PLATFORM_X86_64_WIN,
         '/usr/bin/gcc-4.7': GCC_4_7 + GCC_PLATFORM_X86_64_WIN,
         '/usr/bin/g++-4.7': GXX_4_7 + GCC_PLATFORM_X86_64_WIN,
         '/usr/bin/gcc-5': GCC_5 + GCC_PLATFORM_X86_64_WIN,
         '/usr/bin/g++-5': GXX_5 + GCC_PLATFORM_X86_64_WIN,
         '/usr/bin/clang': CLANG_3_6 + CLANG_PLATFORM_X86_64_WIN,
@@ -920,17 +933,17 @@ class Windows64ToolchainTest(WindowsTool
         '/usr/bin/clang-3.6': CLANG_3_6 + CLANG_PLATFORM_X86_64_WIN,
         '/usr/bin/clang++-3.6': CLANGXX_3_6 + CLANG_PLATFORM_X86_64_WIN,
         '/usr/bin/clang-3.3': CLANG_3_3 + CLANG_PLATFORM_X86_64_WIN,
         '/usr/bin/clang++-3.3': CLANGXX_3_3 + CLANG_PLATFORM_X86_64_WIN,
     }
 
     def test_cannot_cross(self):
         paths = {
-            '/usr/bin/cl': VS_2015u2 + VS_PLATFORM_X86,
+            '/usr/bin/cl': VS_2015u3 + VS_PLATFORM_X86,
         }
         self.do_toolchain_test(paths, {
             'c_compiler': ('Target C compiler target CPU (x86) '
                            'does not match --target CPU (x86_64)'),
         })
 
 
 class LinuxCrossCompileToolchainTest(BaseToolchainTest):