Bug 1477276 - Fix regression preventing |mach help| without an objdir r=bhearsum
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 20 Jul 2018 14:58:06 +0000
changeset 427483 ece31a9e0c0b4b97fd0a1248c0f722c591dd82e7
parent 427482 564e53c57905714866e727e649e79ea14cb808b3
child 427484 6259a3d0d8a3caa42fd7b41faefdae3c183a63a1
push id34306
push usercsabou@mozilla.com
push dateFri, 20 Jul 2018 21:41:18 +0000
treeherdermozilla-central@d6a5e8aea651 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhearsum
bugs1477276
milestone63.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 1477276 - Fix regression preventing |mach help| without an objdir r=bhearsum Differential Revision: https://phabricator.services.mozilla.com/D2267
testing/mach_commands.py
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -15,17 +15,21 @@ import shutil
 
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
     SettingsProvider,
 )
 
-from mozbuild.base import MachCommandBase, MachCommandConditions as conditions
+from mozbuild.base import (
+    BuildEnvironmentNotFoundException,
+    MachCommandBase,
+    MachCommandConditions as conditions,
+)
 from moztest.resolve import TEST_SUITES
 from argparse import ArgumentParser
 
 UNKNOWN_TEST = '''
 I was unable to find tests from the given argument(s).
 
 You should specify a test directory, filename, test suite name, or
 abbreviation. If no arguments are given, there must be local file
@@ -331,17 +335,21 @@ class CheckSpiderMonkeyCommand(MachComma
         all_passed = jittest_result and jstest_result and jsapi_tests_result and \
             check_js_msg_result
 
         return all_passed
 
 
 def has_js_binary(binary):
     def has_binary(cls):
-        name = binary + cls.substs['BIN_SUFFIX']
+        try:
+            name = binary + cls.substs['BIN_SUFFIX']
+        except BuildEnvironmentNotFoundException:
+            return False
+
         path = os.path.join(cls.topobjdir, 'dist', 'bin', name)
 
         has_binary.__doc__ = """
 `{}` not found in <objdir>/dist/bin. Make sure you aren't using an artifact build
 and try rebuilding with `ac_add_options --enable-js-shell`.
 """.format(name).lstrip()
 
         return os.path.isfile(path)