diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index 092db29e9156..d1050b21ac5b 100755 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -920,25 +920,15 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None, 'Only clang/llvm 3.6 or newer is supported.') if info.type == 'msvc': - # 19.00 is VS2015. - # 19.10+ is VS2017+. - if info.version < '19.00.24213': + if info.version < '19.13.26128': raise FatalCheckError( 'This version (%s) of the MSVC compiler is not ' 'supported.\n' - 'You must install Visual C++ 2015 Update 3 or newer in ' + 'You must install Visual C++ 2017 Update 6 or newer in ' 'order to build.\n' 'See https://developer.mozilla.org/en/' 'Windows_Build_Prerequisites' % info.version) - if info.version >= '19.10' and info.version < '19.11.25506': - raise FatalCheckError( - 'This version (%s) of the MSVC compiler is not supported.\n' - 'You must install Visual C++ 2017 15.3 or newer in order ' - 'to build.\n' - 'See https://developer.mozilla.org/en/' - 'Windows_Build_Prerequisites' % info.version) - if info.flags: raise FatalCheckError( 'Unknown compiler or compiler not supported.') diff --git a/build/moz.configure/windows.configure b/build/moz.configure/windows.configure index 76f21465e495..63f8ad719f9c 100644 --- a/build/moz.configure/windows.configure +++ b/build/moz.configure/windows.configure @@ -228,7 +228,7 @@ def valid_ucrt_sdk_dir(windows_sdk_dir, windows_sdk_dir_env, c_compiler): 'Please install it.') version, sdk = sdks[valid_sdks[0]] - minimum_ucrt_version = Version('10.0.14393.0') + minimum_ucrt_version = Version('10.0.15063.0') if version < minimum_ucrt_version: raise FatalCheckError('Latest Universal CRT SDK version found %s' ' and minimum required is %s. This or a later' @@ -240,10 +240,10 @@ def valid_ucrt_sdk_dir(windows_sdk_dir, windows_sdk_dir_env, c_compiler): if c_compiler.type == 'clang-cl' and version >= broken_ucrt_version: raise FatalCheckError('Found SDK version %s but clang-cl builds' ' currently don\'t work with SDK version %s' - ' and later. You should use an older SDK,' - ' either by uninstalling the broken one or' + ' and later. You should use version %s,' + ' either by uninstalling the newer one or' ' setting a custom WINDOWSSDKDIR.' - % (version, broken_ucrt_version)) + % (version, broken_ucrt_version, minimum_ucrt_version)) return namespace( path=sdk.path, diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py index 6aefa78f3297..2a0b6922d7c8 100755 --- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py +++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py @@ -236,6 +236,8 @@ 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_2017u4 = VS('19.11.25547') +VS_2017u6 = VS('19.13.26128') VS_PLATFORM_X86 = { '_M_IX86': 600, @@ -847,7 +849,9 @@ class WindowsToolchainTest(BaseToolchainTest): '/opt/VS_2015/bin/cl': VS_2015 + VS_PLATFORM_X86, '/opt/VS_2015u1/bin/cl': VS_2015u1 + VS_PLATFORM_X86, '/opt/VS_2015u2/bin/cl': VS_2015u2 + VS_PLATFORM_X86, - '/usr/bin/cl': VS_2015u3 + VS_PLATFORM_X86, + '/opt/VS_2015u3/bin/cl': VS_2015u3 + VS_PLATFORM_X86, + '/opt/VS_2017u4/bin/cl': VS_2017u4 + VS_PLATFORM_X86, + '/usr/bin/cl': VS_2017u6 + 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, @@ -865,34 +869,42 @@ class WindowsToolchainTest(BaseToolchainTest): VS_2013u2_RESULT = ( 'This version (18.00.30501) of the MSVC compiler is not supported.\n' - 'You must install Visual C++ 2015 Update 3 or newer in order to build.\n' + 'You must install Visual C++ 2017 Update 6 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 3 or newer in order to build.\n' + 'You must install Visual C++ 2017 Update 6 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 3 or newer in order to build.\n' + 'You must install Visual C++ 2017 Update 6 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 3 or newer in order to build.\n' + 'You must install Visual C++ 2017 Update 6 or newer in order to build.\n' 'See https://developer.mozilla.org/en/Windows_Build_Prerequisites') 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' + 'You must install Visual C++ 2017 Update 6 or newer in order to build.\n' 'See https://developer.mozilla.org/en/Windows_Build_Prerequisites') - VS_2015u3_RESULT = CompilerResult( + VS_2015u3_RESULT = ( + 'This version (19.00.24213) of the MSVC compiler is not supported.\n' + 'You must install Visual C++ 2017 Update 6 or newer in order to build.\n' + 'See https://developer.mozilla.org/en/Windows_Build_Prerequisites') + VS_2017u4_RESULT = ( + 'This version (19.11.25547) of the MSVC compiler is not supported.\n' + 'You must install Visual C++ 2017 Update 6 or newer in order to build.\n' + 'See https://developer.mozilla.org/en/Windows_Build_Prerequisites') + VS_2017u6_RESULT = CompilerResult( flags=[], - version='19.00.24213', + version='19.13.26128', type='msvc', compiler='/usr/bin/cl', language='C', ) - VSXX_2015u3_RESULT = CompilerResult( + VSXX_2017u6_RESULT = CompilerResult( flags=[], - version='19.00.24213', + version='19.13.26128', type='msvc', compiler='/usr/bin/cl', language='C++', @@ -935,14 +947,26 @@ class WindowsToolchainTest(BaseToolchainTest): language='C++', ) - # VS2015u3 or greater is required. + # VS2017u6 or greater is required. def test_msvc(self): self.do_toolchain_test(self.PATHS, { - 'c_compiler': self.VS_2015u3_RESULT, - 'cxx_compiler': self.VSXX_2015u3_RESULT, + 'c_compiler': self.VS_2017u6_RESULT, + 'cxx_compiler': self.VSXX_2017u6_RESULT, }) def test_unsupported_msvc(self): + self.do_toolchain_test(self.PATHS, { + 'c_compiler': self.VS_2017u4_RESULT, + }, environ={ + 'CC': '/opt/VS_2017u4/bin/cl', + }) + + self.do_toolchain_test(self.PATHS, { + 'c_compiler': self.VS_2015u3_RESULT, + }, environ={ + 'CC': '/opt/VS_2015u3/bin/cl', + }) + self.do_toolchain_test(self.PATHS, { 'c_compiler': self.VS_2015u2_RESULT, }, environ={ @@ -1026,7 +1050,7 @@ class WindowsToolchainTest(BaseToolchainTest): def test_cannot_cross(self): paths = { - '/usr/bin/cl': VS_2015u3 + VS_PLATFORM_X86_64, + '/usr/bin/cl': VS_2017u6 + VS_PLATFORM_X86_64, } self.do_toolchain_test(paths, { 'c_compiler': ('Target C compiler target CPU (x86_64) ' @@ -1045,7 +1069,9 @@ class Windows64ToolchainTest(WindowsToolchainTest): '/opt/VS_2015/bin/cl': VS_2015 + VS_PLATFORM_X86_64, '/opt/VS_2015u1/bin/cl': VS_2015u1 + VS_PLATFORM_X86_64, '/opt/VS_2015u2/bin/cl': VS_2015u2 + VS_PLATFORM_X86_64, - '/usr/bin/cl': VS_2015u3 + VS_PLATFORM_X86_64, + '/opt/VS_2015u3/bin/cl': VS_2015u3 + VS_PLATFORM_X86_64, + '/opt/VS_2017u4/bin/cl': VS_2017u4 + VS_PLATFORM_X86_64, + '/usr/bin/cl': VS_2017u6 + 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, @@ -1063,7 +1089,7 @@ class Windows64ToolchainTest(WindowsToolchainTest): def test_cannot_cross(self): paths = { - '/usr/bin/cl': VS_2015u3 + VS_PLATFORM_X86, + '/usr/bin/cl': VS_2017u6 + VS_PLATFORM_X86, } self.do_toolchain_test(paths, { 'c_compiler': ('Target C compiler target CPU (x86) '