Bug 1508419 - Gracefully fail if nasm doesn't print version. r=firefox-build-system-reviewers,mshal
authorThomas Daede <tdaede@mozilla.com>
Mon, 26 Nov 2018 16:13:48 +0000
changeset 507339 95d8c0fa8d6496f12cbff5709f4e816a5475bfc3
parent 507338 bb579a94d0f69b239d897307ac9c81eb7f7a72ef
child 507340 d534baf412772ee14e0d89f651267cb4dc2a3f6c
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, mshal
bugs1508419
milestone65.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 1508419 - Gracefully fail if nasm doesn't print version. r=firefox-build-system-reviewers,mshal This is required on Mac, where there is a dummy nasm executable that prints an error if the real nasm isn't found. Differential Revision: https://phabricator.services.mozilla.com/D12371
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -121,20 +121,22 @@ set_config('YASM_ASFLAGS', yasm_asflags)
 # nasm detection
 # ==============================================================
 nasm = check_prog('NASM', ['nasm'], allow_missing=True)
 
 
 @depends_if(nasm)
 @checking('nasm version')
 def nasm_version(nasm):
-    version = check_cmd_output(
-        nasm, '-v',
-        onerror=lambda: die('Failed to get nasm version.')
-    ).splitlines()[0].split()[2]
+    (retcode, stdout, _) = get_cmd_output(nasm, '-v')
+    if retcode:
+        # mac stub binary
+        return None
+
+    version = stdout.splitlines()[0].split()[2]
     return Version(version)
 
 
 @depends_if(nasm_version)
 def nasm_major_version(nasm_version):
     return str(nasm_version.major)