# HG changeset patch # User Andi-Bogdan Postelnicu # Date 1542883672 0 # Node ID a22ad02cbdcc24eaf3cb62ed1436da87d6f1dacb # Parent e3fde88d8b32d81335b93e9fe3ff78c1ff67a2c2 Bug 1509276 - mach static-analysis install - should accept more flags in order to make it more robust. r=sylvestre Depends on D12599 Differential Revision: https://phabricator.services.mozilla.com/D12635 diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -2104,24 +2104,29 @@ class StaticAnalysis(MachCommandBase): help='Where to fetch a local archive containing the static-analysis and ' 'format helper tool.' 'It will be installed in ~/.mozbuild/clang-tools and ~/.mozbuild/infer.' 'Can be omitted, in which case the latest clang-tools and infer ' 'helper for the platform would be automatically detected and installed.') @CommandArgument('--skip-cache', action='store_true', help='Skip all local caches to force re-fetching the helper tool.', default=False) - def install(self, source=None, skip_cache=False, verbose=False): + @CommandArgument('--force', action='store_true', + help='Force re-install even though the tool exists in mozbuild.', + default=False) + @CommandArgument('--minimal-install', action='store_true', help='Download only clang based tool.', + default=False) + def install(self, source=None, skip_cache=False, force=False, minimal_install=False, verbose=False): self._set_log_level(verbose) - rc = self._get_clang_tools(force=True, skip_cache=skip_cache, + rc = self._get_clang_tools(force=force, skip_cache=skip_cache, source=source, verbose=verbose) - if rc == 0: + if rc == 0 and not minimal_install: # XXX ignore the return code because if it fails or not, infer is # not mandatory, but clang-tidy is - self._get_infer(force=True, skip_cache=skip_cache, verbose=verbose) + self._get_infer(force=force, skip_cache=skip_cache, verbose=verbose) return rc @StaticAnalysisSubCommand('static-analysis', 'clear-cache', 'Delete local helpers and reset static analysis helper tool cache') def clear_cache(self, verbose=False): self._set_log_level(verbose) rc = self._get_clang_tools(force=True, download_if_needed=True, skip_cache=True, verbose=verbose)