Bug 886162 - prevent 'mach build testing' from building the entire tree. r=gps
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 16 Jul 2013 14:27:19 +1000
changeset 138621 f22202174cea5fe29f55239399c015eaf5b3cc43
parent 138620 e111361f9c1f4b0eedb02def1dc00ec0cc28241a
child 138622 31bd4657ff94411974696ca680c55144c5fe5390
push id24964
push userryanvm@gmail.com
push dateTue, 16 Jul 2013 20:04:09 +0000
treeherderautoland@fd10ead17ace [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs886162
milestone25.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 886162 - prevent 'mach build testing' from building the entire tree. r=gps
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -289,16 +289,27 @@ class Build(MachCommandBase):
                     path_arg = self._wrap_path_argument(target)
 
                     make_dir, make_target = resolve_target_to_make(self.topobjdir,
                         path_arg.relpath())
 
                     if make_dir is None and make_target is None:
                         return 1
 
+                    # See bug 886162 - we don't want to "accidentally" build
+                    # the entire tree (if that's really the intent, it's
+                    # unlikely they would have specified a directory.)
+                    if not make_dir and not make_target:
+                        print("The specified directory doesn't contain a "
+                              "Makefile and the first parent with one is the "
+                              "root of the tree. Please specify a directory "
+                              "with a Makefile or run |mach build| if you "
+                              "want to build the entire tree.")
+                        return 1
+
                     target_pairs.append((make_dir, make_target))
 
                 # Possibly add extra make depencies using dumbmake.
                 if not disable_extra_make_dependencies:
                     from dumbmake.dumbmake import (dependency_map,
                                                    add_extra_dependencies)
                     depfile = os.path.join(self.topsrcdir, 'build',
                                            'dumbmake-dependencies')