Bug 1481693 - Add --no-system-changes argument to 'mach bootstrap', r=gps
authorDan Mosedale <dmose@mozilla.org>
Wed, 08 Aug 2018 16:18:47 -0700
changeset 486177 a0e53aa1b0fb145b13145f6f30f8a700479c0a7f
parent 486176 719fdec4ac2732c1bec40089450deae29617d8d8
child 486178 f9e703507607f5a4fd9b65b636c4d04fb9acac79
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1481693
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 1481693 - Add --no-system-changes argument to 'mach bootstrap', r=gps MozReview-Commit-ID: AMYM3rAPVcl
python/mozboot/mozboot/base.py
python/mozboot/mozboot/bootstrap.py
python/mozboot/mozboot/mach_commands.py
--- a/python/mozboot/mozboot/base.py
+++ b/python/mozboot/mozboot/base.py
@@ -152,19 +152,20 @@ MODERN_PYTHON_VERSION = LooseVersion('2.
 
 # Upgrade rust older than this.
 MODERN_RUST_VERSION = LooseVersion('1.28.0')
 
 
 class BaseBootstrapper(object):
     """Base class for system bootstrappers."""
 
-    def __init__(self, no_interactive=False):
+    def __init__(self, no_interactive=False, no_system_changes=False):
         self.package_manager_updated = False
         self.no_interactive = no_interactive
+        self.no_system_changes = no_system_changes
         self.state_dir = None
 
     def install_system_packages(self):
         '''
         Install packages shared by all applications. These are usually
         packages required by the development (like mercurial) or the
         build system (like autoconf).
         '''
--- a/python/mozboot/mozboot/bootstrap.py
+++ b/python/mozboot/mozboot/bootstrap.py
@@ -166,23 +166,25 @@ DEBIAN_DISTROS = (
     '"elementary"'
 )
 
 
 class Bootstrapper(object):
     """Main class that performs system bootstrap."""
 
     def __init__(self, finished=FINISHED, choice=None, no_interactive=False,
-                 hg_configure=False):
+                 hg_configure=False, no_system_changes=False):
         self.instance = None
         self.finished = finished
         self.choice = choice
         self.hg_configure = hg_configure
+        self.no_system_changes = no_system_changes
         cls = None
-        args = {'no_interactive': no_interactive}
+        args = {'no_interactive': no_interactive,
+                'no_system_changes': no_system_changes}
 
         if sys.platform.startswith('linux'):
             distro, version, dist_id = platform.linux_distribution()
 
             if distro in ('CentOS', 'CentOS Linux', 'Fedora'):
                 cls = CentOSFedoraBootstrapper
                 args['distro'] = distro
             elif distro in DEBIAN_DISTROS:
--- a/python/mozboot/mozboot/mach_commands.py
+++ b/python/mozboot/mozboot/mach_commands.py
@@ -20,20 +20,26 @@ class Bootstrap(object):
     @Command('bootstrap', category='devenv',
              description='Install required system packages for building.')
     @CommandArgument('--application-choice',
                      default=None,
                      help='Pass in an application choice (see mozboot.bootstrap.APPLICATIONS) '
                      'instead of using the default interactive prompt.')
     @CommandArgument('--no-interactive', dest='no_interactive', action='store_true',
                      help='Answer yes to any (Y/n) interactive prompts.')
-    def bootstrap(self, application_choice=None, no_interactive=False):
+    @CommandArgument('--no-system-changes', dest='no_system_changes',
+                     action='store_true',
+                     help='Only execute actions that leave the system '
+                          'configuration alone.')
+    def bootstrap(self, application_choice=None, no_interactive=False, no_system_changes=False):
         from mozboot.bootstrap import Bootstrapper
 
-        bootstrapper = Bootstrapper(choice=application_choice, no_interactive=no_interactive)
+        bootstrapper = Bootstrapper(choice=application_choice,
+                                    no_interactive=no_interactive,
+                                    no_system_changes=no_system_changes)
         bootstrapper.bootstrap()
 
 
 @CommandProvider
 class VersionControlCommands(object):
     def __init__(self, context):
         self._context = context