From e331cc67c3f8d09b3108d6e8f3bd92128dad3b42 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Mon, 24 Jun 2024 19:13:09 +0200 Subject: [PATCH] mach: Expose a `--skip-static-analysis` to `mach boostrap` (#32587) This should speed up runners which just need to run the WPT tests. Fixes #32582. --- .github/workflows/docs.yml | 2 +- .github/workflows/linux-wpt.yml | 2 +- .github/workflows/mac-wpt.yml | 2 +- python/mach_bootstrap.py | 3 ++- python/servo/bootstrap_commands.py | 7 +++++-- python/servo/platform/base.py | 9 +++++---- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e0ea96468b5..f546469f962 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,7 @@ jobs: run: | python3 -m pip install --upgrade pip sudo apt update - python3 ./mach bootstrap + python3 ./mach bootstrap --skip-lints - name: Set LIBCLANG_PATH # This is needed for bindgen in mozangle. run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV - name: Compile docs diff --git a/.github/workflows/linux-wpt.yml b/.github/workflows/linux-wpt.yml index 1142f357962..c90a5ef7372 100644 --- a/.github/workflows/linux-wpt.yml +++ b/.github/workflows/linux-wpt.yml @@ -55,7 +55,7 @@ jobs: python3 -m pip install --upgrade pip sudo apt update sudo apt install -qy --no-install-recommends mesa-vulkan-drivers - python3 ./mach bootstrap + python3 ./mach bootstrap --skip-lints - name: Sync from upstream WPT if: ${{ inputs.wpt-sync-from-upstream }} run: | diff --git a/.github/workflows/mac-wpt.yml b/.github/workflows/mac-wpt.yml index 3d50d618f45..1dd28e86d7c 100644 --- a/.github/workflows/mac-wpt.yml +++ b/.github/workflows/mac-wpt.yml @@ -45,7 +45,7 @@ jobs: run: | gtar -xzf target.tar.gz python3 -m pip install --upgrade pip - python3 ./mach bootstrap + python3 ./mach bootstrap --skip-lints - name: Smoketest run: python3 ./mach smoketest --${{ inputs.profile }} - name: Run tests diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py index 6690bc1bd2c..41cf6dc810d 100644 --- a/python/mach_bootstrap.py +++ b/python/mach_bootstrap.py @@ -200,7 +200,8 @@ def bootstrap_command_only(topdir): try: force = '-f' in sys.argv or '--force' in sys.argv skip_platform = '--skip-platform' in sys.argv - servo.platform.get().bootstrap(force, skip_platform) + skip_lints = '--skip-lints' in sys.argv + servo.platform.get().bootstrap(force, skip_platform, skip_lints) except NotImplementedError as exception: print(exception) return 1 diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 3545de3a82d..362509ffc3a 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -43,12 +43,15 @@ class MachCommands(CommandBase): @CommandArgument('--skip-platform', action='store_true', help='Skip platform bootstrapping.') - def bootstrap(self, force=False, skip_platform=False): + @CommandArgument('--skip-lints', + action='store_true', + help='Skip tool necessary for linting.') + def bootstrap(self, force=False, skip_platform=False, skip_lints=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, skip_platform) + servo.platform.get().bootstrap(force, skip_platform, skip_lints) except NotImplementedError as exception: print(exception) return 1 diff --git a/python/servo/platform/base.py b/python/servo/platform/base.py index 0e81f149d9e..3cfbd09b618 100644 --- a/python/servo/platform/base.py +++ b/python/servo/platform/base.py @@ -54,13 +54,14 @@ class Base: except FileNotFoundError: return False - def bootstrap(self, force: bool, skip_platform: bool): + def bootstrap(self, force: bool, skip_platform: bool, skip_lints: bool): installed_something = False if not skip_platform: installed_something |= self._platform_bootstrap(force) - installed_something |= self.install_taplo(force) - installed_something |= self.install_cargo_deny(force) - installed_something |= self.install_crown(force) + if not skip_lints: + installed_something |= self.install_taplo(force) + installed_something |= self.install_cargo_deny(force) + installed_something |= self.install_crown(force) if not installed_something: print("Dependencies were already installed!")