mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
bootstrap: Add a --skip-platform
option (#32176)
This allows installign `taplo` and `crown` when you are installing dependencies manually.
This commit is contained in:
parent
3014e201ab
commit
4a12c06309
3 changed files with 12 additions and 5 deletions
|
@ -198,7 +198,9 @@ def bootstrap_command_only(topdir):
|
||||||
import servo.util
|
import servo.util
|
||||||
|
|
||||||
try:
|
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:
|
except NotImplementedError as exception:
|
||||||
print(exception)
|
print(exception)
|
||||||
return 1
|
return 1
|
||||||
|
|
|
@ -40,12 +40,15 @@ class MachCommands(CommandBase):
|
||||||
@CommandArgument('--force', '-f',
|
@CommandArgument('--force', '-f',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help='Boostrap without confirmation')
|
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.
|
# Note: This entry point isn't actually invoked by ./mach bootstrap.
|
||||||
# ./mach bootstrap calls mach_bootstrap.bootstrap_command_only so that
|
# ./mach bootstrap calls mach_bootstrap.bootstrap_command_only so that
|
||||||
# it can install dependencies without needing mach's dependencies
|
# it can install dependencies without needing mach's dependencies
|
||||||
try:
|
try:
|
||||||
servo.platform.get().bootstrap(force)
|
servo.platform.get().bootstrap(force, skip_platform)
|
||||||
except NotImplementedError as exception:
|
except NotImplementedError as exception:
|
||||||
print(exception)
|
print(exception)
|
||||||
return 1
|
return 1
|
||||||
|
|
|
@ -54,10 +54,12 @@ class Base:
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def bootstrap(self, force: bool):
|
def bootstrap(self, force: bool, skip_platform: bool):
|
||||||
installed_something = self._platform_bootstrap(force)
|
if not skip_platform:
|
||||||
|
installed_something = self._platform_bootstrap(force)
|
||||||
installed_something |= self.install_taplo(force)
|
installed_something |= self.install_taplo(force)
|
||||||
installed_something |= self.install_crown(force)
|
installed_something |= self.install_crown(force)
|
||||||
|
|
||||||
if not installed_something:
|
if not installed_something:
|
||||||
print("Dependencies were already installed!")
|
print("Dependencies were already installed!")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue