bootstrap: Add a --skip-platform option (#32176)

This allows installign `taplo` and `crown` when you are installing
dependencies manually.
This commit is contained in:
Martin Robinson 2024-04-29 17:29:11 +02:00 committed by GitHub
parent 3014e201ab
commit 4a12c06309
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 5 deletions

View file

@ -198,7 +198,9 @@ def bootstrap_command_only(topdir):
import servo.util
try:
servo.platform.get().bootstrap('-f' in sys.argv or '--force' in sys.argv)
force = '-f' in sys.argv or '--force' in sys.argv
skip_platform = '--skip-platform' in sys.argv
servo.platform.get().bootstrap(force, skip_platform)
except NotImplementedError as exception:
print(exception)
return 1

View file

@ -40,12 +40,15 @@ class MachCommands(CommandBase):
@CommandArgument('--force', '-f',
action='store_true',
help='Boostrap without confirmation')
def bootstrap(self, force=False):
@CommandArgument('--skip-platform',
action='store_true',
help='Skip platform bootstrapping.')
def bootstrap(self, force=False, skip_platform=False):
# Note: This entry point isn't actually invoked by ./mach bootstrap.
# ./mach bootstrap calls mach_bootstrap.bootstrap_command_only so that
# it can install dependencies without needing mach's dependencies
try:
servo.platform.get().bootstrap(force)
servo.platform.get().bootstrap(force, skip_platform)
except NotImplementedError as exception:
print(exception)
return 1

View file

@ -54,10 +54,12 @@ class Base:
except FileNotFoundError:
return False
def bootstrap(self, force: bool):
installed_something = self._platform_bootstrap(force)
def bootstrap(self, force: bool, skip_platform: bool):
if not skip_platform:
installed_something = self._platform_bootstrap(force)
installed_something |= self.install_taplo(force)
installed_something |= self.install_crown(force)
if not installed_something:
print("Dependencies were already installed!")