Add the beginnings of simpler dependency checking for tools.
Review Request #11529 — Created March 16, 2021 and submitted
Most tools have an executable they depend on. A command line tool or
script that performs the actual checks. As part of worker startup, each
tool'scheck_dependencies()
is called in order to check that any and
all command line tools were satisfied.This process was repetitive, and a bit flawed. A couple of tools needed
manual configuration in order to find the tools, but assumptions were made
about the presence of configuration keys in one of these cases, despite
never making that a part of the default configuration. Other tools had
no ability to customize the location of the command line script.This change introduces a new
exe_dependencies
attribute, which
BaseTool.check_dependencies()
will check. Each item will be checked
both against a newexe_paths
environment variable and against$PATH
,
allowing customization.If found on
$PATH
, the path will be placed back inexe_paths
,
allowing tools to directly look up the location. That both simplifies
their code and avoids an implicit lookup on$PATH
every time the tool
is executed.
Unit tests pass.
Made changes to all the tools (not part of this change) and verified that
dependency resolution worked correctly, and that results were cached.
Summary | ID |
---|---|
0c949c31dd070e98b2d851c7ef62f2548f1b1dd4 |