Bug 1537669 - Use llvm-mt.exe instead of mt.exe when available. r=dmajor
☠☠ backed out by 63df58e1fae0 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 21 Mar 2019 23:34:07 +0000
changeset 465562 40832d18745436bf9521334193728de42f3d67d5
parent 465561 db33a524a097cb94fed9b5c8520ffc17093a9583
child 465563 9fa430d66dab280abe459d16c728708e0d2edf52
push id35744
push userapavel@mozilla.com
push dateFri, 22 Mar 2019 16:44:08 +0000
treeherdermozilla-central@e66a2b59914d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1537669, 40152
milestone68.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 1537669 - Use llvm-mt.exe instead of mt.exe when available. r=dmajor MT is part of the Windows SDK, not MSVC, but an alternative exists for it: llvm-mt. The official LLVM distribution for Windows doesn't include it[1], though, so we can't just switch to it. 1. https://bugs.llvm.org/show_bug.cgi?id=40152 While here, remove the .exe suffix from the check, to future-proof for cross-windows builds. Differential Revision: https://phabricator.services.mozilla.com/D24326
build/moz.configure/windows.configure
--- a/build/moz.configure/windows.configure
+++ b/build/moz.configure/windows.configure
@@ -456,23 +456,27 @@ def sdk_bin_path(valid_windows_sdk_dir, 
         os.path.join(valid_windows_sdk_dir.path, versioned_bin, vc_host)
     ]
     if vc_host == 'x64':
         result.append(
             os.path.join(valid_windows_sdk_dir.path, versioned_bin, 'x86'))
     return result
 
 
-mt = check_prog('MT', ('mt.exe',), input='MT',
+mt = check_prog('MT', ('llvm-mt', 'mt'), input='MT',
                 paths=sdk_bin_path)
 
 
+@depends(mt)
+def mt_not_llvm_mt(mt):
+    return not os.path.basename(mt).lower().startswith('llvm')
+
 # Check that MT is not something unexpected like "magnetic tape manipulation
 # utility".
-@depends(mt)
+@depends(mt, when=mt_not_llvm_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: