Add the beginnings of simpler dependency checking for tools.

Review Request #11529 — Created March 16, 2021 and submitted

Information

ReviewBot
release-3.0.x

Reviewers

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's check_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 new exe_paths environment variable and against $PATH,
allowing customization.

If found on $PATH, the path will be placed back in exe_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
Add the beginnings of simpler dependency checking for tools.
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's `check_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 new `exe_paths` environment variable and against `$PATH`, allowing customization. If found on `$PATH`, the path will be placed back in `exe_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.
0c949c31dd070e98b2d851c7ef62f2548f1b1dd4
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (d2447a6)
Loading...