Bug 1432223 - Add an --all-crates option to mach cargo check, to check all the crates. r=froydnj
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 22 Jan 2018 12:46:29 -0500
changeset 400795 89f827270939f8b03b94ff6228dcc164ff77f4f2
parent 400794 a39f7d5c004134b3a3140b96351729fab8392535
child 400796 798e1d210015c51eeeb495ce0cd0a39ec4fd24d8
push id33318
push useraiakab@mozilla.com
push dateFri, 26 Jan 2018 00:17:50 +0000
treeherdermozilla-central@c25d4fc1b17e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1432223
milestone60.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 1432223 - Add an --all-crates option to mach cargo check, to check all the crates. r=froydnj MozReview-Commit-ID: 2nst2ctsI6s
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -270,28 +270,32 @@ class CargoProvider(MachCommandBase):
     @Command('cargo', category='build',
              description='Invoke cargo in useful ways.')
     def cargo(self):
         self.parser.print_usage()
         return 1
 
     @SubCommand('cargo', 'check',
                 description='Run `cargo check` on a given crate.  Defaults to gkrust.')
+    @CommandArgument('--all-crates', default=None, action='store_true',
+        help='Check all of the crates in the tree.')
     @CommandArgument('crates', default=None, nargs='*', help='The crate name(s) to check.')
-    def check(self, crates=None):
+    def check(self, all_crates=None, crates=None):
         # XXX duplication with `mach vendor rust`
         crates_and_roots = {
             'gkrust': 'toolkit/library/rust',
             'gkrust-gtest': 'toolkit/library/gtest/rust',
             'js': 'js/rust',
             'mozjs_sys': 'js/src',
             'geckodriver': 'testing/geckodriver',
         }
 
-        if crates == None or crates == []:
+        if all_crates:
+            crates = crates_and_roots.keys()
+        elif crates == None or crates == []:
             crates = ['gkrust']
 
         for crate in crates:
             root = crates_and_roots.get(crate, None)
             if not root:
                 print('Cannot locate crate %s.  Please check your spelling or '
                       'add the crate information to the list.' % crate)
                 return 1