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 821132 ece31a9e0c0b4b97fd0a1248c0f722c591dd82e7
parent 821131 564e53c57905714866e727e649e79ea14cb808b3
child 821133 6259a3d0d8a3caa42fd7b41faefdae3c183a63a1
push id117018
push userbmo:sfoster@mozilla.com
push dateSat, 21 Jul 2018 04:05:10 +0000
reviewersbhearsum
bugs1477276
milestone63.0a1
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)