Skip to content

Commit

Permalink
bootstrap: Add a --skip-platform option
Browse files Browse the repository at this point in the history
This allows installign `taplo` and `crown` when you are installing
dependencies manually.
  • Loading branch information
mrobinson committed Apr 29, 2024
1 parent 5a4c81f commit fbbc61f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion python/mach_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions python/servo/bootstrap_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions python/servo/platform/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ def is_gstreamer_installed(self, cross_compilation_target: Optional[str]) -> boo
except FileNotFoundError:
return False

def bootstrap(self, force: bool):
def bootstrap(self, force: bool, skip_platform: bool):
installed_something = self.install_taplo(force)
installed_something |= self.install_crown(force)
installed_something |= self._platform_bootstrap(force)

if not skip_platform:
installed_something |= self._platform_bootstrap(force)

if not installed_something:
print("Dependencies were already installed!")

Expand Down

0 comments on commit fbbc61f

Please sign in to comment.