mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-01 20:13:00 +00:00

Tie into `code_analysis`'s `get_clang_tools()` functionality to intelligently bootstrap clang if it either doesn't exist or is out-of-date. This required exposing `command_context` to the linting logic, as it's needed to call `artifact_toolchain(...)`. Note that this means that the standalone `runcli.py` file won't be able to support bootstrapping `clang-format`, or other linters that lean on `command_context` in the future. Finally, `substs.get("HOST_BIN_SUFFIX")` was replaced with a windows-specific `binary += ".exe"`, because not all contexts where the tests are run will have access to populated `substs` data. Note that this worked before without the extension because it was only used for starting a process, in which context Windows automatically tries all `PATHEXT` options. Since we're now doing an `isfile()` check (to enable more intelligent failure cases when `clang-format` doesn't exist), we need the path to be fully correct. Differential Revision: https://phabricator.services.mozilla.com/D137335